Commit 309b7d60 authored by Joerg Roedel's avatar Joerg Roedel Committed by Greg Kroah-Hartman

driver core: add BUS_NOTIFY_UNBOUND_DRIVER event

This patch adds a new bus notifier event which is emitted _after_ a
device is removed from its driver. This event will be used by the
dma-api debug code to check if a driver has released all dma allocations
for that device.
Signed-off-by: default avatarJoerg Roedel <joerg.roedel@amd.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 6acf70f0
...@@ -320,6 +320,10 @@ static void __device_release_driver(struct device *dev) ...@@ -320,6 +320,10 @@ static void __device_release_driver(struct device *dev)
devres_release_all(dev); devres_release_all(dev);
dev->driver = NULL; dev->driver = NULL;
klist_remove(&dev->p->knode_driver); klist_remove(&dev->p->knode_driver);
if (dev->bus)
blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
BUS_NOTIFY_UNBOUND_DRIVER,
dev);
} }
} }
......
...@@ -114,6 +114,8 @@ extern int bus_unregister_notifier(struct bus_type *bus, ...@@ -114,6 +114,8 @@ extern int bus_unregister_notifier(struct bus_type *bus,
#define BUS_NOTIFY_BOUND_DRIVER 0x00000003 /* driver bound to device */ #define BUS_NOTIFY_BOUND_DRIVER 0x00000003 /* driver bound to device */
#define BUS_NOTIFY_UNBIND_DRIVER 0x00000004 /* driver about to be #define BUS_NOTIFY_UNBIND_DRIVER 0x00000004 /* driver about to be
unbound */ unbound */
#define BUS_NOTIFY_UNBOUND_DRIVER 0x00000005 /* driver is unbound
from the device */
extern struct kset *bus_get_kset(struct bus_type *bus); extern struct kset *bus_get_kset(struct bus_type *bus);
extern struct klist *bus_get_device_klist(struct bus_type *bus); extern struct klist *bus_get_device_klist(struct bus_type *bus);
......
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