mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-05 13:51:52 +00:00
device_schedule_callback() needs a module reference
This patch (as896b) fixes an oversight in the design of device_schedule_callback(). It is necessary to acquire a reference to the module owning the callback routine, to prevent the module from being unloaded before the callback can run. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: Satyam Sharma <satyam.sharma@gmail.com> Cc: Neil Brown <neilb@suse.de> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
fa1a8c23eb
commit
523ded71de
4 changed files with 29 additions and 13 deletions
|
@ -367,8 +367,12 @@ extern int __must_check device_create_bin_file(struct device *dev,
|
|||
struct bin_attribute *attr);
|
||||
extern void device_remove_bin_file(struct device *dev,
|
||||
struct bin_attribute *attr);
|
||||
extern int device_schedule_callback(struct device *dev,
|
||||
void (*func)(struct device *));
|
||||
extern int device_schedule_callback_owner(struct device *dev,
|
||||
void (*func)(struct device *), struct module *owner);
|
||||
|
||||
/* This is a macro to avoid include problems with THIS_MODULE */
|
||||
#define device_schedule_callback(dev, func) \
|
||||
device_schedule_callback_owner(dev, func, THIS_MODULE)
|
||||
|
||||
/* device resource management */
|
||||
typedef void (*dr_release_t)(struct device *dev, void *res);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue