diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2012-05-15 11:52:07 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2012-05-16 08:42:46 -0400 |
commit | b7a610f7b4cb95150ee58ea7454ca2ace10634c5 (patch) | |
tree | bf8ea737924dc421042740e0243edac8b52313c7 /drivers/s390/cio/device.c | |
parent | f2962dae0efd81fed06d0687f300725ab063587a (diff) |
s390/ccwgroup: exploit ccwdev_by_dev_id
Instead of finding devices via driver_find_device use the bus_find_device
wrapper get_ccwdev_by_dev_id. This allows us to get rid of the ccw_driver
argument of ccwgroup_create_dev and thus simplify the interface.
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/device.c')
-rw-r--r-- | drivers/s390/cio/device.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 02d015259461..f8f952d52045 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c | |||
@@ -695,7 +695,17 @@ static int match_dev_id(struct device *dev, void *data) | |||
695 | return ccw_dev_id_is_equal(&cdev->private->dev_id, dev_id); | 695 | return ccw_dev_id_is_equal(&cdev->private->dev_id, dev_id); |
696 | } | 696 | } |
697 | 697 | ||
698 | static struct ccw_device *get_ccwdev_by_dev_id(struct ccw_dev_id *dev_id) | 698 | /** |
699 | * get_ccwdev_by_dev_id() - obtain device from a ccw device id | ||
700 | * @dev_id: id of the device to be searched | ||
701 | * | ||
702 | * This function searches all devices attached to the ccw bus for a device | ||
703 | * matching @dev_id. | ||
704 | * Returns: | ||
705 | * If a device is found its reference count is increased and returned; | ||
706 | * else %NULL is returned. | ||
707 | */ | ||
708 | struct ccw_device *get_ccwdev_by_dev_id(struct ccw_dev_id *dev_id) | ||
699 | { | 709 | { |
700 | struct device *dev; | 710 | struct device *dev; |
701 | 711 | ||
@@ -703,6 +713,7 @@ static struct ccw_device *get_ccwdev_by_dev_id(struct ccw_dev_id *dev_id) | |||
703 | 713 | ||
704 | return dev ? to_ccwdev(dev) : NULL; | 714 | return dev ? to_ccwdev(dev) : NULL; |
705 | } | 715 | } |
716 | EXPORT_SYMBOL_GPL(get_ccwdev_by_dev_id); | ||
706 | 717 | ||
707 | static void ccw_device_do_unbind_bind(struct ccw_device *cdev) | 718 | static void ccw_device_do_unbind_bind(struct ccw_device *cdev) |
708 | { | 719 | { |