Skip to content

Commit

Permalink
driver-core: fix build for !CONFIG_MODULES
Browse files Browse the repository at this point in the history
Commit f2411da ("driver-core: add driver module asynchronous probe
support") broke build in case modules are disabled, because in this case
"struct module" is not defined and we can't dereference it. Let's define
module_requested_async_probing() helper and stub it out if modules are
disabled.

Reported-by: kbuild test robot <[email protected]>
Reported-by: Stephen Rothwell <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
dtor authored and gregkh committed May 24, 2015
1 parent 802a87f commit 80c6e14
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/base/dd.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ bool driver_allows_async_probing(struct device_driver *drv)
return false;

default:
if (drv->owner && drv->owner->async_probe_requested)
if (module_requested_async_probing(drv->owner))
return true;

return false;
Expand Down
11 changes: 11 additions & 0 deletions include/linux/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,11 @@ int unregister_module_notifier(struct notifier_block *nb);

extern void print_modules(void);

static inline bool module_requested_async_probing(struct module *module)
{
return module && module->async_probe_requested;
}

#else /* !CONFIG_MODULES... */

/* Given an address, look for it in the exception tables. */
Expand Down Expand Up @@ -620,6 +625,12 @@ static inline int unregister_module_notifier(struct notifier_block *nb)
static inline void print_modules(void)
{
}

static inline bool module_requested_async_probing(struct module *module)
{
return false;
}

#endif /* CONFIG_MODULES */

#ifdef CONFIG_SYSFS
Expand Down

0 comments on commit 80c6e14

Please sign in to comment.