[S390] cio: handle error during device recognition consistently
[pandora-kernel.git] / drivers / s390 / cio / device_fsm.c
index b163743..83adb91 100644 (file)
@@ -498,20 +498,9 @@ ccw_device_sense_pgid_done(struct ccw_device *cdev, int err)
 /*
  * Start device recognition.
  */
-int
-ccw_device_recognition(struct ccw_device *cdev)
+void ccw_device_recognition(struct ccw_device *cdev)
 {
-       struct subchannel *sch;
-       int ret;
-
-       sch = to_subchannel(cdev->dev.parent);
-       ret = cio_enable_subchannel(sch, (u32)(addr_t)sch);
-       if (ret != 0)
-               /* Couldn't enable the subchannel for i/o. Sick device. */
-               return ret;
-
-       /* After 60s the device recognition is considered to have failed. */
-       ccw_device_set_timeout(cdev, 60*HZ);
+       struct subchannel *sch = to_subchannel(cdev->dev.parent);
 
        /*
         * We used to start here with a sense pgid to find out whether a device
@@ -523,8 +512,11 @@ ccw_device_recognition(struct ccw_device *cdev)
         */
        cdev->private->flags.recog_done = 0;
        cdev->private->state = DEV_STATE_SENSE_ID;
+       if (cio_enable_subchannel(sch, (u32) (addr_t) sch)) {
+               ccw_device_recog_done(cdev, DEV_STATE_NOT_OPER);
+               return;
+       }
        ccw_device_sense_id_start(cdev);
-       return 0;
 }
 
 /*