[PATCH 2/2] hwmon: (pwm-fan) Add proper #ifdef CONFIG_OF guard for of_device_id table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use of_match_ptr and proper #ifdef CONFIG_OF guard for of_device_id table.
Also makes of_pwm_fan_match const.

Signed-off-by: Axel Lin <axel.lin@xxxxxxxxxx>
---
 drivers/hwmon/pwm-fan.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c
index d2507a6..5354c36 100644
--- a/drivers/hwmon/pwm-fan.c
+++ b/drivers/hwmon/pwm-fan.c
@@ -170,10 +170,12 @@ static int pwm_fan_resume(struct device *dev)
 
 static SIMPLE_DEV_PM_OPS(pwm_fan_pm, pwm_fan_suspend, pwm_fan_resume);
 
-static struct of_device_id of_pwm_fan_match[] = {
+#ifdef CONFIG_OF
+static const struct of_device_id of_pwm_fan_match[] = {
 	{ .compatible = "pwm-fan", },
 	{},
 };
+#endif
 
 static struct platform_driver pwm_fan_driver = {
 	.probe		= pwm_fan_probe,
@@ -181,7 +183,7 @@ static struct platform_driver pwm_fan_driver = {
 	.driver	= {
 		.name		= "pwm-fan",
 		.pm		= &pwm_fan_pm,
-		.of_match_table	= of_pwm_fan_match,
+		.of_match_table	= of_match_ptr(of_pwm_fan_match),
 	},
 };
 
-- 
1.9.1




_______________________________________________
lm-sensors mailing list
lm-sensors@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors




[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux