From: Axel Lin <axel.lin@ingics.com>
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] [PATCH 2/2] hwmon: (pwm-fan) Add proper #ifdef CONFIG_OF guard for of_device_id table
Date: Fri, 25 Jul 2014 03:14:33 +0000 [thread overview]
Message-ID: <1406258073.9778.3.camel@phoenix> (raw)
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@ingics.com>
---
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@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next reply other threads:[~2014-07-25 3:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-25 3:14 Axel Lin [this message]
2014-07-25 4:29 ` [lm-sensors] [PATCH 2/2] hwmon: (pwm-fan) Add proper #ifdef CONFIG_OF guard for of_device_id tab Guenter Roeck
2014-07-25 4:46 ` Axel Lin
2014-07-25 4:56 ` Guenter Roeck
2014-07-25 7:50 ` Jean Delvare
2014-07-25 14:05 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1406258073.9778.3.camel@phoenix \
--to=axel.lin@ingics.com \
--cc=lm-sensors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.