[PATCH 1/1] board: Fixed compilation of board.c

Greg KH greg at kroah.com
Wed Mar 22 14:55:05 UTC 2017


On Wed, Mar 22, 2017 at 03:03:20PM +0100, Artur Lorincz wrote:
> Implementing the find_by_address(...) function differently based on
> the CONFIG_OF switch. The function  of_find_all_nodes() invoked in the
> function body is only available in case the CONFIG_OF switch is set.
> 
> For the other architectures the find_by_address(...) call returns false.
> 
> Signed-off-by: Artur Lorincz <larturus at yahoo.com>
> ---
>  drivers/staging/board/board.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/staging/board/board.c b/drivers/staging/board/board.c
> index 86dc411..d383857 100644
> --- a/drivers/staging/board/board.c
> +++ b/drivers/staging/board/board.c
> @@ -25,6 +25,7 @@
>  static struct device_node *irqc_node __initdata;
>  static unsigned int irqc_base __initdata;
> 
> +#ifdef CONFIG_OF
>  static bool find_by_address(u64 base_address)
>  {
>  	struct device_node *dn = of_find_all_nodes(NULL);
> @@ -42,6 +43,12 @@ static bool find_by_address(u64 base_address)
> 
>  	return false;
>  }
> +#else
> +static bool find_by_address(u64 base_address)
> +{
> +	return false;
> +}
> +#endif

Shouldn't the default of_* functions just return the correct "of is not
enabled" options here?  Why is the #ifdef needed?

thanks,

greg k-h


More information about the devel mailing list