Age | Commit message (Collapse) | Author | Files | Lines |
|
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Move from i2c_new_dummy() to i2c_new_dummy_device(), so we now get an
ERRPTR which we use in error handling.
Signed-off-by: Wolfram Sang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guenter Roeck <[email protected]>
|
|
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]>
|
|
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]>
|
|
vrm is an u8, so the written value needs to be limited to [0, 255].
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
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]>
|
|
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]>
|
|
These got broken by recent patches fixing checkpatch warnings in these
drivers. The trick is that the patches themselves looked good, but the
source files after applying them do not. That's why I am not a big fan
of using tabs inside comments.
Signed-off-by: Jean Delvare <[email protected]>
Acked-by: Guenter Roeck <[email protected]>
|
|
Convert to use devm_ functions to reduce code size and simplify the code.
Cc: Mark M. Hoffman <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Fixed:
ERROR: code indent should use tabs where possible
ERROR: do not use assignment in if condition
ERROR: space prohibited after that open parenthesis '('
ERROR: spaces required around that '<' (ctx:VxV)
ERROR: spaces required around that '==' (ctx:VxV)
WARNING: please, no spaces at the start of a line
WARNING: simple_strtol is obsolete, use kstrtol instead
WARNING: simple_strtoul is obsolete, use kstrtoul instead
Modify multi-line comments to follow Documentation/CodingStyle.
Not fixed (false positive):
ERROR: Macros with multiple statements should be enclosed in a do - while loop
Cc: Mark M. Hoffman <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
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 <[email protected]>
Cc: Corentin Labbe <[email protected]>
Cc: Dirk Eibach <[email protected]>
Cc: "Mark M. Hoffman" <[email protected]>
Cc: Steve Glendinning <[email protected]>
Cc: Riku Voipio <[email protected]>
Cc: Guillaume Ligneul <[email protected]>
Cc: David George <[email protected]>
Cc: "Hans J. Koch" <[email protected]>
Cc: Marc Hulsman <[email protected]>
Cc: Rudolf Marek <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Make use of the new i2c_smbus_{read,write}_word_swapped functions.
This makes the driver code more compact and readable. It also ensures
proper error handling.
Signed-off-by: Jean Delvare <[email protected]>
Acked-by: Jonathan Cameron <[email protected]>
Acked-by: Guenter Roeck <[email protected]>
Cc: Dirk Eibach <[email protected]>
Cc: "Mark M. Hoffman" <[email protected]>
Cc: Guillaume Ligneul <[email protected]>
|
|
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]>
|
|
This macro simply declares an enum, so drivers might as well declare
it themselves.
Signed-off-by: Jean Delvare <[email protected]>
Tested-by: Wolfram Sang <[email protected]>
|
|
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 <[email protected]>
Tested-by: Wolfram Sang <[email protected]>
|
|
The "kind" parameter always has value -1, and nobody is using it any
longer, so we can remove it.
Signed-off-by: Jean Delvare <[email protected]>
Tested-by: Wolfram Sang <[email protected]>
|
|
As kind is now hard-coded to -1, there is room for code clean-ups.
Signed-off-by: Jean Delvare <[email protected]>
Acked-by: Corentin Labbe <[email protected]>
Cc: "Mark M. Hoffman" <[email protected]>
Cc: Juerg Haefliger <[email protected]>
Cc: Riku Voipio <[email protected]>
Acked-by: "Hans J. Koch" <[email protected]>
Cc: Rudolf Marek <[email protected]>
|
|
I2C_CLIENT_MODULE_PARM is overkill for force_subclients. We really
only use 4 out of the 48 slots, so we're better defining a custom
variable instead. This change saves 92 bytes of data for each of the
five drivers affected.
Signed-off-by: Jean Delvare <[email protected]>
Cc: Wolfgang Grandegger <[email protected]>
Acked-by: Marc Hulsman <[email protected]>
Cc: Mark M. Hoffman <[email protected]>
|
|
The new-style asb100 driver implements the optional detect() callback
to cover the use cases of the legacy driver.
Signed-off-by: Jean Delvare <[email protected]>
|
|
Acked-by: Jean Delvare <[email protected]>
Signed-off-by: Mark M. Hoffman <[email protected]>
|
|
Signed-off-by: Mark M. Hoffman <[email protected]>
|
|
The new libsensors needs these individual alarm files.
I did not create alarm files for in5 and in6 as these alarms are documented
as not working.
Signed-off-by: Jean Delvare <[email protected]>
Acked-by: Hans de Goede <[email protected]>
Signed-off-by: Mark M. Hoffman <[email protected]>
|
|
Use standard dynamic sysfs callbacks instead of macro-generated
wrappers. This makes the code more readable, and the binary smaller
(by about 12%).
Signed-off-by: Jean Delvare <[email protected]>
Acked-by: Hans de Goede <[email protected]>
Signed-off-by: Mark M. Hoffman <[email protected]>
|
|
* Drop history, it's incomplete and doesn't belong there
* Drop unused version number
* Drop trailing spaces
* Coding style fixes
* Fold long lines
* Rename new_client to client
* Drop redundant initializations to 0
Signed-off-by: Jean Delvare <[email protected]>
Acked-by: Hans de Goede <[email protected]>
Signed-off-by: Mark M. Hoffman <[email protected]>
|
|
What was true of reading the VRM value is also true of writing it: not
being a register value, it doesn't need hardware access, so we don't
need a reference to the i2c client. This allows for a minor code
cleanup. As gcc appears to be smart enough to simplify the generated
code by itself, this cleanup only affects the source code, the
generated binaries are unchanged.
Signed-off-by: Jean Delvare <[email protected]>
Signed-off-by: Mark M. Hoffman <[email protected]>
|
|
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 <[email protected]>
Signed-off-by: Mark M. Hoffman <[email protected]>
|
|
The VRM value is not read from chip registers, so there's no need
to update the device data cache before exporting the VRM value to
user-space.
Signed-off-by: Jean Delvare <[email protected]>
Acked-by: Hans de Goede <[email protected]>
Signed-off-by: Mark M. Hoffman <[email protected]>
|
|
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]>
|
|
- replace differing temperature variable types by long
- use strtol() instead of strtoul() for conversion
Signed-off-by: Christian Hohnstaedt <[email protected]>
Acked-by: Jean Delvare <[email protected]>
Signed-off-by: Mark M. Hoffman <[email protected]>
|
|
hwmon: Fix unchecked return status, batch 1
Fix up some hwmon drivers so that they no longer ignore return status
from device_create_file().
Signed-off-by: Mark M. Hoffman <[email protected]>
Signed-off-by: Jean Delvare <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
acquired (aquired)
contiguous (contigious)
successful (succesful, succesfull)
surprise (suprise)
whether (weather)
some other misspellings
Signed-off-by: Andreas Mohr <[email protected]>
Signed-off-by: Adrian Bunk <[email protected]>
|
|
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]>
|
|
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]>
|
|
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]>
|
|
Just about every i2c chip driver sets the I2C_DF_NOTIFY flag, so we
can simply make it the default and drop the flag. If any driver really
doesn't want to be notified when i2c adapters are added, that driver
can simply omit to set .attach_adapter. This approach is also more
robust as it prevents accidental NULL pointer dereferences.
Signed-off-by: Jean Delvare <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Use kzalloc instead of kmalloc+memset in all hardware monitoring
drivers.
Signed-off-by: Deepak Saxena <[email protected]>
Signed-off-by: Jean Delvare <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
The only part left in i2c-sensor is the VRM/VRD/VID handling code.
This is in no way related to i2c, so it doesn't belong there. Move
the code to hwmon, where it belongs.
Note that not all hardware monitoring drivers do VRM/VRD/VID
operations, so less drivers depend on hwmon-vid than there were
depending on i2c-sensor.
Signed-off-by: Jean Delvare <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
The only thing left in i2c-sensor.h are module parameter definition
macros. It's only an extension of what i2c.h offers, and this extension
is not sensors-specific. As a matter of fact, a few non-sensors drivers
use them. So we better merge them in i2c.h, and get rid of i2c-sensor.h
altogether.
Signed-off-by: Jean Delvare <khali@linux-fr>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
i2c_probe and i2c_detect now do the exact same thing and operate on
the same data structure, so we can have everyone call i2c_probe.
Signed-off-by: Jean Delvare <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
We could refactor the error message 34 different i2c drivers print if
i2c_detach_client() fails in this function itself. Saves quite a few
lines of code. Documentation is updated to reflect that change.
Note that this patch should be applied after Rudolf Marek's w83792d
patches.
Signed-off-by: Jean Delvare <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Kill all uses of i2c_is_isa_adapter except for the hybrid drivers (it87,
lm78, w83781d). The i2c-isa adapter not being registered with the i2c
core anymore, drivers don't have to fear being erroneously attached to
it.
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Kill normal_isa in header files, documentation and all chip drivers, as
it is no more used.
normal_i2c could be renamed to normal, but I decided not to do so at the
moment, so as to limit the number of changes. This might be done later
as part of the i2c_probe/i2c_detect merge.
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
This patch modifies sensors chip drivers to make use of the new
sysfs class "hwmon".
Signed-off-by: Mark M. Hoffman <[email protected]>
Signed-off-by: Jean Delvare <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Part 2: Move the driver files themselves.
Note that the patch "adds trailing whitespace", because it does move the
files as-is, and some files happen to have trailing whitespace.
From: Jean Delvare <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|