diff --git a/include/linux/device.h b/include/linux/device.h index 37e2210..386b792 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -78,6 +78,7 @@ struct device_driver { int driver_register(struct device_driver *drv); void driver_unregister(struct device_driver *drv); int device_attach(struct device *dev); +int device_release_driver(struct device *dev); struct bus_type { const char *name; diff --git a/snd-wrapper.c b/snd-wrapper.c index a93ede2..9f78af6 100644 --- a/snd-wrapper.c +++ b/snd-wrapper.c @@ -838,6 +838,15 @@ int device_attach(struct device *dev) return 0; } +int device_release_driver(struct device *dev) +{ + if (dev->driver) { + dev->driver->remove(dev); + dev->driver = NULL; + } + return 0; +} + /* */ static void check_resume(struct device *dev)