diff options
author | Cornelia Huck <cohuck@de.ibm.com> | 2005-06-25 14:55:27 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-25 16:24:36 -0700 |
commit | b0744bd2925a4a24865963322534107d2ad553f9 (patch) | |
tree | 7e09f76872685d29dd03a0955ee948c4f00f4f8b /drivers/s390/cio/ccwgroup.c | |
parent | 84dd8d7e9c080b4db66b00b8bc36ccf09a90f824 (diff) |
[PATCH] s/390: Use klist in cio
Convert the common I/O layer to use the klist interfaces.
This patch has been adapted from the previous version to the changed interface
semantics. Also, gcc 4.0 compile warnings have been removed.
Signed-off-by: Cornelia Huck <cohuck@de.ibm.com>
Cc: Greg KH <greg@kroah.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/s390/cio/ccwgroup.c')
-rw-r--r-- | drivers/s390/cio/ccwgroup.c | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c index 306525acb9f..91ea8e4777f 100644 --- a/drivers/s390/cio/ccwgroup.c +++ b/drivers/s390/cio/ccwgroup.c @@ -403,34 +403,22 @@ ccwgroup_driver_register (struct ccwgroup_driver *cdriver) return driver_register(&cdriver->driver); } -static inline struct device * -__get_next_ccwgroup_device(struct device_driver *drv) +static int +__ccwgroup_driver_unregister_device(struct device *dev, void *data) { - struct device *dev, *d; - - down_read(&drv->bus->subsys.rwsem); - dev = NULL; - list_for_each_entry(d, &drv->devices, driver_list) { - dev = get_device(d); - if (dev) - break; - } - up_read(&drv->bus->subsys.rwsem); - return dev; + __ccwgroup_remove_symlinks(to_ccwgroupdev(dev)); + device_unregister(dev); + put_device(dev); + return 0; } 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 = __get_next_ccwgroup_device(&cdriver->driver))) { - __ccwgroup_remove_symlinks(to_ccwgroupdev(dev)); - device_unregister(dev); - put_device(dev); - }; + driver_for_each_device(&cdriver->driver, NULL, NULL, + __ccwgroup_driver_unregister_device); put_driver(&cdriver->driver); driver_unregister(&cdriver->driver); } @@ -449,7 +437,7 @@ __ccwgroup_get_gdev_by_cdev(struct ccw_device *cdev) if (cdev->dev.driver_data) { gdev = (struct ccwgroup_device *)cdev->dev.driver_data; if (get_device(&gdev->dev)) { - if (!list_empty(&gdev->dev.node)) + if (klist_node_attached(&gdev->dev.knode_bus)) return gdev; put_device(&gdev->dev); } |