Skip to contentSkip to conversation

hwmon: new max1668 driver

PATCH Applied David George 2 participants 2 messages Jun 2, 2011

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

PATCH 1/1 hwmon: new max1668 driver

Hi Guenter.

Hopefully this is more to your liking. I have made the changes you recommended, except adding max1668_sysfs_cleanup(). I didn't 100% follow how it would help.

Thanks again for your time and vigilant eye.

Regards,
David

This patch adds support for MAX1668 and compatible temperature sensors.

drivers/hwmon/Makefile +1 -0
@@ -85,6 +85,7 @@ obj-$(CONFIG_SENSORS_LTC4245)	+= ltc4245
 obj-$(CONFIG_SENSORS_LTC4261)	+= ltc4261.o
 obj-$(CONFIG_SENSORS_MAX1111)	+= max1111.o
 obj-$(CONFIG_SENSORS_MAX1619)	+= max1619.o
+obj-$(CONFIG_SENSORS_MAX1668)	+= max1668.o
 obj-$(CONFIG_SENSORS_MAX6639)	+= max6639.o
 obj-$(CONFIG_SENSORS_MAX6650)	+= max6650.o
 obj-$(CONFIG_SENSORS_MC13783_ADC)+= mc13783-adc.o
drivers/hwmon/Kconfig +10 -0
@@ -729,6 +729,16 @@ config SENSORS_MAX1619
 	  This driver can also be built as a module.  If so, the module
 	  will be called max1619.
 
+config SENSORS_MAX1668
+	tristate "Maxim MAX1668 and compatibles"
+	depends on I2C && EXPERIMENTAL
+	help
+	  If you say yes here you get support for MAX1668, MAX1989 and
+	  MAX1805 chips.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called max1668.
+
 config SENSORS_MAX6639
 	tristate "Maxim MAX6639 sensor chip"
 	depends on I2C && EXPERIMENTAL
MAINTAINERS +7 -0
@@ -4090,6 +4090,13 @@ S:	Orphan
 F:	drivers/video/matrox/matroxfb_*
 F:	include/linux/matroxfb.h
 
+MAX1668 TEMPERATURE SENSOR DRIVER
+M:	"David George" <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	Documentation/hwmon/max1668
+F:	drivers/hwmon/max1668.c
+
 MAX6650 HARDWARE MONITOR AND FAN CONTROLLER DRIVER
 M:	"Hans J. Koch" <[email protected]>
 L:	[email protected]
drivers/hwmon/max1668.c +482 -0

482 lines not on this page · raw message

Documentation/hwmon/max1668 +60 -0

60 lines not on this page · raw message

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

#1 lore raw
Quoted 5 lines · David George

Hi Guenter.

Hopefully this is more to your liking. I have made the changes you recommended, except adding max1668_sysfs_cleanup(). I didn't 100% follow how it would help.

Hi David,

I should have phrased it differently.

[ ... ]

drivers/hwmon/max1668.c line 413

Quoted 4 lines
drivers/hwmon/max1668.c +4 -0
+
+       data->hwmon_dev = hwmon_device_register(&client->dev);
+       if (IS_ERR(data->hwmon_dev)) {
+               err = PTR_ERR(data->hwmon_dev);
		goto error_sysrem1;

drivers/hwmon/max1668.c line 417

Quoted 4 lines
drivers/hwmon/max1668.c +4 -0
+               if (data->type = max1668 || data->type = max1989)
+                       goto error_sysrem1;
+               else
+                       goto error_sysrem0;

Delete those four lines

drivers/hwmon/max1668.c line 422

Quoted 5 lines
drivers/hwmon/max1668.c +5 -0
+       }
+
+       return 0;
+
+error_sysrem1:

Add here:

	if (data->type = max1668 || data->type = max1989)

In other words, leave error path complexity for the error path.

Besides that, your patch has an empty last line in Documentation/hwmon/max1668, which git complains about. Also, MODULE_PARM_DESC should be next to module_param(). Sorry, guess I wasn't entirely clear on that before.

No need to resubmit - I'll make those changes myself.

Applied, thanks.

Guenter

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