Skip to content

Commit

Permalink
hwmon: Only include of_match_table with CONFIG_OF_GPIO
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Jamie Lentin <jm@lentin.co.uk>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
  • Loading branch information
Jamie Lentin authored and Guenter Roeck committed Nov 2, 2012
1 parent d034fbf commit eaa7cc6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/hwmon/gpio-fan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
};

Expand Down

0 comments on commit eaa7cc6

Please sign in to comment.