summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/emc6w201.c
Commit message (Collapse)AuthorAgeFilesLines
* hwmon: (emcw201) Fix overflows seen when writing into limit attributesGuenter Roeck2016-12-121-3/+5
| | | | | | | | | Writes into temperature and voltage limit attributes can overflow due to multiplications with unchecked parameters. Also, the input parameter to DIV_ROUND_CLOSEST() needis to be range checked. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (emc6w201): trivial fix of spelling mistake "Unknwown" -> "Unknown"Colin Ian King2016-06-281-1/+1
| | | | | | | trivial fix to spelling mistake in dev_dbg message Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (emc6w201) Fix temperature limit rangeGuenter Roeck2014-08-061-2/+2
| | | | | | | | | | | | Temperature limit range is [-127, 127], not [-127, 128]. The wrong range caused a bad limit to be written into the chip if the limit was set to a value of 128 degrees C or above. Also use DIV_ROUND_CLOSEST instead of a plain divide operation to reduce the rounding error when writing temperature limits. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Jean Delvare <jdelvare@suse.de>
* hwmon: (emc6w201) Convert to devm_hwmon_device_register_with_groupsAxel Lin2014-08-041-45/+19Star
| | | | | | | | Use ATTRIBUTE_GROUPS macro and devm_hwmon_device_register_with_groups() to simplify the code a bit. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* Update Jean Delvare's e-mail addressJean Delvare2014-01-291-2/+2
| | | | Signed-off-by: Jean Delvare <khali@linux-fr.org>
* hwmon: (emc6w201) Do not declare enum variableGuenter Roeck2013-09-061-1/+1
| | | | | | | | | | | | Fix the following smatch warning: emc6w201.c:52:26: warning: symbol 'subfeature' was not declared. Should it be static? 'enum { } subtype' declares an enum as (global) variable which we don't want. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* hwmon: Replace SENSORS_LIMIT with clamp_valGuenter Roeck2013-01-261-3/+3
| | | | | | | | | | | | SENSORS_LIMIT and the generic clamp_val have the same functionality, and clamp_val is more efficient. This patch reduces text size by 9052 bytes and bss size by 11624 bytes for x86_64 builds. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: George Joseph <george.joseph@fairview5.com> Acked-by: Jean Delvare <khali@linux-fr.org>
* hwmon: (emc6w201) Fix DIV_ROUND_CLOSEST problem with unsigned divisorsGuenter Roeck2012-12-221-1/+1
| | | | | | | | Result of DIV_ROUND_CLOSEST is undefined for negative dividends if the divisor variable type is unsigned. Fix by declaring divisor as signed variable. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Jean Delvare <khali@linux-fr.org>
* hwmon: Drop needless includes of <linux/delay.h>Jean Delvare2012-10-101-1/+0Star
| | | | | | | | | These drivers use no sleep or delay functions so they don't need to include <linux/delay.h>. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <linux@roeck-us.net> Cc: Rudolf Marek <r.marek@assembler.cz>
* hwmon: (emc6w201) Convert to use devm_ functionsGuenter Roeck2012-07-221-10/+5Star
| | | | | | | Convert to use devm_ functions to reduce code size and simplify the code. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Jean Delvare <khali@linux-fr.org>
* hwmon: convert drivers/hwmon/* to use module_i2c_driver()Axel Lin2012-03-191-11/+1Star
| | | | | | | | | | | | | | | | | | This patch converts the drivers in drivers/hwmon/* to use the module_i2c_driver() macro which makes the code smaller and a bit simpler. Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Corentin Labbe <corentin.labbe@geomatys.fr> Cc: Dirk Eibach <eibach@gdsys.de> Cc: "Mark M. Hoffman" <mhoffman@lightlink.com> Cc: Steve Glendinning <steve.glendinning@smsc.com> Cc: Riku Voipio <riku.voipio@iki.fi> Cc: Guillaume Ligneul <guillaume.ligneul@gmail.com> Cc: David George <david.george@ska.ac.za> Cc: "Hans J. Koch" <hjk@hansjkoch.de> Cc: Marc Hulsman <m.hulsman@tudelft.nl> Cc: Rudolf Marek <r.marek@assembler.cz> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* hwmon: replaced strict_str* with kstr*Frans Meulenbroeks2012-01-051-3/+3
| | | | | | | | | | | replaced strict_strtol with kstrtol and replaced strict_strtuol with kstrtuol This satisfies checkpatch -f Compile tested only: no warnings or errors given Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* hwmon: (emc6w201) Properly handle all errorsJean Delvare2011-07-031-14/+44
| | | | | | | | Handle errors on 8-bit register reads and writes too. Also use likely and unlikely to make the functions faster on success. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
* hwmon: New driver for the SMSC EMC6W201Jean Delvare2011-05-251-0/+539
This is a new driver for the SMSC EMC6W201 hardware monitoring device. The device is functionally close to the EMC6D100 series, but is register-incompatible. Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Harry G McGavran Jr <w5pny@arrl.net> Tested-by: Jeff Rickman <jrickman@myamigos.us> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>