- Oct 12, 2021
-
-
Paul Fertser authored
We have bool so use it consistently in all the drivers. The following Coccinelle script was used: @@ identifier T; type t = { char, int }; @@ struct T { ... - t valid; + bool valid; ... } @@ identifier v; @@ ( - v->valid = 0 + v->valid = false | - v->valid = 1 + v->valid = true ) followed by sed to fixup the comments: sed '/bool valid;/{s/!=0/true/;s/zero/false/}' Few whitespace changes were fixed manually. All modified drivers were compile-tested. Signed-off-by:
Paul Fertser <fercerpav@gmail.com> Link: https://lore.kernel.org/r/20210924195202.27917-1-fercerpav@gmail.com [groeck: Fixed up 'u8 valid' to 'boool valid' in atxp1.c] Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
- May 13, 2021
-
-
Greg Kroah-Hartman authored
This reverts commit 9aa3aa15. Because of recent interactions with developers from @umn.edu, all commits from them have been recently re-reviewed to ensure if they were correct or not. Upon review, it was determined that this commit is not needed at all so just revert it. Also, the call to lm80_init_client() was not properly handled, so if error handling is needed in the lm80_probe() function, then it should be done properly, not half-baked like the commit being reverted here did. Cc: Kangjie Lu <kjlu@umn.edu> Fixes: 9aa3aa15 ("hwmon: (lm80) fix a missing check of bus read in lm80 probe") Cc: stable <stable@vger.kernel.org> Acked-by:
Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20210503115736.2104747-5-gregkh@linuxfoundation.org Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- Sep 23, 2020
-
-
Stephen Kitt authored
Many hwmon drivers don't use the id information provided by the old i2c probe function, and the remainder can easily be adapted to the new form ("probe_new") by calling i2c_match_id explicitly. This avoids scanning the identifier tables during probes. Drivers which didn't use the id are converted as-is; drivers which did are modified as follows: * if the information in i2c_client is sufficient, that's used instead (client->name); * anything else is handled by calling i2c_match_id() with the same level of error-handling (if any) as before. A few drivers aren't included in this patch because they have a different set of maintainers. They will be covered by other patches. Signed-off-by:
Stephen Kitt <steve@sk2.org> Link: https://lore.kernel.org/r/20200813160222.1503401-1-steve@sk2.org Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
- May 24, 2019
-
-
Thomas Gleixner authored
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 <tglx@linutronix.de> Reviewed-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc) Reviewed-by:
Richard Fontana <rfontana@redhat.com> Reviewed-by:
Allison Randal <allison@lohutok.net> Reviewed-by:
Kate Stewart <kstewart@linuxfoundation.org> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190520071858.739733335@linutronix.de Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- Feb 18, 2019
-
-
Guenter Roeck authored
Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readability, 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/hwmon/ . This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
- Jan 07, 2019
-
-
Wei Yongjun authored
Add the missing unlock before return from function set_fan_div() in the error handling case. Fixes: c9c63915 ("hwmon: (lm80) fix a missing check of the status of SMBus read") Signed-off-by:
Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
- Dec 21, 2018
-
-
Kangjie Lu authored
In lm80_probe(), if lm80_read_value() fails, it returns a negative error number which is stored to data->fan[f_min] and will be further used. We should avoid using the data if the read fails. The fix checks if lm80_read_value() fails, and if so, returns with the error number. Signed-off-by:
Kangjie Lu <kjlu@umn.edu> Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Kangjie Lu authored
If lm80_read_value() fails, it returns a negative number instead of the correct read data. Therefore, we should avoid using the data if it fails. The fix checks if lm80_read_value() fails, and if so, returns with the error number. Signed-off-by:
Kangjie Lu <kjlu@umn.edu> [groeck: One variable for return values is enough] Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
- Jan 02, 2017
-
-
Julia Lawall authored
Use DEVICE_ATTR_RO for read-only 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 <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
- May 21, 2014
-
-
Guenter Roeck authored
Avoid need for forward declarations by rearranging code. No functional change. Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Guenter Roeck authored
Convert fan display function macros into functions to reduce code size and improve code readability. Code size reduction is about 200 bytes on x86_64. Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Guenter Roeck authored
Convert voltage display function macros into functions to reduce code size and improve code readability. Code size reduction is about 600 bytes on x86_64. Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Guenter Roeck authored
Convert temperature display function macros into functions to reduce code size and improve code readability. Code size reduction is about 2k on x86_64. Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Guenter Roeck authored
Normalize all stored temperature values to 16 bit to simplify temperature calculations. Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Guenter Roeck authored
TEMP_FROM_REG gets 12 bits of temperature data in the upper 12 bit of a signed 16 bit parameter, with the integer part (including sign) in the upper 8 bit and the remainder in bit 4..7. The lower 4 bit of the 16 bit data is always 0. We can use that information to convert the temperature directly into display data (1/1000th of degree C). Note that the stored temperature data is not shifted right as the comment claimed, so remove that misleading comment. Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
- Apr 04, 2014
-
-
Simplify code, reduce code size, and attach hwmon attributes to hwmon device. Signed-off-by:
Guenter Roeck <linux@roeck-us.net> Signed-off-by:
Jean Delvare <jdelvare@suse.de>
-
- Apr 08, 2013
-
-
Guenter Roeck authored
Cc: Corentin Labbe <corentin.labbe@geomatys.fr> Cc: Mark M. Hoffman <mhoffman@lightlink.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Juerg Haefliger <juergh@gmail.com> Cc: Andreas Herrmann <herrmann.der.user@googlemail.com> Cc: Rudolf Marek <r.marek@assembler.cz> Cc: Jim Cromie <jim.cromie@gmail.com> Cc: Roger Lucas <vt8231@hiddenengine.co.uk> Cc: Marc Hulsman <m.hulsman@tudelft.nl> Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
- Jan 26, 2013
-
-
Guenter Roeck authored
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>
-
- Jul 22, 2012
-
-
Guenter Roeck authored
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>
-
- Mar 19, 2012
-
-
Jean Delvare authored
Add detection of the National Semiconductor (now Texas Instruments) LM96080. It is functionally compatible with the LM80 but detection is completely different. Signed-off-by:
Jean Delvare <khali@linux-fr.org> Cc: Guenter Roeck <guenter.roeck@ericsson.com> Cc: Frans Meulenbroeks <fransmeulenbroeks@gmail.com> Signed-off-by:
Guenter Roeck <guenter.roeck@ericsson.com>
-
Guenter Roeck authored
Signed-off-by:
Guenter Roeck <linux@roeck-us.net> Acked-by:
Jean Delvare <khali@linux-fr.org>
-
Axel Lin authored
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>
-
Frans Meulenbroeks authored
If an error occurs while updating (e.g. because the chip was disconnected) the device needs to be reinitialized in order to get back to 11 bit temperature and set the fan divider. Signed-off-by:
Frans Meulenbroeks <fransmeulenbroeks@gmail.com> Signed-off-by:
Guenter Roeck <guenter.roeck@ericsson.com>
-
Frans Meulenbroeks authored
fix: WARNING: simple_strtol is obsolete, use kstrtol instead WARNING: simple_strtoul is obsolete, use kstrtoul instead Signed-off-by:
Frans Meulenbroeks <fransmeulenbroeks@gmail.com> [guenter.roeck@ericsson.com: kstrtol->kstrtoul where appropriate] Signed-off-by:
Guenter Roeck <guenter.roeck@ericsson.com>
-
Frans Meulenbroeks authored
The LM80 driver currently does not return errors after I2C access failures. Add it. Signed-off-by:
Frans Meulenbroeks <fransmeulenbroeks@gmail.com> Signed-off-by:
Guenter Roeck <guenter.roeck@ericsson.com>
-
- Jan 05, 2012
-
-
Frans Meulenbroeks authored
Fixed all checkpatch messages except simple_strto* -> kstr* This will be addressed in a separate patch Also left one line-too-long message as it was only a little bit too long and would become less readable compile-tested: no warnings or errors Signed-off-by:
Frans Meulenbroeks <fransmeulenbroeks@gmail.com> Signed-off-by:
Guenter Roeck <guenter.roeck@ericsson.com>
-
- Dec 14, 2009
-
-
Jean Delvare authored
This macro simply declares an enum, so drivers might as well declare it themselves. Signed-off-by:
Jean Delvare <khali@linux-fr.org> Tested-by:
Wolfram Sang <w.sang@pengutronix.de>
-
Jean Delvare authored
Struct i2c_client_address_data only contains one field at this point, which makes its usefulness questionable. Get rid of it and pass simple address lists around instead. Signed-off-by:
Jean Delvare <khali@linux-fr.org> Tested-by:
Wolfram Sang <w.sang@pengutronix.de>
-
Jean Delvare authored
The "kind" parameter always has value -1, and nobody is using it any longer, so we can remove it. Signed-off-by:
Jean Delvare <khali@linux-fr.org> Tested-by:
Wolfram Sang <w.sang@pengutronix.de>
-
- Jul 16, 2008
-
-
Jean Delvare authored
The new-style lm80 driver implements the optional detect() callback to cover the use cases of the legacy driver. Signed-off-by:
Jean Delvare <khali@linux-fr.org>
-
- Feb 19, 2008
-
-
Mark M. Hoffman authored
Signed-off-by:
Mark M. Hoffman <mhoffman@lightlink.com>
-
- Feb 08, 2008
-
-
Jean Delvare authored
The new libsensors needs these individual alarm files. Signed-off-by:
Jean Delvare <khali@linux-fr.org> Signed-off-by:
Mark M. Hoffman <mhoffman@lightlink.com>
-
Jean Delvare authored
Use standard dynamic sysfs callbacks instead of macro-generated functions. This makes the code more readable, and the binary smaller (by about 34%). As a side note, another benefit of this type of cleanup is that they shrink the build time. For example, this cleanup saves about 29% of the lm80 driver build time. Signed-off-by:
Jean Delvare <khali@linux-fr.org> Signed-off-by:
Mark M. Hoffman <mhoffman@lightlink.com>
-
Jean Delvare authored
* Drop trailing whitespace * Fold a long line * Rename new_client to client * Drop redundant initializations to 0 * Drop bogus comment Signed-off-by:
Jean Delvare <khali@linux-fr.org> Signed-off-by:
Mark M. Hoffman <mhoffman@lightlink.com>
-
Jean Delvare authored
Many I2C hwmon drivers define a driver ID but no other code references these, meaning that they are useless. Discard them, along with a few IDs which are defined but never used at all. Signed-off-by:
Jean Delvare <khali@linux-fr.org> Signed-off-by:
Mark M. Hoffman <mhoffman@lightlink.com>
-
- Oct 10, 2007
-
-
Tony Jones authored
Convert from class_device to device for hwmon_device_register/unregister Signed-off-by:
Tony Jones <tonyj@suse.de> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by:
Kay Sievers <kay.sievers@vrfy.org> Signed-off-by:
Mark M. Hoffman <mhoffman@lightlink.com>
-
- Sep 28, 2006
-
-
Mark M. Hoffman authored
hwmon: Fix unchecked return status, batch 2 Fix up some hwmon drivers so that they no longer ignore return status from device_create_file(). Signed-off-by:
Mark M. Hoffman <mhoffman@lightlink.com> Signed-off-by:
Jean Delvare <khali@linux-fr.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
- Jun 26, 2006
-
-
acquired (aquired) contiguous (contigious) successful (succesful, succesfull) surprise (suprise) whether (weather) some other misspellings Signed-off-by:
Andreas Mohr <andi@lisas.de> Signed-off-by:
Adrian Bunk <bunk@stusta.de>
-
- Mar 23, 2006
-
-
Ingo Molnar authored
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 <mingo@elte.hu> Signed-off-by:
Jean Delvare <khali@linux-fr.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
- Jan 06, 2006
-
-
Greg Kroah-Hartman authored
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 <gregkh@suse.de> Cc: Jean Delvare <khali@linux-fr.org>
-