#
4cfd3cee |
| 03-Apr-2024 |
Andrew Davis <afd@ti.com> |
hwmon: (lm85) Remove use of i2c_match_id()
The function i2c_match_id() is used to fetch the matching ID from the i2c_device_id table. This is often used to then retrieve the matching driver_data. Th
hwmon: (lm85) Remove use of i2c_match_id()
The function i2c_match_id() is used to fetch the matching ID from the i2c_device_id table. This is often used to then retrieve the matching driver_data. This can be done in one step with the helper i2c_get_match_data().
This helper has a couple other benefits: * It doesn't need the i2c_device_id passed in so we do not need to have that forward declared, allowing us to remove those or move the i2c_device_id table down to its more natural spot with the other module info. * It also checks for device match data, which allows for OF and ACPI based probing. That means we do not have to manually check those first and can remove those checks.
Signed-off-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20240403203633.914389-17-afd@ti.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
show more ...
|
#
8d84910a |
| 10-Aug-2023 |
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> |
hwmon: (lm85) fix Wvoid-pointer-to-enum-cast warning
'type' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes:
lm85.c:1562:16: error: cast to smaller integer type 'enum chip
hwmon: (lm85) fix Wvoid-pointer-to-enum-cast warning
'type' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes:
lm85.c:1562:16: error: cast to smaller integer type 'enum chips' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230810093157.94244-7-krzysztof.kozlowski@linaro.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
show more ...
|
#
39f03438 |
| 14-Jul-2023 |
Rob Herring <robh@kernel.org> |
hwmon: Explicitly include correct DT includes
The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that m
hwmon: Explicitly include correct DT includes
The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes.
Signed-off-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20230714174607.4057185-1-robh@kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
show more ...
|
#
1975d167 |
| 05-May-2023 |
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> |
hwmon: Switch i2c drivers back to use .probe()
After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 (
hwmon: Switch i2c drivers back to use .probe()
After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20230505131718.1210071-1-u.kleine-koenig@pengutronix.de [groeck: Added missing change in pmbus/acbel-fsg032.c] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
show more ...
|
#
f2f394db |
| 18-Aug-2022 |
Wolfram Sang <wsa+renesas@sang-engineering.com> |
hwmon: move from strlcpy with unused retval to strscpy
Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated b
hwmon: move from strlcpy with unused retval to strscpy
Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script.
Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://lore.kernel.org/r/20220818210014.6769-1-wsa+renesas@sang-engineering.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
show more ...
|
#
952a11ca |
| 24-Sep-2021 |
Paul Fertser <fercerpav@gmail.com> |
hwmon: cleanup non-bool "valid" data fields
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 {
hwmon: cleanup non-bool "valid" data fields
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>
show more ...
|
#
67487038 |
| 13-Aug-2020 |
Stephen Kitt <steve@sk2.org> |
hwmon: use simple i2c probe function
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
hwmon: use simple i2c probe function
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>
show more ...
|
#
74ba9207 |
| 20-May-2019 |
Thomas Gleixner <tglx@linutronix.de> |
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61
Based on 1 normalized pattern(s):
this program is free software you can redistribute it and or modify it under the terms of the
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61
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>
show more ...
|
#
7bc85e49 |
| 22-Jan-2019 |
Guenter Roeck <linux@roeck-us.net> |
hwmon: (lm85) Use permission specific SENSOR[_DEVICE]_ATTR variants
Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsiste
hwmon: (lm85) Use permission specific SENSOR[_DEVICE]_ATTR variants
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.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
show more ...
|
#
20b497ab |
| 04-Apr-2019 |
Guenter Roeck <linux@roeck-us.net> |
hwmon: (lm85) Fix build warning
The following build warning is seen if CONFIG_OF is disabled.
drivers/hwmon/lm85.c:1645:34: warning: ‘lm85_of_match’ defined but not used
Mark lm85_of_match as __m
hwmon: (lm85) Fix build warning
The following build warning is seen if CONFIG_OF is disabled.
drivers/hwmon/lm85.c:1645:34: warning: ‘lm85_of_match’ defined but not used
Mark lm85_of_match as __maybe_unused to ix the problem.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
show more ...
|
#
e9b95485 |
| 04-Feb-2019 |
Jeremy Gebben <jgebben@sweptlaser.com> |
hwmon: (lm85) add support for LM96000 high frequencies
The LM96000 expands the freqency field from 3 to 4 bits, to add more frequencies in the 22.5 to 30 kHz ranges.
Signed-off-by: Jeremy Gebben <j
hwmon: (lm85) add support for LM96000 high frequencies
The LM96000 expands the freqency field from 3 to 4 bits, to add more frequencies in the 22.5 to 30 kHz ranges.
Signed-off-by: Jeremy Gebben <jgebben@sweptlaser.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
show more ...
|
#
11650cf0 |
| 04-Feb-2019 |
Jeremy Gebben <jgebben@sweptlaser.com> |
hwmon: (lm85) support the LM96000
It has been supported as a generic lm85 for quite some time.
Signed-off-by: Jeremy Gebben <jgebben@sweptlaser.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
|
#
57bc3019 |
| 04-Feb-2019 |
Jeremy Gebben <jgebben@sweptlaser.com> |
hwmon: (lm85) remove freq_map size hardcodes
Allow support for chips that support more than 8 frequencies.
Signed-off-by: Jeremy Gebben <jgebben@sweptlaser.com> Signed-off-by: Guenter Roeck <linux@
hwmon: (lm85) remove freq_map size hardcodes
Allow support for chips that support more than 8 frequencies.
Signed-off-by: Jeremy Gebben <jgebben@sweptlaser.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
show more ...
|
#
00c0f9d3 |
| 24-Feb-2017 |
Javier Martinez Canillas <javier@osg.samsung.com> |
hwmon: (lm85) Add OF device ID table
The driver doesn't have a struct of_device_id table but supported devices are registered via Device Trees. This is working on the assumption that a I2C device re
hwmon: (lm85) Add OF device ID table
The driver doesn't have a struct of_device_id table but supported devices are registered via Device Trees. This is working on the assumption that a I2C device registered via OF will always match a legacy I2C device ID and that the MODALIAS reported will always be of the form i2c:<device>.
But this could change in the future so the correct approach is to have an OF device ID table if the devices are registered via OF.
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
show more ...
|
#
d0ed69d5 |
| 22-Dec-2016 |
Julia Lawall <Julia.Lawall@lip6.fr> |
hwmon: (lm85) use permission-specific DEVICE_ATTR variants
Use DEVICE_ATTR_RO for read only attributes and DEVICE_ATTR_RW for read/write attributes. This simplifies the source code, improves readbil
hwmon: (lm85) use permission-specific DEVICE_ATTR variants
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 <Julia.Lawall@lip6.fr> [groeck: Update description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
show more ...
|
#
67b20034 |
| 05-Dec-2016 |
Guenter Roeck <linux@roeck-us.net> |
hwmon: (lm85) Fix overflows seen when writing voltage limit attributes
Writes into voltage limit attributes can overflow due to an unbound multiplication.
Reviewed-by: Jean Delvare <jdelvare@suse.d
hwmon: (lm85) Fix overflows seen when writing voltage limit attributes
Writes into voltage limit attributes can overflow due to an unbound multiplication.
Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
show more ...
|
#
0f3721c5 |
| 16-Apr-2015 |
Bartosz Golaszewski <bgolaszewski@baylibre.com> |
hwmon: (lm85) use find_closest() in x_TO_REG() functions
Replace RANGE_TO_REG() and FREQ_TO_REG() implementations with calls to find_closest().
Signed-off-by: Bartosz Golaszewski <bgolaszewski@bayl
hwmon: (lm85) use find_closest() in x_TO_REG() functions
Replace RANGE_TO_REG() and FREQ_TO_REG() implementations with calls to find_closest().
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
show more ...
|
#
746f6884 |
| 23-Jul-2014 |
Axel Lin <axel.lin@ingics.com> |
hwmon: (lm85) Convert to devm_hwmon_device_register_with_groups
Use devm_hwmon_device_register_with_groups() to simplify the code a bit.
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by:
hwmon: (lm85) Convert to devm_hwmon_device_register_with_groups
Use 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>
show more ...
|
#
6fd5dd58 |
| 23-Jul-2014 |
Axel Lin <axel.lin@ingics.com> |
hwmon: (lm85) Avoid forward declaration
Reorder functions to avoid forward declaration.
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
|
#
3248c3b7 |
| 30-Jul-2014 |
Guenter Roeck <linux@roeck-us.net> |
hwmon: (lm85) Fix various errors on attribute writes
Temperature limit register writes did not account for negative numbers. As a result, writing -127000 resulted in -126000 written into the tempera
hwmon: (lm85) Fix various errors on attribute writes
Temperature limit register writes did not account for negative numbers. As a result, writing -127000 resulted in -126000 written into the temperature limit register. This problem affected temp[1-3]_min, temp[1-3]_max, temp[1-3]_auto_temp_crit, and temp[1-3]_auto_temp_min.
When writing pwm[1-3]_freq, a long variable was auto-converted into an int without range check. Wiring values larger than MAXINT resulted in unexpected register values.
When writing temp[1-3]_auto_temp_max, an unsigned long variable was auto-converted into an int without range check. Writing values larger than MAXINT resulted in unexpected register values.
vrm is an u8, so the written value needs to be limited to [0, 255].
Cc: Axel Lin <axel.lin@ingics.com> Cc: stable@vger.kernel.org Reviewed-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
show more ...
|
#
590e8534 |
| 11-Jun-2014 |
Jean Delvare <jdelvare@suse.de> |
hwmon: (lm85) Drop generic detection
Generic detection leads to too many false positives, so drop it. FWIW sensors-detect does not have such generic detection. If the user wants to force the driver
hwmon: (lm85) Drop generic detection
Generic detection leads to too many false positives, so drop it. FWIW sensors-detect does not have such generic detection. If the user wants to force the driver to bind to a not yet supported chip, he/she can still do so using sysfs attribute new_device.
Signed-off-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
show more ...
|
#
7c81c60f |
| 29-Jan-2014 |
Jean Delvare <khali@linux-fr.org> |
Update Jean Delvare's e-mail address
Signed-off-by: Jean Delvare <khali@linux-fr.org>
|
#
b55f3757 |
| 10-Jan-2013 |
Guenter Roeck <linux@roeck-us.net> |
hwmon: Fix checkpatch warning 'quoted string split across lines'
Cc: Corentin Labbe <corentin.labbe@geomatys.fr> Cc: Mark M. Hoffman <mhoffman@lightlink.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc
hwmon: Fix checkpatch warning 'quoted string split across lines'
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>
show more ...
|
#
2a844c14 |
| 09-Jan-2013 |
Guenter Roeck <linux@roeck-us.net> |
hwmon: Replace SENSORS_LIMIT with clamp_val
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
hwmon: Replace SENSORS_LIMIT with clamp_val
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>
show more ...
|
#
747e5d62 |
| 02-Jun-2012 |
Guenter Roeck <linux@roeck-us.net> |
hwmon: (lm85) Convert to use devm_ functions
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 <khal
hwmon: (lm85) Convert to use devm_ functions
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>
show more ...
|