Skip to content

Commit 6191023

Browse files
parakabebarino
authored andcommitted
clk: ralink: mtmips: quiet unused variable warning
When CONFIG_OF is disabled then the matching table is not referenced and the following warning appears: drivers/clk/ralink/clk-mtmips.c:821:34: warning: unused variable 'mtmips_of_match' [-Wunused-const-variable] 821 | static const struct of_device_id mtmips_of_match[] = { | ^ There are two match tables in the driver: one for the clock driver and the other for the reset driver. The only difference between them is that the clock driver uses 'data' and does not have 'ralink,rt2880-reset' compatible. Both just can be merged into a single one just by adding the compatible 'ralink,rt2880-reset' entry to 'mtmips_of_match[]', which will allow it to be used for 'mtmips_clk_driver' (which doesn't use the data) as well as for 'mtmips_clk_init()' (which doesn't need get called for 'ralink,rt2880-reset'). Doing in this way ensures that 'CONFIG_OF' is not disabled anymore so the above warning disapears. Fixes: 6f3b155 ("clk: ralink: add clock and reset driver for MTMIPS SoCs") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202307242310.CdOnd2py-lkp@intel.com/ Suggested-by: Arnd Bergmann <arnd@kernel.org> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Link: https://lore.kernel.org/r/20230827023932.501102-1-sergio.paracuellos@gmail.com Reviewed-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 14aaccb commit 6191023

1 file changed

Lines changed: 5 additions & 15 deletions

File tree

drivers/clk/ralink/clk-mtmips.c

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,10 @@ static const struct mtmips_clk_data mt76x8_clk_data = {
821821
};
822822

823823
static const struct of_device_id mtmips_of_match[] = {
824+
{
825+
.compatible = "ralink,rt2880-reset",
826+
.data = NULL,
827+
},
824828
{
825829
.compatible = "ralink,rt2880-sysc",
826830
.data = &rt2880_clk_data,
@@ -1088,25 +1092,11 @@ static int mtmips_clk_probe(struct platform_device *pdev)
10881092
return 0;
10891093
}
10901094

1091-
static const struct of_device_id mtmips_clk_of_match[] = {
1092-
{ .compatible = "ralink,rt2880-reset" },
1093-
{ .compatible = "ralink,rt2880-sysc" },
1094-
{ .compatible = "ralink,rt3050-sysc" },
1095-
{ .compatible = "ralink,rt3052-sysc" },
1096-
{ .compatible = "ralink,rt3352-sysc" },
1097-
{ .compatible = "ralink,rt3883-sysc" },
1098-
{ .compatible = "ralink,rt5350-sysc" },
1099-
{ .compatible = "ralink,mt7620-sysc" },
1100-
{ .compatible = "ralink,mt7628-sysc" },
1101-
{ .compatible = "ralink,mt7688-sysc" },
1102-
{}
1103-
};
1104-
11051095
static struct platform_driver mtmips_clk_driver = {
11061096
.probe = mtmips_clk_probe,
11071097
.driver = {
11081098
.name = "mtmips-clk",
1109-
.of_match_table = mtmips_clk_of_match,
1099+
.of_match_table = mtmips_of_match,
11101100
},
11111101
};
11121102

0 commit comments

Comments
 (0)