All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/2] dmaengine: dw: dmamux: Export the module device table
@ 2022-06-09 14:14 Miquel Raynal
  2022-06-09 14:14 ` [PATCH v3 2/2] dmaengine: dw: dmamux: Fix build without CONFIG_OF Miquel Raynal
  2022-06-09 15:58 ` [PATCH v3 1/2] dmaengine: dw: dmamux: Export the module device table Andy Shevchenko
  0 siblings, 2 replies; 4+ messages in thread
From: Miquel Raynal @ 2022-06-09 14:14 UTC (permalink / raw)
  To: Vinod Koul, dmaengine
  Cc: Milan Stevanovic, Jimmy Lalande, Pascal Eberhard,
	Thomas Petazzoni, Herve Codina, Clement Leger, Andy Shevchenko,
	ilpo.jarvinen, Miquel Raynal

This is a tristate driver that can be built as a module, as a result,
the OF match table should be exported with MODULE_DEVICE_TABLE().

Fixes: 134d9c52fca2 ("dmaengine: dw: dmamux: Introduce RZN1 DMA router support")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---

Changes in v3:
* Added a Fixes tag.

Changes in v2:
* New patch.

 drivers/dma/dw/rzn1-dmamux.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/dma/dw/rzn1-dmamux.c b/drivers/dma/dw/rzn1-dmamux.c
index 11d254e450b0..0ce4fb58185e 100644
--- a/drivers/dma/dw/rzn1-dmamux.c
+++ b/drivers/dma/dw/rzn1-dmamux.c
@@ -140,6 +140,7 @@ static const struct of_device_id rzn1_dmamux_match[] = {
 	{ .compatible = "renesas,rzn1-dmamux" },
 	{}
 };
+MODULE_DEVICE_TABLE(of, rzn1_dmamux_match);
 
 static struct platform_driver rzn1_dmamux_driver = {
 	.driver = {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v3 2/2] dmaengine: dw: dmamux: Fix build without CONFIG_OF
  2022-06-09 14:14 [PATCH v3 1/2] dmaengine: dw: dmamux: Export the module device table Miquel Raynal
@ 2022-06-09 14:14 ` Miquel Raynal
  2022-06-09 15:59   ` Andy Shevchenko
  2022-06-09 15:58 ` [PATCH v3 1/2] dmaengine: dw: dmamux: Export the module device table Andy Shevchenko
  1 sibling, 1 reply; 4+ messages in thread
From: Miquel Raynal @ 2022-06-09 14:14 UTC (permalink / raw)
  To: Vinod Koul, dmaengine
  Cc: Milan Stevanovic, Jimmy Lalande, Pascal Eberhard,
	Thomas Petazzoni, Herve Codina, Clement Leger, Andy Shevchenko,
	ilpo.jarvinen, Miquel Raynal, kernel test robot

When built without OF support, of_match_node() expands to NULL, which
produces the following output:
>> drivers/dma/dw/rzn1-dmamux.c:105:34: warning: unused variable 'rzn1_dmac_match' [-Wunused-const-variable]
   static const struct of_device_id rzn1_dmac_match[] = {

One way to silence the warning is to enclose the structure definition
with an #ifdef CONFIG_OF/#endif block.

Fixes: 134d9c52fca2 ("dmaengine: dw: dmamux: Introduce RZN1 DMA router support")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---

Changes in v3:
* Did not extend the change to the second match table as requested by Andy.
* Added a Fixes tag.

Changes in v2:
* Used the #ifdef solution rather than the __maybe_unused keyword.

 drivers/dma/dw/rzn1-dmamux.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/dma/dw/rzn1-dmamux.c b/drivers/dma/dw/rzn1-dmamux.c
index 0ce4fb58185e..f9912c3dd4d7 100644
--- a/drivers/dma/dw/rzn1-dmamux.c
+++ b/drivers/dma/dw/rzn1-dmamux.c
@@ -102,10 +102,12 @@ static void *rzn1_dmamux_route_allocate(struct of_phandle_args *dma_spec,
 	return ERR_PTR(ret);
 }
 
+#ifdef CONFIG_OF
 static const struct of_device_id rzn1_dmac_match[] = {
 	{ .compatible = "renesas,rzn1-dma" },
 	{}
 };
+#endif
 
 static int rzn1_dmamux_probe(struct platform_device *pdev)
 {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v3 1/2] dmaengine: dw: dmamux: Export the module device table
  2022-06-09 14:14 [PATCH v3 1/2] dmaengine: dw: dmamux: Export the module device table Miquel Raynal
  2022-06-09 14:14 ` [PATCH v3 2/2] dmaengine: dw: dmamux: Fix build without CONFIG_OF Miquel Raynal
@ 2022-06-09 15:58 ` Andy Shevchenko
  1 sibling, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2022-06-09 15:58 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Vinod Koul, dmaengine, Milan Stevanovic, Jimmy Lalande,
	Pascal Eberhard, Thomas Petazzoni, Herve Codina, Clement Leger,
	ilpo.jarvinen

On Thu, Jun 09, 2022 at 04:14:54PM +0200, Miquel Raynal wrote:
> This is a tristate driver that can be built as a module, as a result,
> the OF match table should be exported with MODULE_DEVICE_TABLE().

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Fixes: 134d9c52fca2 ("dmaengine: dw: dmamux: Introduce RZN1 DMA router support")
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
> 
> Changes in v3:
> * Added a Fixes tag.
> 
> Changes in v2:
> * New patch.
> 
>  drivers/dma/dw/rzn1-dmamux.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/dma/dw/rzn1-dmamux.c b/drivers/dma/dw/rzn1-dmamux.c
> index 11d254e450b0..0ce4fb58185e 100644
> --- a/drivers/dma/dw/rzn1-dmamux.c
> +++ b/drivers/dma/dw/rzn1-dmamux.c
> @@ -140,6 +140,7 @@ static const struct of_device_id rzn1_dmamux_match[] = {
>  	{ .compatible = "renesas,rzn1-dmamux" },
>  	{}
>  };
> +MODULE_DEVICE_TABLE(of, rzn1_dmamux_match);
>  
>  static struct platform_driver rzn1_dmamux_driver = {
>  	.driver = {
> -- 
> 2.34.1
> 

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3 2/2] dmaengine: dw: dmamux: Fix build without CONFIG_OF
  2022-06-09 14:14 ` [PATCH v3 2/2] dmaengine: dw: dmamux: Fix build without CONFIG_OF Miquel Raynal
@ 2022-06-09 15:59   ` Andy Shevchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2022-06-09 15:59 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Vinod Koul, dmaengine, Milan Stevanovic, Jimmy Lalande,
	Pascal Eberhard, Thomas Petazzoni, Herve Codina, Clement Leger,
	ilpo.jarvinen, kernel test robot

On Thu, Jun 09, 2022 at 04:14:55PM +0200, Miquel Raynal wrote:
> When built without OF support, of_match_node() expands to NULL, which
> produces the following output:
> >> drivers/dma/dw/rzn1-dmamux.c:105:34: warning: unused variable 'rzn1_dmac_match' [-Wunused-const-variable]
>    static const struct of_device_id rzn1_dmac_match[] = {
> 
> One way to silence the warning is to enclose the structure definition
> with an #ifdef CONFIG_OF/#endif block.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Fixes: 134d9c52fca2 ("dmaengine: dw: dmamux: Introduce RZN1 DMA router support")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
> 
> Changes in v3:
> * Did not extend the change to the second match table as requested by Andy.
> * Added a Fixes tag.
> 
> Changes in v2:
> * Used the #ifdef solution rather than the __maybe_unused keyword.
> 
>  drivers/dma/dw/rzn1-dmamux.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/dma/dw/rzn1-dmamux.c b/drivers/dma/dw/rzn1-dmamux.c
> index 0ce4fb58185e..f9912c3dd4d7 100644
> --- a/drivers/dma/dw/rzn1-dmamux.c
> +++ b/drivers/dma/dw/rzn1-dmamux.c
> @@ -102,10 +102,12 @@ static void *rzn1_dmamux_route_allocate(struct of_phandle_args *dma_spec,
>  	return ERR_PTR(ret);
>  }
>  
> +#ifdef CONFIG_OF
>  static const struct of_device_id rzn1_dmac_match[] = {
>  	{ .compatible = "renesas,rzn1-dma" },
>  	{}
>  };
> +#endif
>  
>  static int rzn1_dmamux_probe(struct platform_device *pdev)
>  {
> -- 
> 2.34.1
> 

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-09 15:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-09 14:14 [PATCH v3 1/2] dmaengine: dw: dmamux: Export the module device table Miquel Raynal
2022-06-09 14:14 ` [PATCH v3 2/2] dmaengine: dw: dmamux: Fix build without CONFIG_OF Miquel Raynal
2022-06-09 15:59   ` Andy Shevchenko
2022-06-09 15:58 ` [PATCH v3 1/2] dmaengine: dw: dmamux: Export the module device table Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.