On Tue, Jun 07, 2022 at 05:22:15PM +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. > > In order to keep the harmony in the driver, the second match table is > also enclosed with the same #ifdef CONFIG_OF/#endif block and the use of > the match table forwarded by the of_match_ptr() macro. No, what I asked is the opposite. So, the most of this patch seems not needed (see below). ... > +#ifdef CONFIG_OF > static const struct of_device_id rzn1_dmamux_match[] = { > { .compatible = "renesas,rzn1-dmamux" }, > {} > }; > MODULE_DEVICE_TABLE(of, rzn1_dmamux_match); > +#endif > > static struct platform_driver rzn1_dmamux_driver = { > .driver = { > .name = "renesas,rzn1-dmamux", > - .of_match_table = rzn1_dmamux_match, > + .of_match_table = of_match_ptr(rzn1_dmamux_match), > }, > .probe = rzn1_dmamux_probe, > }; -- With Best Regards, Andy Shevchenko