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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> ---
>  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
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux