Skip to contentSkip to conversation

hwmon: lm92: Add devicetree support

PATCH In review Denis Carikli 1 participant 2 messages Jul 23, 2015 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 hwmon: lm92: Add devicetree support

---
 drivers/hwmon/lm92.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/hwmon/lm92.c +9 -0
index cfaf70b..a1e10cd 100644
@@ -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,
Signature · 1 line
2.4.5

A message that is not in the archive (sent off-list or not yet received): 1437643748-11677-1-git-send-email-denis-fO0SIAKYzcbQT0dZR+AlfA@public.gmane.org

#2 lore raw

On 07/23/2015 11:29 AM, Denis Carikli wrote:
Sorry, I sent the wrong patch, ignore this mail.

Denis.