Skip to content

Commit

Permalink
Add device_release_driver() wrapper
Browse files Browse the repository at this point in the history
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Jan 1, 2021
1 parent aadee28 commit 23b0dfd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/linux/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 9 additions & 0 deletions snd-wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 23b0dfd

Please sign in to comment.