Skip to contentSkip to conversation

hwmon: (max6650) Dissociate the i2c device name from the hwmon device name

PATCH Superseded Laszlo Papp 1 participant 1 message Feb 11, 2014

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: (max6650) Dissociate the i2c device name from the hwmon device name

This is a necessary step to revamp the existing design of the driver for the overall functionality the chip can provide. This will create a clean name-space for each function.

---
 drivers/hwmon/max6650.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/hwmon/max6650.c +8 -2
index 0cafc39..d4b1450 100644
@@ -518,6 +518,7 @@ static struct attribute *max6650_attrs[] = {
 	&sensor_dev_attr_gpio2_alarm.dev_attr.attr,
 	NULL
 };
+ATTRIBUTE_GROUPS(max6650);
 
 static struct attribute_group max6650_attr_grp = {
 	.attrs = max6650_attrs,
@@ -543,6 +544,7 @@ static int max6650_probe(struct i2c_client *client,
 			 const struct i2c_device_id *id)
 {
 	struct max6650_data *data;
+	struct device *hwmon_dev;
 	int err;
 
 	data = devm_kzalloc(&client->dev, sizeof(struct max6650_data),
@@ -574,8 +576,12 @@ static int max6650_probe(struct i2c_client *client,
 	}
 
 	data->hwmon_dev = hwmon_device_register(&client->dev);
-	if (!IS_ERR(data->hwmon_dev))
-		return 0;
+	if (!IS_ERR(data->hwmon_dev)) {
+		hwmon_dev = devm_hwmon_device_register_with_groups(&client->dev,
+							client->name, data,
+							max6650_groups);
+		return PTR_ERR_OR_ZERO(hwmon_dev);
+	}
 
 	err = PTR_ERR(data->hwmon_dev);
 	dev_err(&client->dev, "error registering hwmon device.\n");
Signature · 7 lines
1.8.5.4


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors