]> git.hungrycats.org Git - linux/commitdiff
[PATCH] s390: common i/o layer
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 6 Jul 2004 16:17:53 +0000 (09:17 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 6 Jul 2004 16:17:53 +0000 (09:17 -0700)
From: Arnd Bergmann <arndb@de.ibm.com>

Common i/o layer changes:
 - Reorder checking and setting of the ccw device id.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/s390/cio/device_fsm.c

index fe10f20da40a7b07f637debed6e2614d74bbee9e..35e584c454004021912ab1c58fb6e825f8fd5918 100644 (file)
@@ -165,8 +165,6 @@ ccw_device_handle_oper(struct ccw_device *cdev)
                return;
        }
        cdev->private->flags.donotify = 1;
-       /* Get device online again. */
-       ccw_device_online(cdev);
 }
 
 /*
@@ -233,15 +231,23 @@ ccw_device_recog_done(struct ccw_device *cdev, int state)
                          cdev->private->devno, sch->irq);
                break;
        case DEV_STATE_OFFLINE:
-               if (cdev->private->state == DEV_STATE_DISCONNECTED_SENSE_ID)
+               if (cdev->private->state == DEV_STATE_DISCONNECTED_SENSE_ID) {
+                       ccw_device_handle_oper(cdev);
                        notify = 1;
-               else  /* fill out sense information */
-                       cdev->id = (struct ccw_device_id) {
-                               .cu_type   = cdev->private->senseid.cu_type,
-                               .cu_model  = cdev->private->senseid.cu_model,
-                               .dev_type  = cdev->private->senseid.dev_type,
-                               .dev_model = cdev->private->senseid.dev_model,
-                       };
+               }
+               /* fill out sense information */
+               cdev->id = (struct ccw_device_id) {
+                       .cu_type   = cdev->private->senseid.cu_type,
+                       .cu_model  = cdev->private->senseid.cu_model,
+                       .dev_type  = cdev->private->senseid.dev_type,
+                       .dev_model = cdev->private->senseid.dev_model,
+               };
+               if (notify) {
+                       /* Get device online again. */
+                       ccw_device_online(cdev);
+                       wake_up(&cdev->private->wait_q);
+                       return;
+               }
                /* Issue device info message. */
                CIO_DEBUG(KERN_INFO, 2, "SenseID : device %04x reports: "
                          "CU  Type/Mod = %04X/%02X, Dev Type/Mod = "
@@ -256,10 +262,7 @@ ccw_device_recog_done(struct ccw_device *cdev, int state)
                break;
        }
        cdev->private->state = state;
-       if (notify && state == DEV_STATE_OFFLINE)
-               ccw_device_handle_oper(cdev);
-       else
-               io_subchannel_recog_done(cdev);
+       io_subchannel_recog_done(cdev);
        if (state != DEV_STATE_NOT_OPER)
                wake_up(&cdev->private->wait_q);
 }