hwmon: Only include of_match_table with CONFIG_OF_GPIO
PATCH 1/1 hwmon: Only include of_match_table with CONFIG_OF_GPIO
The following fixes build errors on sparc. Without any DT support, of_match_ptr is NULL and the below is a no-op. However, if just CONFIG_OF is defined then so is of_match_ptr.
All useful parts of the gpio-fan DT support rely on CONFIG_OF_GPIO anyway, so of_match_table should too.
--- drivers/hwmon/gpio-fan.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/hwmon/gpio-fan.c +2 -0
@@ -630,7 +630,9 @@ static struct platform_driver gpio_fan_driver = { .driver = { .name = "gpio-fan", .pm = GPIO_FAN_PM, +#ifdef CONFIG_OF_GPIO .of_match_table = of_match_ptr(of_gpio_fan_match), +#endif }, };
Signature · 1 line
1.7.10.4
PATCH 1/1 hwmon: Only include of_match_table with CONFIG_OF_GPIO
Quoted 17 lines · Jamie Lentin
The following fixes build errors on sparc. Without any DT support,
of_match_ptris NULL and the below is a no-op. However, if justCONFIG_OFis defined then so isof_match_ptr.All useful parts of the gpio-fan DT support rely on
CONFIG_OF_GPIOanyway, soof_match_tableshould too.Signed-off-by Jamie Lentin <[email protected]>--- drivers/hwmon/gpio-fan.c | 2 ++ 1 file changed, 2 insertions(+)drivers/hwmon/gpio-fan.c +0
-0
drivers/hwmon/gpio-fan.c static struct platform_driver gpio_fan_driver = { · line 636
Quoted 7 lines
drivers/hwmon/gpio-fan.c +2
-0@@ -630,7 +630,9 @@ static struct platform_driver gpio_fan_driver = { .driver = { .name = "gpio-fan", .pm = GPIO_FAN_PM, +#ifdef CONFIG_OF_GPIO .of_match_table = of_match_ptr(of_gpio_fan_match), +#endif },
Applied.
Thanks,
Guenter