#
55076454 |
| 03-Apr-2024 |
Andrew Davis <afd@ti.com> |
hwmon: (w83795): 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: (w83795): 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-32-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 ...
|
#
ed5c2f5f |
| 15-Aug-2022 |
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> |
i2c: Make remove callback return void
The value returned by an i2c driver's remove function is mostly ignored. (Only an error message is printed if the value is non-zero that the error is ignored.)
i2c: Make remove callback return void
The value returned by an i2c driver's remove function is mostly ignored. (Only an error message is printed if the value is non-zero that the error is ignored.)
So change the prototype of the remove function to return no value. This way driver authors are not tempted to assume that passing an error to the upper layer is a good idea. All drivers are adapted accordingly. There is no intended change of behaviour, all callbacks were prepared to return 0 before.
Reviewed-by: Peter Senna Tschudin <peter.senna@gmail.com> Reviewed-by: Jeremy Kerr <jk@codeconstruct.com.au> Reviewed-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Crt Mori <cmo@melexis.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Marek Behún <kabel@kernel.org> # for leds-turris-omnia Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Petr Machata <petrm@nvidia.com> # for mlxsw Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com> # for surface3_power Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> # for bmc150-accel-i2c + kxcjk-1013 Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> # for media/* + staging/media/* Acked-by: Miguel Ojeda <ojeda@kernel.org> # for auxdisplay/ht16k33 + auxdisplay/lcd2s Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # for versaclock5 Reviewed-by: Ajay Gupta <ajayg@nvidia.com> # for ucsi_ccg Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> # for iio Acked-by: Peter Rosin <peda@axentia.se> # for i2c-mux-*, max9860 Acked-by: Adrien Grassein <adrien.grassein@gmail.com> # for lontium-lt8912b Reviewed-by: Jean Delvare <jdelvare@suse.de> # for hwmon, i2c-core and i2c/muxes Acked-by: Corey Minyard <cminyard@mvista.com> # for IPMI Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com> # for drivers/power Acked-by: Krzysztof Hałasa <khalasa@piap.pl> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Wolfram Sang <wsa@kernel.org>
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 ...
|
#
673afe46 |
| 21-Aug-2020 |
Stephen Kitt <steve@sk2.org> |
hwmon: use simple i2c probe function (take 2)
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_
hwmon: use simple i2c probe function (take 2)
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 to call i2c_match_id() with the same level of error-handling (if any) as before.
This patch wraps up the transition for hwmon, with four stragglers not included in the previous large patch.
Signed-off-by: Stephen Kitt <steve@sk2.org> Link: https://lore.kernel.org/r/20200821160354.594715-1-steve@sk2.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
show more ...
|
#
df561f66 |
| 23-Aug-2020 |
Gustavo A. R. Silva <gustavoars@kernel.org> |
treewide: Use fallthrough pseudo-keyword
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through mar
treewide: Use fallthrough pseudo-keyword
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case.
[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
show more ...
|
#
ff7924b0 |
| 29-May-2019 |
Thomas Gleixner <tglx@linutronix.de> |
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 272
Based on 1 normalized pattern(s):
this program is free software you can redistribute it and or modify it under the terms of th
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 272
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 version 2 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 51 franklin street fifth floor boston ma 02110 1301 usa
extracted by the scancode license scanner the SPDX license identifier
GPL-2.0-only
has been chosen to replace the boilerplate/reference in 3 file(s).
Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190529141334.517214694@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
#
09aaf681 |
| 15-Nov-2018 |
Huacai Chen <chenhc@lemote.com> |
hwmon: (w83795) temp4_type has writable permission
Both datasheet and comments of store_temp_mode() tell us that temp1~4_type is writable, so fix it.
Signed-off-by: Yao Wang <wangyao@lemote.com> Si
hwmon: (w83795) temp4_type has writable permission
Both datasheet and comments of store_temp_mode() tell us that temp1~4_type is writable, so fix it.
Signed-off-by: Yao Wang <wangyao@lemote.com> Signed-off-by: Huacai Chen <chenhc@lemote.com> Fixes: 39deb6993e7c (" hwmon: (w83795) Simplify temperature sensor type handling") Signed-off-by: Guenter Roeck <linux@roeck-us.net>
show more ...
|
#
cdb1dc3f |
| 16-Apr-2015 |
Bartosz Golaszewski <bgolaszewski@baylibre.com> |
hwmon: (w83795) use find_closest_descending() in pwm_freq_to_reg()
Replace the loop iterating over pwm_freq_cksel0 with a call to find_closest_descending().
Signed-off-by: Bartosz Golaszewski <bgol
hwmon: (w83795) use find_closest_descending() in pwm_freq_to_reg()
Replace the loop iterating over pwm_freq_cksel0 with a call to find_closest_descending().
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 ...
|
#
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 ...
|
#
0657777f |
| 10-Oct-2012 |
Jean Delvare <khali@linux-fr.org> |
hwmon: Drop needless includes of <linux/delay.h>
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-
hwmon: Drop needless includes of <linux/delay.h>
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>
show more ...
|
#
dcd8f392 |
| 10-Oct-2012 |
Jean Delvare <khali@linux-fr.org> |
hwmon: Add missing inclusions of <linux/jiffies.h>
Many hwmon drivers use jiffies but omit the inclusion of the header file. Fix that, and also fix one driver which was including the header file but
hwmon: Add missing inclusions of <linux/jiffies.h>
Many hwmon drivers use jiffies but omit the inclusion of the header file. Fix that, and also fix one driver which was including the header file but didn't need it.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Luca Tettamanti <kronos.it@gmail.com> Cc: Marc Hulsman <m.hulsman@tudelft.nl> Cc: Rudolf Marek <r.marek@assembler.cz>
show more ...
|
#
4cb14a3a |
| 02-Jun-2012 |
Guenter Roeck <linux@roeck-us.net> |
hwmon: (w83795) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.
Cc: Jean Delvare <khali@linux-fr.org> Signed-off-by: Guenter Roeck <linux@ro
hwmon: (w83795) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code.
Cc: Jean Delvare <khali@linux-fr.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Jean Delvare <khali@linux-fr.org>
show more ...
|
#
c10b3ee8 |
| 23-Mar-2012 |
Guenter Roeck <linux@roeck-us.net> |
hwmon: (w83795) Fix multi-line comments
Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
|
#
72fea694 |
| 23-Mar-2012 |
Jean Delvare <khali@linux-fr.org> |
hwmon: (w83795) Unconditionally support manual fan speed control
Manual fan speed control uses a standard interface and has received sufficient testing and review by now, it can be enabled unconditi
hwmon: (w83795) Unconditionally support manual fan speed control
Manual fan speed control uses a standard interface and has received sufficient testing and review by now, it can be enabled unconditionally. This includes attributes pwm[1-8], pwm[1-8]_enable, pwm[1-8]_mode and pwm[1-8]_freq.
We only let the user switch from automatic mode to manual mode, but not the other way around, as automatic control settings may not have been set properly by the BIOS.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
show more ...
|
#
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 ...
|
#
90ab5ee9 |
| 12-Jan-2012 |
Rusty Russell <rusty@rustcorp.com.au> |
module_param: make bool parameters really bool (drivers & misc)
module_param(bool) used to counter-intuitively take an int. In fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy
module_param: make bool parameters really bool (drivers & misc)
module_param(bool) used to counter-intuitively take an int. In fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy trick.
It's time to remove the int/unsigned int option. For this version it'll simply give a warning, but it'll break next kernel version.
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
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 ...
|
#
014bcd28 |
| 12-Jan-2011 |
Jean Delvare <khali@linux-fr.org> |
hwmon: (w83795) Silent false warning from gcc
The code triggers a false warning with older versions of gcc: w83795.c: In function 'w83795_update_device': w83795.c:475: warning: 'lsb' may be used uni
hwmon: (w83795) Silent false warning from gcc
The code triggers a false warning with older versions of gcc: w83795.c: In function 'w83795_update_device': w83795.c:475: warning: 'lsb' may be used uninitialized in this function
I admit that the code is a little tricky, but I see no way to write it differently without hurting performance. So let's just silent the warning with a needless initialization.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
show more ...
|
#
52d159ee |
| 15-Nov-2010 |
Jean Delvare <khali@linux-fr.org> |
hwmon: (w83795) Check for BEEP pin availability
On the W83795ADG, there's a single pin for BEEP and OVT#, so you can't have both. Check the configuration and don't create beep attributes when BEEP p
hwmon: (w83795) Check for BEEP pin availability
On the W83795ADG, there's a single pin for BEEP and OVT#, so you can't have both. Check the configuration and don't create beep attributes when BEEP pin is not available.
The W83795G has a dedicated BEEP pin so the functionality is always available there.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
show more ...
|
#
793c51d5 |
| 15-Nov-2010 |
Jean Delvare <khali@linux-fr.org> |
hwmon: (w83795) Clear intrusion alarm immediately
When asked to clear the intrusion alarm, do so immediately. We have to invalidate the cache to make sure the new status will be read. But we also ha
hwmon: (w83795) Clear intrusion alarm immediately
When asked to clear the intrusion alarm, do so immediately. We have to invalidate the cache to make sure the new status will be read. But we also have to read from the status register once to clear the pending alarm, as writing to CLR_CHS surprising won't clear it automatically.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
show more ...
|
#
cf6b9ea6 |
| 15-Nov-2010 |
Jean Delvare <khali@linux-fr.org> |
hwmon: (w83795) Read the intrusion state properly
We can't read the intrusion state from the real-time alarm registers as we do for all other alarm flags, because real-time alarm bits don't stick (b
hwmon: (w83795) Read the intrusion state properly
We can't read the intrusion state from the real-time alarm registers as we do for all other alarm flags, because real-time alarm bits don't stick (by definition) and the intrusion state has to stick until explicitly cleared (otherwise it has little value.)
So we have to use the interrupt status register instead, which is read from the same address but with a configuration bit flipped in another register.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
show more ...
|