24 Sep, 2020

4 commits

  • Convert the adm9240 driver to using regmap and add error handling.

    Signed-off-by: Chris Packham
    Link: https://lore.kernel.org/r/20200924085102.15219-4-chris.packham@alliedtelesis.co.nz
    [groeck: Fixed context conflict against 'hwmon: use simple i2c probe function']
    Signed-off-by: Guenter Roeck

    Chris Packham
     
  • Split the body of adm9240_update_device() into two helper functions
    adm9240_update_measure() and adm9240_update_config(). Although neither
    of the new helpers returns an error yet lay the groundwork for
    propagating failures through to the sysfs readers.

    Signed-off-by: Chris Packham
    Link: https://lore.kernel.org/r/20200924085102.15219-3-chris.packham@alliedtelesis.co.nz
    Signed-off-by: Guenter Roeck

    Chris Packham
     
  • Use loops for reading temp_max and initialising FAN_MIN/TEMP_MAX rather
    than duplicating code.

    Signed-off-by: Chris Packham
    Link: https://lore.kernel.org/r/20200924085102.15219-2-chris.packham@alliedtelesis.co.nz
    Signed-off-by: Guenter Roeck

    Chris Packham
     
  • 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
    Link: https://lore.kernel.org/r/20200813160222.1503401-1-steve@sk2.org
    Signed-off-by: Guenter Roeck

    Stephen Kitt
     

24 May, 2019

1 commit

  • 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
    Reviewed-by: Michael Ellerman (powerpc)
    Reviewed-by: Richard Fontana
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190520071858.739733335@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

16 Apr, 2019

1 commit

  • 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_ 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

    Guenter Roeck
     

03 Jan, 2017

1 commit

  • 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
    [groeck: Updated description]
    Signed-off-by: Guenter Roeck

    Julia Lawall
     

09 Dec, 2016

1 commit

  • Module test reports:

    in0_min: Suspected overflow: [3320 vs. 0]
    in0_max: Suspected overflow: [3320 vs. 0]
    in4_min: Suspected overflow: [15938 vs. 0]
    in4_max: Suspected overflow: [15938 vs. 0]
    temp1_max: Suspected overflow: [127000 vs. 0]
    temp1_max_hyst: Suspected overflow: [127000 vs. 0]
    aout_output: Suspected overflow: [1250 vs. 0]

    Code analysis reveals that the overflows are caused by conversions
    from unsigned long to long to int, combined with multiplications on
    passed values.

    Reviewed-by: Jean Delvare
    Signed-off-by: Guenter Roeck

    Guenter Roeck
     

18 Oct, 2016

1 commit

  • Unlike the temperature thresholds the temperature data is a 9-bit signed
    value. This allows and additional 0.5 degrees of precision on the
    reading but makes handling negative values slightly harder. In order to
    have sign-extension applied correctly the 9-bit value is stored in the
    upper bits of a signed 16-bit value. When presenting this in sysfs the
    value is shifted and scaled appropriately.

    Signed-off-by: Chris Packham
    Signed-off-by: Guenter Roeck

    Chris Packham
     

04 Aug, 2014

2 commits


08 Apr, 2013

1 commit


26 Jan, 2013

1 commit

  • 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
    Acked-by: George Joseph
    Acked-by: Jean Delvare

    Guenter Roeck
     

10 Oct, 2012

1 commit


24 Sep, 2012

1 commit


22 Jul, 2012

1 commit


19 Mar, 2012

2 commits

  • Fixed:
    ERROR: do not use assignment in if condition
    ERROR: that open brace { should be on the previous line
    WARNING: please, no space before tabs
    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

    Signed-off-by: Guenter Roeck

    Guenter Roeck
     
  • 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
    Cc: Corentin Labbe
    Cc: Dirk Eibach
    Cc: "Mark M. Hoffman"
    Cc: Steve Glendinning
    Cc: Riku Voipio
    Cc: Guillaume Ligneul
    Cc: David George
    Cc: "Hans J. Koch"
    Cc: Marc Hulsman
    Cc: Rudolf Marek
    Signed-off-by: Guenter Roeck

    Axel Lin
     

06 Jan, 2012

1 commit


13 Jan, 2011

1 commit


15 Dec, 2009

3 commits


10 Dec, 2009

1 commit

  • As kind is now hard-coded to -1, there is room for code clean-ups.

    Signed-off-by: Jean Delvare
    Acked-by: Corentin Labbe
    Cc: "Mark M. Hoffman"
    Cc: Juerg Haefliger
    Cc: Riku Voipio
    Acked-by: "Hans J. Koch"
    Cc: Rudolf Marek

    Jean Delvare
     

17 Jul, 2008

1 commit


19 Feb, 2008

1 commit


08 Feb, 2008

2 commits


10 Oct, 2007

1 commit


19 Oct, 2006

1 commit


29 Sep, 2006

1 commit


24 Mar, 2006

1 commit

  • 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
    Signed-off-by: Jean Delvare
    Signed-off-by: Greg Kroah-Hartman

    Ingo Molnar
     

06 Jan, 2006

3 commits


29 Oct, 2005

3 commits

  • This whitespace cleanup patch removes one trailing space and breaks
    lines longer than 80 characters.

    Signed-off-by: Grant Coady
    Signed-off-by: Jean Delvare
    Signed-off-by: Greg Kroah-Hartman

    drivers/hwmon/adm9240.c | 33 +++++++++++++++++++++------------
    1 file changed, 21 insertions(+), 12 deletions(-)

    Jean Delvare
     
  • hwmon: adm9240 update 2/2: convert to use dynamic sysfs accessors

    This patch converts adm9240 to use Yani Ioannou's dynamic sysfs callbacks,
    reducing driver memory footprint from 16312 to 14104 bytes on 2.6.14-rc1,
    removing the old driver macro mess.

    Run tested on Intel SE440BX-2 mobo.

    Signed-off-by: Grant Coady
    Signed-off-by: Greg Kroah-Hartman

    Grant Coady
     
  • hwmon: adm9240 update 1/2: cleanups:

    o remove i2c read/write wrapper interface as it does nothing,
    o change kmalloc + memset to kzalloc

    Signed-off-by: Grant Coady
    Signed-off-by: Greg Kroah-Hartman

    Grant Coady
     

06 Sep, 2005

2 commits

  • 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
    Signed-off-by: Greg Kroah-Hartman

    Jean Delvare
     
  • 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
    Signed-off-by: Greg Kroah-Hartman

    Jean Delvare