#
0f1874f8 |
| 03-Apr-2024 |
Andrew Davis <afd@ti.com> |
hwmon: (adm1031) 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.
hwmon: (adm1031) 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-4-afd@ti.com 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 ...
|
#
d7555379 |
| 04-Dec-2021 |
Colin Ian King <colin.i.king@gmail.com> |
hwmon: (adm1031) Remove redundant assignment to variable range
Variable range is being initialized with a value that is never read, it is being re-assigned in the next statement. The assignment is r
hwmon: (adm1031) Remove redundant assignment to variable range
Variable range is being initialized with a value that is never read, it is being re-assigned in the next statement. The assignment is redundant, remove it and initialize range using the second assigned value. Clean up the formatting too by adding missing spaces.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://lore.kernel.org/r/20211204233155.55454-1-colin.i.king@gmail.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 ...
|
#
8e757e15 |
| 22-Jan-2019 |
Guenter Roeck <linux@roeck-us.net> |
hwmon: (adm1031) 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 inconsi
hwmon: (adm1031) 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 ...
|
#
bfb6b173 |
| 22-Dec-2016 |
Julia Lawall <Julia.Lawall@lip6.fr> |
hwmon: (adm1031) use permission-specific DEVICE_ATTR variants
Use DEVICE_ATTR_RW for read/write attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsiste
hwmon: (adm1031) use permission-specific DEVICE_ATTR variants
Use 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: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
show more ...
|
#
b060f3c4 |
| 03-Jul-2014 |
Axel Lin <axel.lin@ingics.com> |
hwmon: (adm1031) Convert to devm_hwmon_device_register_with_groups
Use ATTRIBUTE_GROUPS macro and devm_hwmon_device_register_with_groups() to simplify the code a bit.
Signed-off-by: Axel Lin <axel.
hwmon: (adm1031) Convert to devm_hwmon_device_register_with_groups
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>
show more ...
|
#
278ee1c8 |
| 03-Jul-2014 |
Axel Lin <axel.lin@ingics.com> |
hwmon: (adm1031) 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>
|
#
145e74a4 |
| 03-Jul-2014 |
Guenter Roeck <linux@roeck-us.net> |
hwmon: (adm1031) Fix writes to limit registers
Upper limit for write operations to temperature limit registers was clamped to a fractional value. However, limit registers do not support fractional v
hwmon: (adm1031) Fix writes to limit registers
Upper limit for write operations to temperature limit registers was clamped to a fractional value. However, limit registers do not support fractional values. As a result, upper limits of 127.5 degrees C or higher resulted in a rounded limit of 128 degrees C. Since limit registers are signed, this was stored as -128 degrees C. Clamp limits to (-55, +127) degrees C to solve the problem.
Value on writes to auto_temp[12]_min and auto_temp[12]_max were not clamped at all, but masked. As a result, out-of-range writes resulted in a more or less arbitrary limit. Clamp those attributes to (0, 127) degrees C for more predictable results.
Cc: Axel Lin <axel.lin@ingics.com> Cc: stable@vger.kernel.org Reviewed-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>
|
#
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 ...
|
#
dc2fd663 |
| 02-Jun-2012 |
Guenter Roeck <linux@roeck-us.net> |
hwmon: (adm1031) 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 <k
hwmon: (adm1031) 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 ...
|
#
ce15a81d |
| 24-Mar-2012 |
Guenter Roeck <linux@roeck-us.net> |
hwmon: (adm1031) Fix compiler warning
Some configurations produce the following compile warning:
drivers/hwmon/adm1031.c: In function 'set_fan_auto_channel': drivers/hwmon/adm1031.c:292: warning: '
hwmon: (adm1031) Fix compiler warning
Some configurations produce the following compile warning:
drivers/hwmon/adm1031.c: In function 'set_fan_auto_channel': drivers/hwmon/adm1031.c:292: warning: 'reg' may be used uninitialized in this function
While this is a false positive, it can easily be fixed by overloading the return value from get_fan_auto_nearest with both register value and error return code (the register value is never negative). Coincidentially, that also reduces module size by a few bytes.
Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Jean Delvare <khali@linux-fr.org>
show more ...
|
#
fbb6670d |
| 19-Jan-2012 |
Guenter Roeck <linux@roeck-us.net> |
hwmon: (adm1031) Fix multi-line comments
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
|
#
f0967eea |
| 20-Jan-2012 |
Axel Lin <axel.lin@gmail.com> |
hwmon: convert drivers/hwmon/* to use module_i2c_driver()
This patch converts the drivers in drivers/hwmon/* to use the module_i2c_driver() macro which makes the code smaller and a bit simpler.
Sig
hwmon: convert drivers/hwmon/* to use module_i2c_driver()
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>
show more ...
|
#
1c720093 |
| 16-Jan-2012 |
Guenter Roeck <guenter.roeck@ericsson.com> |
hwmon: (adm1031) Fix coding style issues
Fix almost all coding style issues except for the multi-line macro errors, which do not really apply since the macros are not multi-line statements but decla
hwmon: (adm1031) Fix coding style issues
Fix almost all coding style issues except for the multi-line macro errors, which do not really apply since the macros are not multi-line statements but declarations.
Based on merged patch series from Zac Storer; fixed remaining checkpatch errors and warnings.
Cc: Zac Storer <zac.3.14159@gmail.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
show more ...
|
#
179c4fdb |
| 04-Jan-2012 |
Frans Meulenbroeks <fransmeulenbroeks@gmail.com> |
hwmon: replaced strict_str* with kstr*
replaced strict_strtol with kstrtol and replaced strict_strtuol with kstrtuol
This satisfies checkpatch -f Compile tested only: no warnings or errors given
S
hwmon: replaced strict_str* with kstr*
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>
show more ...
|
#
a51b9944 |
| 17-Sep-2010 |
Guenter Roeck <guenter.roeck@ericsson.com> |
hwmon: (adm1031) Replace update_rate sysfs attribute with update_interval
The attribute reflects an interval, not a rate.
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Ira W.
hwmon: (adm1031) Replace update_rate sysfs attribute with update_interval
The attribute reflects an interval, not a rate.
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Ira W. Snyder <iws@ovro.caltech.edu> Signed-off-by: Jean Delvare <khali@linux-fr.org>
show more ...
|
#
87c33daa |
| 27-May-2010 |
Jean Delvare <khali@linux-fr.org> |
hwmon: (adm1031) Allow setting update rate
Based on earlier work by Ira W. Snyder.
The adm1031 chip is capable of using a runtime configurable sampling rate, using the fan filter register. Add supp
hwmon: (adm1031) Allow setting update rate
Based on earlier work by Ira W. Snyder.
The adm1031 chip is capable of using a runtime configurable sampling rate, using the fan filter register. Add support for reading and setting the update rate via sysfs.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Ira W. Snyder <iws@ovro.caltech.edu>
show more ...
|
#
e5e9f44c |
| 14-Dec-2009 |
Jean Delvare <khali@linux-fr.org> |
i2c: Drop I2C_CLIENT_INSMOD_2 to 8
These macros simply declare an enum, so drivers might as well declare it themselves. This puts an end to the arbitrary limit of 8 chip types per i2c driver.
Signe
i2c: Drop I2C_CLIENT_INSMOD_2 to 8
These macros simply declare an enum, so drivers might as well declare it themselves. This puts an end to the arbitrary limit of 8 chip types per i2c driver.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Wolfram Sang <w.sang@pengutronix.de>
show more ...
|
#
c3813d6a |
| 14-Dec-2009 |
Jean Delvare <khali@linux-fr.org> |
i2c: Get rid of struct i2c_client_address_data
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 li
i2c: Get rid of struct i2c_client_address_data
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>
show more ...
|
#
310ec792 |
| 14-Dec-2009 |
Jean Delvare <khali@linux-fr.org> |
i2c: Drop the kind parameter from detect callbacks
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>
i2c: Drop the kind parameter from detect callbacks
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>
show more ...
|