cio: remove {get,put}_driver
authorSebastian Ott <sebott@linux.vnet.ibm.com>
Tue, 24 Jan 2012 18:35:02 +0000 (13:35 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 25 Jan 2012 00:00:35 +0000 (16:00 -0800)
Remove useless {get,put}_driver - the caller of the functions
has to ensure valid driver pointers.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/s390/cio/ccwgroup.c
drivers/s390/cio/device.c

index 4f1989d27b1f4b4163b4c03f5ffa8ae895d88eb7..5f1dc6fb5708b938765880a12722c3b70e0175a1 100644 (file)
@@ -580,7 +580,6 @@ void ccwgroup_driver_unregister(struct ccwgroup_driver *cdriver)
        struct device *dev;
 
        /* We don't want ccwgroup devices to live longer than their driver. */
-       get_driver(&cdriver->driver);
        while ((dev = driver_find_device(&cdriver->driver, NULL, NULL,
                                         __ccwgroup_match_all))) {
                struct ccwgroup_device *gdev = to_ccwgroupdev(dev);
@@ -592,7 +591,6 @@ void ccwgroup_driver_unregister(struct ccwgroup_driver *cdriver)
                mutex_unlock(&gdev->reg_mutex);
                put_device(dev);
        }
-       put_driver(&cdriver->driver);
        driver_unregister(&cdriver->driver);
 }
 EXPORT_SYMBOL(ccwgroup_driver_unregister);
index 47269858ecb662af862c38a5e96fc4f9aacfe2ca..02d015259461623719bc4b3c09b89e18bb1050b5 100644 (file)
@@ -1676,15 +1676,9 @@ struct ccw_device *get_ccwdev_by_busid(struct ccw_driver *cdrv,
                                       const char *bus_id)
 {
        struct device *dev;
-       struct device_driver *drv;
 
-       drv = get_driver(&cdrv->driver);
-       if (!drv)
-               return NULL;
-
-       dev = driver_find_device(drv, NULL, (void *)bus_id,
+       dev = driver_find_device(&cdrv->driver, NULL, (void *)bus_id,
                                 __ccwdev_check_busid);
-       put_driver(drv);
 
        return dev ? to_ccwdev(dev) : NULL;
 }