Commit 17c0b86e authored by Julian Wiedmann's avatar Julian Wiedmann Committed by Vasily Gorbik

s390/ccwgroup: use BUS_NOTIFY_UNBOUND_DRIVER to trigger ungrouping

ccwgroup_notifier() currently listens for BUS_NOTIFY_UNBIND_DRIVER
events, and triggers an ungrouping for the affected device.

Looking at __device_release_driver(), we can wait for a little longer
until the driver has been fully unbound and eg. bus->remove() has been
called. So listen for BUS_NOTIFY_UNBOUND_DRIVER instead. Due to locking
the current code should work just fine, but this clarifies our intent.
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Reviewed-by: default avatarVineeth Vijayan <vneethv@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 428b7f59
...@@ -11,8 +11,7 @@ struct ccw_driver; ...@@ -11,8 +11,7 @@ struct ccw_driver;
* @count: number of attached slave devices * @count: number of attached slave devices
* @dev: embedded device structure * @dev: embedded device structure
* @cdev: variable number of slave devices, allocated as needed * @cdev: variable number of slave devices, allocated as needed
* @ungroup_work: work to be done when a ccwgroup notifier has action * @ungroup_work: used to ungroup the ccwgroup device
* type %BUS_NOTIFY_UNBIND_DRIVER
*/ */
struct ccwgroup_device { struct ccwgroup_device {
enum { enum {
......
...@@ -401,7 +401,7 @@ static int ccwgroup_notifier(struct notifier_block *nb, unsigned long action, ...@@ -401,7 +401,7 @@ static int ccwgroup_notifier(struct notifier_block *nb, unsigned long action,
{ {
struct ccwgroup_device *gdev = to_ccwgroupdev(data); struct ccwgroup_device *gdev = to_ccwgroupdev(data);
if (action == BUS_NOTIFY_UNBIND_DRIVER) { if (action == BUS_NOTIFY_UNBOUND_DRIVER) {
get_device(&gdev->dev); get_device(&gdev->dev);
schedule_work(&gdev->ungroup_work); schedule_work(&gdev->ungroup_work);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment