[S390] cio: consolidate subchannel intparm reset
authorPeter Oberparleiter <peter.oberparleiter@de.ibm.com>
Fri, 11 Sep 2009 08:28:16 +0000 (10:28 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 11 Sep 2009 08:29:36 +0000 (10:29 +0200)
Ensure that the hardware interruption parameter for a subchannel is
reset when the associated subchannel data structure is freed.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/cio/css.c
drivers/s390/cio/device.c

index 85d43c6bcb66a3521de03370d74c399c87440de8..40d4b3093b718cacbaca1c514e999aed44e10fca 100644 (file)
@@ -170,6 +170,9 @@ css_subchannel_release(struct device *dev)
 
        sch = to_subchannel(dev);
        if (!cio_is_console(sch->schid)) {
+               /* Reset intparm to zeroes. */
+               sch->config.intparm = 0;
+               cio_commit_config(sch);
                kfree(sch->lock);
                kfree(sch);
        }
index d593bc76afe316478374f99e970a37f469cebbf9..b6240227ecbaadad777b0d7d576e3f62f2f2976e 100644 (file)
@@ -1024,9 +1024,6 @@ static void ccw_device_call_sch_unregister(struct work_struct *work)
                return;
        sch = to_subchannel(cdev->dev.parent);
        css_sch_device_unregister(sch);
-       /* Reset intparm to zeroes. */
-       sch->config.intparm = 0;
-       cio_commit_config(sch);
        /* Release cdev reference for workqueue processing.*/
        put_device(&cdev->dev);
        /* Release subchannel reference for local processing. */
@@ -1210,9 +1207,6 @@ static void io_subchannel_do_unreg(struct work_struct *work)
 
        sch = container_of(work, struct subchannel, work);
        css_sch_device_unregister(sch);
-       /* Reset intparm to zeroes. */
-       sch->config.intparm = 0;
-       cio_commit_config(sch);
        put_device(&sch->dev);
 }
 
@@ -1688,10 +1682,6 @@ static int io_subchannel_sch_event(struct subchannel *sch, int slow)
                spin_unlock_irqrestore(sch->lock, flags);
                css_sch_device_unregister(sch);
                spin_lock_irqsave(sch->lock, flags);
-
-               /* Reset intparm to zeroes. */
-               sch->config.intparm = 0;
-               cio_commit_config(sch);
                break;
        case REPROBE:
                ccw_device_trigger_reprobe(cdev);