driver-core: fix build for !CONFIG_MODULES

Commit f2411da746 ("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 <fengguang.wu@intel.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Dmitry Torokhov 2015-05-21 15:49:37 -07:00 коммит произвёл Greg Kroah-Hartman
Родитель 802a87fd5b
Коммит 80c6e14659
2 изменённых файлов: 12 добавлений и 1 удалений

Просмотреть файл

@ -427,7 +427,7 @@ bool driver_allows_async_probing(struct device_driver *drv)
return false; return false;
default: default:
if (drv->owner && drv->owner->async_probe_requested) if (module_requested_async_probing(drv->owner))
return true; return true;
return false; return false;

Просмотреть файл

@ -510,6 +510,11 @@ int unregister_module_notifier(struct notifier_block *nb);
extern void print_modules(void); extern void print_modules(void);
static inline bool module_requested_async_probing(struct module *module)
{
return module && module->async_probe_requested;
}
#else /* !CONFIG_MODULES... */ #else /* !CONFIG_MODULES... */
/* Given an address, look for it in the exception tables. */ /* Given an address, look for it in the exception tables. */
@ -620,6 +625,12 @@ static inline int unregister_module_notifier(struct notifier_block *nb)
static inline void print_modules(void) static inline void print_modules(void)
{ {
} }
static inline bool module_requested_async_probing(struct module *module)
{
return false;
}
#endif /* CONFIG_MODULES */ #endif /* CONFIG_MODULES */
#ifdef CONFIG_SYSFS #ifdef CONFIG_SYSFS