Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1262103

Re: [PATCH] dmaengine: edma: fix build without CONFIG_OF

From Peter Ujfalusi <peter.ujfalusi@ti.com>
Newsgroups linux.kernel
Subject Re: [PATCH] dmaengine: edma: fix build without CONFIG_OF
Date 2015-11-04 08:50 +0100
Message-ID <qr0Zr-5Wr-3@gated-at.bofh.it> (permalink)
References <qqKrF-3Jf-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 11/03/2015 04:00 PM, Arnd Bergmann wrote:
> During the edma rework, a build error was introduced for the
> case that CONFIG_OF is disabled:
> 
> drivers/built-in.o: In function `edma_tc_set_pm_state':
> :(.text+0x43bf0): undefined reference to `of_find_device_by_node'
> 
> As the edma_tc_set_pm_state() function does nothing in case
> we are running without OF, this adds an IS_ENABLED() check
> that turns the function into an empty stub then and avoids the
> link error.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: ca304fa9bb76 ("ARM/dmaengine: edma: Public API to use private struct pointer")

The actual commit this patch is fixing is:
1be5336bc7ba dmaengine: edma: New device tree binding

> ---
> Found on ARM randconfig builds with today's linux-next

I have sanity built the kernel with omap2plus_defconfig and
davinci_all_defconfig since eDMA is used by these platforms and did not faced
with this issue, as obviously these defconfigs will result OF to be enabled.

> diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
> index 31722d436a42..16713a93da10 100644
> --- a/drivers/dma/edma.c
> +++ b/drivers/dma/edma.c
> @@ -1560,7 +1560,7 @@ static void edma_tc_set_pm_state(struct edma_tc *tc, bool enable)
>  	struct platform_device *tc_pdev;
>  	int ret;
>  
> -	if (!tc)
> +	if (!IS_ENABLED(CONFIG_OF) || !tc)
>  		return;

Should we instead put the function inside of:
#if IS_ENABLED(CONFIG_OF)
static void edma_tc_set_pm_state(struct edma_tc *tc, bool enable)
{
...
}
#else
static inline void edma_tc_set_pm_state(struct edma_tc *tc, bool enable)
{
}
#endif /* IS_ENABLED(CONFIG_OF) */


>  
>  	tc_pdev = of_find_device_by_node(tc->node);
> 

-- 
Péter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] dmaengine: edma: fix build without CONFIG_OF Arnd Bergmann <arnd@arndb.de> - 2015-11-03 15:10 +0100
  Re: [PATCH] dmaengine: edma: fix build without CONFIG_OF Peter Ujfalusi <peter.ujfalusi@ti.com> - 2015-11-04 08:50 +0100
    Re: [PATCH] dmaengine: edma: fix build without CONFIG_OF Arnd Bergmann <arnd@arndb.de> - 2015-11-04 09:50 +0100
      Re: [PATCH] dmaengine: edma: fix build without CONFIG_OF Peter Ujfalusi <peter.ujfalusi@ti.com> - 2015-11-04 10:10 +0100
        Re: [PATCH] dmaengine: edma: fix build without CONFIG_OF Arnd Bergmann <arnd@arndb.de> - 2015-11-04 11:30 +0100
  Re: [PATCH] dmaengine: edma: fix build without CONFIG_OF Vinod Koul <vinod.koul@intel.com> - 2015-11-16 04:40 +0100

csiph-web