Patchwork MFD: Make VEXPRESS MFD controller depends on VEXPRESS systems

login
register
mail settings
Submitter Manjunath Goudar
Date Aug. 4, 2013, 8 a.m.
Message ID <1375603249-27206-1-git-send-email-manjunath.goudar@linaro.org>
Download mbox | patch
Permalink /patch/264465/
State New
Headers show

Comments

Manjunath Goudar - Aug. 4, 2013, 8 a.m.
This patch adds a Kconfig dependency on an ARCH_VEXPRESS(it is for
both ARM and ARM64) or ARCH_VEXPRESS_CA9X being available before
VEXPRESS_CONFIG can be enabled. Without this patch,build system
can lead to issues. This was discovered during randconfig testing,
in which VEXPRESS_CONFIG was enabled w/o ARCH_VEXPRESS or VEXPRESS_CONFIG
being enabled,leading to the following error:

CC      drivers/mfd/vexpress-config.o
drivers/mfd/vexpress-config.c: In function ‘__vexpress_config_func_get’:
drivers/mfd/vexpress-config.c:117:4: error: implicit declaration of function
‘of_find_node_by_phandle’ [-Werror=implicit-function-declaration]
    bridge_node = of_find_node_by_phandle(
    ^
drivers/mfd/vexpress-config.c:117:16: warning: assignment makes pointer from
integer without a cast [enabled by default]
    bridge_node = of_find_node_by_phandle(

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Deepak Saxena <dsaxena@linaro.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Lee Jones - Aug. 5, 2013, 7:59 a.m.
On Sun, 04 Aug 2013, Manjunath Goudar wrote:

> This patch adds a Kconfig dependency on an ARCH_VEXPRESS(it is for
> both ARM and ARM64) or ARCH_VEXPRESS_CA9X being available before
> VEXPRESS_CONFIG can be enabled. Without this patch,build system
> can lead to issues. This was discovered during randconfig testing,
> in which VEXPRESS_CONFIG was enabled w/o ARCH_VEXPRESS or VEXPRESS_CONFIG
> being enabled,leading to the following error:
> 
> CC      drivers/mfd/vexpress-config.o
> drivers/mfd/vexpress-config.c: In function ‘__vexpress_config_func_get’:
> drivers/mfd/vexpress-config.c:117:4: error: implicit declaration of function
> ‘of_find_node_by_phandle’ [-Werror=implicit-function-declaration]
>     bridge_node = of_find_node_by_phandle(
>     ^
> drivers/mfd/vexpress-config.c:117:16: warning: assignment makes pointer from
> integer without a cast [enabled by default]
>     bridge_node = of_find_node_by_phandle(
> 
> Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Deepak Saxena <dsaxena@linaro.org>
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> Cc: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/mfd/Kconfig |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 633ee43..c9202f6 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -1174,7 +1174,7 @@ endmenu
>  
>  config VEXPRESS_CONFIG
>  	bool "ARM Versatile Express platform infrastructure"
> -	depends on ARM || ARM64
> +	depends on ARCH_VEXPRESS || ARCH_VEXPRESS_CA9X4
>  	help
>  	  Platform configuration infrastructure for the ARM Ltd.
>  	  Versatile Express.

Looks fine to me, but I'd really like Arnd's Ack on this one.
Pawel Moll - Aug. 6, 2013, 10:36 a.m.
On Sun, 2013-08-04 at 09:00 +0100, Manjunath Goudar wrote:
> This patch adds a Kconfig dependency on an ARCH_VEXPRESS(it is for
> both ARM and ARM64) or ARCH_VEXPRESS_CA9X being available before
> VEXPRESS_CONFIG can be enabled. Without this patch,build system
> can lead to issues. This was discovered during randconfig testing,
> in which VEXPRESS_CONFIG was enabled w/o ARCH_VEXPRESS or VEXPRESS_CONFIG
> being enabled,leading to the following error:
> 
> CC      drivers/mfd/vexpress-config.o
> drivers/mfd/vexpress-config.c: In function ‘__vexpress_config_func_get’:
> drivers/mfd/vexpress-config.c:117:4: error: implicit declaration of function
> ‘of_find_node_by_phandle’ [-Werror=implicit-function-declaration]
>     bridge_node = of_find_node_by_phandle(
>     ^
> drivers/mfd/vexpress-config.c:117:16: warning: assignment makes pointer from
> integer without a cast [enabled by default]
>     bridge_node = of_find_node_by_phandle(

Thanks for reporting the problem...

> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 633ee43..c9202f6 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -1174,7 +1174,7 @@ endmenu
>  
>  config VEXPRESS_CONFIG
>  	bool "ARM Versatile Express platform infrastructure"
> -	depends on ARM || ARM64
> +	depends on ARCH_VEXPRESS || ARCH_VEXPRESS_CA9X4
>  	help
>  	  Platform configuration infrastructure for the ARM Ltd.
>  	  Versatile Express.

... but this is not the right way to fix it. In case of ARM64 there is
no (or maybe: there will be no) ARCH_VEXPRESS nor ARCH_ANYTHING if it
comes to it ;-)

What is really missing is a stub for of_find_node_by_phandle() in case
of CONFIG_OF != y. Care to send a patch adding it?

Thanks!

Pawel
Pawel Moll - Aug. 6, 2013, 11:24 a.m.
On Tue, 2013-08-06 at 12:18 +0100, Manjunath Goudar wrote:

> You are suggesting me to fix this issue using following code.
> 
> 
> #ifdef CONFIG_OF
>                         bridge_node = of_find_node_by_phandle(
>                                         be32_to_cpup(prop));
> #endif
>                 break;
>                 }
> #ifdef CONFIG_OF
>                 bridge_node = of_get_next_parent(bridge_node);
> #endif
> 
Em, this would be a possibility, but I think the right thing to do is to
add dummies to "include/linux/of.h". Search for "of_get_parent" and
"of_find_node_by_name" in this header - you will find declarations in
"#ifdef CONFIG_OF" block and dummy implementations (returning NULL) in
the equivalent #else part.

Paweł

Patch

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 633ee43..c9202f6 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -1174,7 +1174,7 @@  endmenu
 
 config VEXPRESS_CONFIG
 	bool "ARM Versatile Express platform infrastructure"
-	depends on ARM || ARM64
+	depends on ARCH_VEXPRESS || ARCH_VEXPRESS_CA9X4
 	help
 	  Platform configuration infrastructure for the ARM Ltd.
 	  Versatile Express.