aboutsummaryrefslogtreecommitdiff
path: root/drivers/hwmon/vt8231.c
AgeCommit message (Collapse)AuthorFilesLines
2020-08-04hwmon: (i5k_amb, vt8231) Drop uses of pci_read_config_*() return valueSaheed O. Bolarinwa1-4/+4
The return value of pci_read_config_*() may not indicate a device error. However, the value read by these functions is more likely to indicate this kind of error. This presents two overlapping ways of reporting errors and complicates error checking. It is possible to move to one single way of checking for error if the dependency on the return value of these functions is removed, then it can later be made to return void. Remove all uses of the return value of pci_read_config_*(). Check the actual value read for ~0. In this case, ~0 is an invalid value thus it indicates some kind of error. Suggested-by: Bjorn Helgaas <[email protected]> Signed-off-by: Saheed O. Bolarinwa <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2019-05-24treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61Thomas Gleixner1-14/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 675 mass ave cambridge ma 02139 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 441 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Michael Ellerman <[email protected]> (powerpc) Reviewed-by: Richard Fontana <[email protected]> Reviewed-by: Allison Randal <[email protected]> Reviewed-by: Kate Stewart <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-04-15hwmon: (vt8231) Use permission specific SENSOR[_DEVICE]_ATTR variantsGuenter Roeck1-81/+85
Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_<PERMS> in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Cc: Roger Lucas <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2017-01-02hwmon: (vt8231) use permission-specific DEVICE_ATTR variantsJulia Lawall1-28/+31
Use DEVICE_ATTR_RO for read only attributes and DEVICE_ATTR_RW for read/write attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <[email protected]> [groeck: Updated description] Signed-off-by: Guenter Roeck <[email protected]>
2014-10-20hwmon: drop owner assignment from platform_driversWolfram Sang1-1/+0
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <[email protected]>
2014-01-14hwmon: remove DEFINE_PCI_DEVICE_TABLE macroJingoo Han1-1/+1
Don't use DEFINE_PCI_DEVICE_TABLE macro, because this macro is not preferred. Signed-off-by: Jingoo Han <[email protected]> Acked-by: Jean Delvare <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2013-12-12hwmon: Prevent some divide by zeros in FAN_TO_REG()Dan Carpenter1-1/+1
The "rpm * div" operations can overflow here, so this patch adds an upper limit to rpm to prevent that. Jean Delvare helped me with this patch. Signed-off-by: Dan Carpenter <[email protected]> Acked-by: Roger Lucas <[email protected]> Cc: [email protected] Signed-off-by: Jean Delvare <[email protected]>
2013-04-07hwmon: Fix checkpatch warning 'quoted string split across lines'Guenter Roeck1-2/+3
Cc: Corentin Labbe <[email protected]> Cc: Mark M. Hoffman <[email protected]> Cc: Fenghua Yu <[email protected]> Cc: Juerg Haefliger <[email protected]> Cc: Andreas Herrmann <[email protected]> Cc: Rudolf Marek <[email protected]> Cc: Jim Cromie <[email protected]> Cc: Roger Lucas <[email protected]> Cc: Marc Hulsman <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2013-01-25hwmon: Replace SENSORS_LIMIT with clamp_valGuenter Roeck1-11/+11
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 <[email protected]> Acked-by: George Joseph <[email protected]> Acked-by: Jean Delvare <[email protected]>
2012-11-28hwmon: remove use of __devexitBill Pemberton1-2/+2
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <[email protected]> Cc: Hans de Goede <[email protected]> Cc: Jean Delvare <[email protected]> Cc: Alistair John Strachan <[email protected]> Cc: Fenghua Yu <[email protected]> Cc: Juerg Haefliger <[email protected]> Cc: Andreas Herrmann <[email protected]> Cc: Clemens Ladisch <[email protected]> Cc: Rudolf Marek <[email protected]> Cc: Jim Cromie <[email protected]> Cc: "Mark M. Hoffman" <[email protected]> Cc: Roger Lucas <[email protected]> Acked-by: Guenter Roeck <[email protected]> Acked-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-11-28hwmon: remove use of __devinitBill Pemberton1-3/+3
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <[email protected]> Cc: Hans de Goede <[email protected]> Cc: Jean Delvare <[email protected]> Cc: Alistair John Strachan <[email protected]> Cc: Fenghua Yu <[email protected]> Cc: Juerg Haefliger <[email protected]> Cc: Andreas Herrmann <[email protected]> Cc: Clemens Ladisch <[email protected]> Cc: Rudolf Marek <[email protected]> Cc: Jim Cromie <[email protected]> Cc: "Mark M. Hoffman" <[email protected]> Cc: Roger Lucas <[email protected]> Acked-by: Guenter Roeck <[email protected]> Acked-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-11-28hwmon: remove use of __devexit_pBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <[email protected]> Cc: Hans de Goede <[email protected]> Cc: Jean Delvare <[email protected]> Cc: Alistair John Strachan <[email protected]> Cc: Fenghua Yu <[email protected]> Cc: Juerg Haefliger <[email protected]> Cc: Andreas Herrmann <[email protected]> Cc: Clemens Ladisch <[email protected]> Cc: Rudolf Marek <[email protected]> Cc: Jim Cromie <[email protected]> Cc: "Mark M. Hoffman" <[email protected]> Cc: Roger Lucas <[email protected]> Acked-by: Guenter Roeck <[email protected]> Acked-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-09-23hwmon: (vt8231) Convert to use devm_ functionsGuenter Roeck1-18/+6
Convert to use devm_ functions to reduce code size and simplify the code. Cc: Roger Lucas <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2012-03-18hwmon: (vt8231) Fix multi-line commentsGuenter Roeck1-77/+87
Cc: Roger Lucas <[email protected]> Acked-by: Roger Lucas <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2012-03-18hwmon: (vt8231) Fix checkpatch issuesGuenter Roeck1-33/+94
Fixed: ERROR: code indent should use tabs where possible ERROR: do not use assignment in if condition ERROR: trailing statements should be on next line WARNING: braces {} are not necessary for any arm of this statement WARNING: line over 80 characters WARNING: please, no space before tabs WARNING: simple_strtol is obsolete, use kstrtol instead WARNING: simple_strtoul is obsolete, use kstrtoul instead Not fixed (false positive): ERROR: Macros with multiple statements should be enclosed in a do - while loop Cc: Roger Lucas <[email protected]> Acked-by: Roger Lucas <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2012-03-18hwmon: use DEFINE_PCI_DEVICE_TABLEFrans Meulenbroeks1-1/+1
fix all checkpatch warnings about DEFINE_PCI_DEVICE_TABLE Signed-off-by: Frans Meulenbroeks <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2011-01-08hwmon: (vt8231) Use pr_fmt and pr_<level>Joe Perches1-5/+5
Added #define pr_fmt KBUILD_MODNAME ": " fmt Converted printks to pr_<level> Coalesced any long formats Removed prefixes from formats Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2010-03-06drivers/hwmon/vt8231.c: fix continuation line formatsJoe Perches1-2/+1
String constants that are continued on subsequent lines with \ will cause spurious whitespace in the resulting output. Signed-off-by: Joe Perches <[email protected]> Cc: Roger Lucas <[email protected]> Cc: Jean Delvare <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2010-01-10hwmon: Make PCI device ids constantMárton Németh1-1/+1
The id_table field of the struct pci_driver is constant in <linux/pci.h> so it is worth to make pci_device_id also constant. The semantic match that finds this kind of pattern is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r@ identifier I1, I2, x; @@ struct I1 { ... const struct I2 *x; ... }; @s@ identifier r.I1, y; identifier r.x, E; @@ struct I1 y = { .x = E, }; @c@ identifier r.I2; identifier s.E; @@ const struct I2 E[] = ... ; @depends on !c@ identifier r.I2; identifier s.E; @@ + const struct I2 E[] = ...; // </smpl> Signed-off-by: Márton Németh <[email protected]> Cc: Julia Lawall <[email protected]> Signed-off-by: Jean Delvare <[email protected]>
2009-09-15hwmon: Include <linux/io.h> instead of <asm/io.h>H Hartley Sweeten1-1/+1
Drivers should be including <linux/io.h> instead of <asm/io.h>. Signed-off-by: H Hartley Sweeten <[email protected]> Cc: Alistair John Strachan <[email protected]> Cc: Nicolas Boichat <[email protected]> Cc: Juerg Haefliger <[email protected]> Cc: Frank Seidel <[email protected]> Acked-by: Jim Cromie <[email protected]> Cc: "Mark M. Hoffman" <[email protected]> Cc: Roger Lucas <[email protected]> Signed-off-by: Jean Delvare <[email protected]>
2009-01-07hwmon: Check for ACPI resource conflictsJean Delvare1-0/+5
Check for ACPI resource conflicts in hwmon drivers. I've included all Super-I/O and PCI drivers. I've voluntarily left out: * Vendor-specific drivers: if they conflicted on any system, this would pretty much mean that they conflict on all systems, and we would know by now. * Legacy ISA drivers (lm78 and w83781d): they only support chips found on old designs were ACPI either wasn't supported or didn't deal with thermal management. * Drivers accessing the I/O resources indirectly (e.g. through SMBus): the checks are already done where they belong, i.e. in the bus drivers. Signed-off-by: Jean Delvare <[email protected]> Acked-by: David Hubbard <[email protected]>
2008-02-17hwmon: (vt8231) Update maintainer email addressRoger Lucas1-2/+2
Signed-off-by: Roger Lucas <[email protected]> (modified MAINTAINERS entry also - MMH) Signed-off-by: Mark M. Hoffman <[email protected]>
2008-02-17hwmon: (vt8231) Add individual alarm filesJean Delvare1-2/+38
The new libsensors needs these individual alarm files. Signed-off-by: Jean Delvare <[email protected]> CC: Roger Lucas <[email protected]> Acked-by: Juerg Haefliger <juergh at gmail.com> Signed-off-by: Mark M. Hoffman <[email protected]>
2008-02-07hwmon: (vt8231) Add missing "space"Joe Perches1-1/+1
Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Mark M. Hoffman <[email protected]>
2007-10-14hwmon: (vt8231) fix sparse warningMark M. Hoffman1-1/+1
Signed-off-by: Mark M. Hoffman <[email protected]>
2007-10-09hwmon: Convert from class_device to deviceTony Jones1-5/+5
Convert from class_device to device for hwmon_device_register/unregister Signed-off-by: Tony Jones <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Kay Sievers <[email protected]> Signed-off-by: Mark M. Hoffman <[email protected]>
2007-07-30hwmon: Add missing __devexit tags in various driversJean Delvare1-2/+2
On Sun, 22 Jul 2007 00:30:56 +0200, Gabriel C wrote: > I noticed this warnings on current git: > > drivers/hwmon/pc87360.c:1082: warning: 'pc87360_remove' defined but not used > drivers/hwmon/sis5595.c:580: warning: 'sis5595_remove' defined but not used > drivers/hwmon/smsc47m1.c:608: warning: 'smsc47m1_remove' defined but not used > drivers/hwmon/via686a.c:648: warning: 'via686a_remove' defined but not used > drivers/hwmon/vt8231.c:755: warning: 'vt8231_remove' defined but not used Signed-off-by: Jean Delvare <[email protected]> Signed-off-by: Mark M. Hoffman <[email protected]>
2007-07-19hwmon: Fix a potential race condition on unloadJean Delvare1-0/+1
Fix a potential race condition when some hardware monitoring platform drivers are being unloaded. I believe that the driver data pointer shouldn't be cleared before all the sysfs files are removed, otherwise a sysfs callback might attempt to dereference a NULL pointer. I'm not sure exactly what the driver core protects drivers against, so let's play it safe. While we're here, clear the driver data pointer when probe fails, so as to not leave an invalid pointer behind us. Signed-off-by: Jean Delvare <[email protected]> Signed-off-by: Mark M. Hoffman <[email protected]>
2007-07-19hwmon: Convert vt8231 to a platform driverRoger Lucas1-144/+173
Convert the vt8231 driver from the nonsensical i2c-isa hack to a regular platform driver. Signed-off-by: Roger Lucas <[email protected]> Signed-off-by: Jean Delvare <[email protected]> Signed-off-by: Mark M. Hoffman <[email protected]>
2007-02-13i2c/vt8231: Remove superfluous initializationDavid Brownell1-1/+0
Remove a superfluous initialization from the vt8231 hwmon driver; the i2c core does this, and the source field will be vanishing soon. Signed-off-by: David Brownell <[email protected]> Signed-off-by: Jean Delvare <[email protected]>
2006-09-28vt8231: Fix unchecked return statusRoger Lucas1-54/+132
vt8231: Fix unchecked return status Check the return status from device_create_file() and also use the newer and cleaner sysfs creation functions. Signed-off-by: Roger Lucas <[email protected]> Signed-off-by: Jean Delvare <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-09-26i2c-isa: Restore driver ownerJean Delvare1-0/+1
i2c-isa: Restore driver owner Commit 2b48716d1d2f2edb1e7cbc5ecf1cb2cb39373e33 back in January 2006 was a bit overzealous. It removed .owner from all i2c drivers, including i2c-isa ones, while they still need it. Signed-off-by: Jean Delvare <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-03-23[PATCH] hwmon: Semaphore to mutex conversionsIngo Molnar1-25/+26
convert drivers/hwmon/*.c semaphore use to mutexes. the conversion was generated via scripts, and the result was validated automatically via a script as well. all affected hwmon drivers were build-tested. Signed-off-by: Ingo Molnar <[email protected]> Signed-off-by: Jean Delvare <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-02-13[PATCH] vt8231: Fix sysfs temperature interfaceJean Delvare1-4/+4
The VT8231 low temperature limits are actually hysteresis temperatures to the high limits. Signed-off-by: Jean Delvare <[email protected]> Cc: Roger Lucas <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-01-09[PATCH] drivers/*rest*: Replace pci_module_init() with pci_register_driver()Richard Knutsson1-1/+1
Replace obsolete pci_module_init() with pci_register_driver(). Signed-off-by: Richard Knutsson <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-01-05[PATCH] I2C: Remove .owner setting from i2c_driver as it's no longer neededGreg Kroah-Hartman1-1/+0
Now that i2c_add_driver() doesn't need the module owner to be set by hand, we can delete it from the drivers. This patch catches all of the drivers that I found in the current tree (if a driver sets the .owner by hand, it's not a problem, just not needed.) Signed-off-by: Greg Kroah-Hartman <[email protected]> Cc: Jean Delvare <[email protected]>
2006-01-05[PATCH] i2c: Drop i2c_driver.{owner,name}, 3 of 11Laurent Riffard1-2/+4
We should use the i2c_driver.driver's .name and .owner fields instead of the i2c_driver's ones. This patch updates the hwmon drivers. Signed-off-by: Laurent Riffard <[email protected]> Signed-off-by: Jean Delvare <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-01-05[PATCH] hwmon: New vt8231 driverRoger Lucas1-0/+861
Port the vt8231 hardware monitoring driver from lm_sensors CVS to Linux 2.6. Signed-off-by: Roger Lucas <[email protected]> Signed-off-by: Jean Delvare <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>