From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756212AbbEUWtn (ORCPT ); Thu, 21 May 2015 18:49:43 -0400 Received: from mail-ie0-f177.google.com ([209.85.223.177]:35235 "EHLO mail-ie0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754216AbbEUWtm (ORCPT ); Thu, 21 May 2015 18:49:42 -0400 Date: Thu, 21 May 2015 15:49:37 -0700 From: Dmitry Torokhov To: Greg Kroah-Hartman Cc: Rusty Russell , "Luis R. Rodriguez" , Stephen Rothwell , kbuild test robot , linux-kernel@vger.kernel.org Subject: [PATCH] driver-core: fix build for !CONFIG_MODULES Message-ID: <20150521224937.GA35078@dtor-ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit f2411da74698 ("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 Reported-by: Stephen Rothwell Signed-off-by: Dmitry Torokhov --- drivers/base/dd.c | 2 +- include/linux/module.h | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 42e97d9..8da8e07 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -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; diff --git a/include/linux/module.h b/include/linux/module.h index 2e747e0..e6857d9 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -510,6 +511,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. */ @@ -620,6 +626,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 -- 2.2.0.rc0.207.ga3a616c -- Dmitry