diff mbox

[1/3] hwmon: lm92: Add devicetree support

Message ID 1437643748-11677-1-git-send-email-denis@eukrea.com
State Not Applicable
Headers show

Commit Message

Denis Carikli July 23, 2015, 9:29 a.m. UTC
Signed-off-by: Denis Carikli <denis@eukrea.com>
---
 drivers/hwmon/lm92.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Denis Carikli July 23, 2015, 9:41 a.m. UTC | #1
On 07/23/2015 11:29 AM, Denis Carikli wrote:
Sorry, I sent the wrong patch, ignore this mail.

Denis.
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/hwmon/lm92.c b/drivers/hwmon/lm92.c
index cfaf70b..a1e10cd 100644
--- a/drivers/hwmon/lm92.c
+++ b/drivers/hwmon/lm92.c
@@ -44,6 +44,7 @@ 
 #include <linux/hwmon-sysfs.h>
 #include <linux/err.h>
 #include <linux/mutex.h>
+#include <linux/of.h>
 #include <linux/jiffies.h>
 
 /*
@@ -386,6 +387,13 @@  static int lm92_probe(struct i2c_client *new_client,
  * Module and driver stuff
  */
 
+#ifdef CONFIG_OF
+static const struct of_device_id lm92_of_match[] = {
+	{ .compatible = "national,lm92", },
+};
+MODULE_DEVICE_TABLE(of, lm92_of_match);
+#endif
+
 static const struct i2c_device_id lm92_id[] = {
 	{ "lm92", 0 },
 	/* max6635 could be added here */
@@ -397,6 +405,7 @@  static struct i2c_driver lm92_driver = {
 	.class		= I2C_CLASS_HWMON,
 	.driver = {
 		.name	= "lm92",
+		.of_match_table = of_match_ptr(lm92_of_match),
 	},
 	.probe		= lm92_probe,
 	.id_table	= lm92_id,