Merge branch 'release' of git://lm-sensors.org/kernel/mhoffman/hwmon-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 1 Aug 2008 18:33:19 +0000 (11:33 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 1 Aug 2008 18:33:19 +0000 (11:33 -0700)
* 'release' of git://lm-sensors.org/kernel/mhoffman/hwmon-2.6:
  hwmon: needs new maintainer
  hwmon: (lm85) Simplify device initialization function
  hwmon: (lm85) Misc cleanups
  hwmon: (lm85) Don't write back cached values
  hwmon: (lm85) Drop dead code
  hwmon: (lm85) Coding-style cleanups
  hwmon: (lm75) add new-style driver binding
  hwmon: (lm75) cleanup/reorg
  hwmon: (adt7473) clarify an awkward bit of code
  hwmon: (adt7473) Remove unused defines
  hwmon: (dme1737) fix voltage scaling
  hwmon: (dme1737) probe all addresses
  hwmon: (dme1737) demacrofy for readability

1  2 
MAINTAINERS
drivers/hwmon/adt7473.c

diff --combined MAINTAINERS
index c65a5b9e3446f750edf3d326b7d14a4cc406b86a,d526be327a8ea45d498d8060cdae70d238605fd7..5e6d6ab824339b7fcc4f681d87b117c0808760aa
@@@ -216,8 -216,8 +216,8 @@@ W: http://code.google.com/p/aceracp
  S:    Maintained
  
  ACPI
 -P:    Len Brown
 -M:    len.brown@intel.com
 +P:    Andi Kleen
 +M:    ak@linux.intel.com
  M:    lenb@kernel.org
  L:    linux-acpi@vger.kernel.org
  W:    http://www.lesswatts.org/projects/acpi/
@@@ -239,8 -239,8 +239,8 @@@ W: http://www.lesswatts.org/projects/ac
  S:    Supported
  
  ACPI FAN DRIVER
 -P:    Len Brown
 -M:    len.brown@intel.com
 +P:    Zhang Rui
 +M:    rui.zhang@intel.com
  L:    linux-acpi@vger.kernel.org
  W:    http://www.lesswatts.org/projects/acpi/
  S:    Supported
  ACPI PCI HOTPLUG DRIVER
  P:    Kristen Carlson Accardi
  M:    kristen.c.accardi@intel.com
 -L:    pcihpd-discuss@lists.sourceforge.net
 +L:    linux-pci@vger.kernel.org
  S:    Supported
  
  ACPI THERMAL DRIVER
 -P:    Len Brown
 -M:    len.brown@intel.com
 +P:    Zhang Rui
 +M:    rui.zhang@intel.com
  L:    linux-acpi@vger.kernel.org
  W:    http://www.lesswatts.org/projects/acpi/
  S:    Supported
  
  ACPI VIDEO DRIVER
 -P:    Rui Zhang
 +P:    Zhang Rui
  M:    rui.zhang@intel.com
  L:    linux-acpi@vger.kernel.org
  W:    http://www.lesswatts.org/projects/acpi/
@@@ -348,9 -348,7 +348,9 @@@ W: http://www.linux-usb.org/SpeedTouch
  S:    Maintained
  
  ALCHEMY AU1XX0 MMC DRIVER
 -S:    Orphan
 +P:    Manuel Lauss
 +M:    manuel.lauss@gmail.com
 +S:    Maintained
  
  ALI1563 I2C DRIVER
  P:    Rudolf Marek
@@@ -378,12 -376,6 +378,12 @@@ L:       linux-geode@lists.infradead.org (mod
  W:    http://www.amd.com/us-en/ConnectivitySolutions/TechnicalResources/0,,50_2334_2452_11363,00.html
  S:    Supported
  
 +AMD IOMMU (AMD-VI)
 +P:    Joerg Roedel
 +M:    joerg.roedel@amd.com
 +L:    iommu@lists.linux-foundation.org
 +S:    Supported
 +
  AMS (Apple Motion Sensor) DRIVER
  P:    Stelian Pop
  M:    stelian@popies.net
@@@ -441,7 -433,10 +441,7 @@@ M:        spyro@f2s.co
  S:    Maintained
  
  ARM PRIMECELL MMCI PL180/1 DRIVER
 -P:    Russell King
 -M:    rmk@arm.linux.org.uk
 -L:    linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
 -S:    Maintained
 +S:    Orphan
  
  ARM/ADI ROADRUNNER MACHINE SUPPORT
  P:    Lennert Buytenhek
@@@ -480,28 -475,11 +480,28 @@@ M:      kernel@wantstofly.or
  L:    linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
  S:    Maintained
  
 +ARM/COMPULAB CM-X270/EM-X270 MACHINE SUPPORT
 +P:    Mike Rapoport
 +M:    mike@compulab.co.il
 +L:    linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
 +S:    Maintained
 +
  ARM/CORGI MACHINE SUPPORT
  P:    Richard Purdie
  M:    rpurdie@rpsys.net
  S:    Maintained
  
 +ARM/EZX SMARTPHONES (A780, A910, A1200, E680, ROKR E2 and ROKR E6)
 +P:    Daniel Ribeiro
 +M:    drwyrm@gmail.com
 +P:    Stefan Schmidt
 +M:    stefan@openezx.org
 +P:    Harald Welte
 +M:    laforge@openezx.org
 +L:    openezx-devel@lists.openezx.org (subscribers-only)
 +W:    http://www.openezx.org/
 +S:    Maintained
 +
  ARM/GLOMATION GESBC9312SX MACHINE SUPPORT
  P:    Lennert Buytenhek
  M:    kernel@wantstofly.org
@@@ -589,18 -567,10 +589,18 @@@ L:      linux-arm-kernel@lists.arm.linux.org
  S:    Maintained
  
  ARM/TOSA MACHINE SUPPORT
 +P:    Dmitry Baryshkov
 +M:    dbaryshkov@gmail.com
  P:    Dirk Opfer
  M:    dirk@opfer-online.de
  S:    Maintained
  
 +ARM/PALMTX SUPPORT
 +P:    Marek Vasut
 +M:    marek.vasut@gmail.com
 +W:    http://hackndev.com
 +S:    Maintained
 +
  ARM/PLEB SUPPORT
  P:    Peter Chubb
  M:    pleb@gelato.unsw.edu.au
@@@ -1043,12 -1013,6 +1043,12 @@@ M:    fujita.tomonori@lab.ntt.co.j
  L:    linux-scsi@vger.kernel.org
  S:    Supported
  
 +BT8XXGPIO DRIVER
 +P:    Michael Buesch
 +M:    mb@bu3sch.de
 +W:    http://bu3sch.de/btgpio.php
 +S:    Maintained
 +
  BTTV VIDEO4LINUX DRIVER
  P:    Mauro Carvalho Chehab
  M:    mchehab@infradead.org
@@@ -1173,28 -1137,23 +1173,28 @@@ COMPACTPCI HOTPLUG COR
  P:    Scott Murray
  M:    scottm@somanetworks.com
  M:    scott@spiteful.org
 -L:    pcihpd-discuss@lists.sourceforge.net
 +L:    linux-pci@vger.kernel.org
  S:    Supported
  
  COMPACTPCI HOTPLUG ZIATECH ZT5550 DRIVER
  P:    Scott Murray
  M:    scottm@somanetworks.com
  M:    scott@spiteful.org
 -L:    pcihpd-discuss@lists.sourceforge.net
 +L:    linux-pci@vger.kernel.org
  S:    Supported
  
  COMPACTPCI HOTPLUG GENERIC DRIVER
  P:    Scott Murray
  M:    scottm@somanetworks.com
  M:    scott@spiteful.org
 -L:    pcihpd-discuss@lists.sourceforge.net
 +L:    linux-pci@vger.kernel.org
  S:    Supported
  
 +COMPAL LAPTOP SUPPORT
 +P:    Cezary Jackiewicz
 +M:    cezary.jackiewicz@gmail.com
 +S:    Maintained
 +
  COMPUTONE INTELLIPORT MULTIPORT CARD
  P:    Michael H. Warfield
  M:    mhw@wittsend.com
@@@ -1721,13 -1680,6 +1721,13 @@@ L:    linuxppc-embedded@ozlabs.or
  L:    linux-kernel@vger.kernel.org
  S:    Maintained
  
 +FREESCALE I2C CPM DRIVER
 +P:    Jochen Friedrich
 +M:    jochen@scram.de
 +L:    linuxppc-dev@ozlabs.org
 +L:    i2c@lm-sensors.org
 +S:    Maintained
 +
  FREESCALE SOC FS_ENET DRIVER
  P:    Pantelis Antoniou
  M:    pantelis.antoniou@gmail.com
@@@ -1812,22 -1764,11 +1812,22 @@@ M:   hch@infradead.or
  W:    ftp://ftp.openlinux.org/pub/people/hch/vxfs
  S:    Maintained
  
 +FTRACE
 +P:    Steven Rostedt
 +M:    srostedt@redhat.com
 +S:    Maintained
 +
  FUJITSU FR-V (FRV) PORT
  P:    David Howells
  M:    dhowells@redhat.com
  S:    Maintained
  
 +FUJITSU LAPTOP EXTRAS
 +P:    Jonathan Woithe
 +M:    jwoithe@physics.adelaide.edu.au
 +L:    linux-acpi@vger.kernel.org
 +S:    Maintained
 +
  FUSE: FILESYSTEM IN USERSPACE
  P:    Miklos Szeredi
  M:    miklos@szeredi.hu
@@@ -1878,13 -1819,9 +1878,9 @@@ W:     http://gigaset307x.sourceforge.net
  S:    Maintained
  
  HARDWARE MONITORING
- P:    Mark M. Hoffman
- M:    mhoffman@lightlink.com
  L:    lm-sensors@lm-sensors.org
  W:    http://www.lm-sensors.org/
- T:    git lm-sensors.org:/kernel/mhoffman/hwmon-2.6.git testing
- T:    git lm-sensors.org:/kernel/mhoffman/hwmon-2.6.git release
- S:    Maintained
+ S:    Orphaned
  
  HARDWARE RANDOM NUMBER GENERATOR CORE
  S:    Orphaned
@@@ -1990,7 -1927,7 +1986,7 @@@ P:      Carlos Corbach
  M:    carlos@strangeworlds.co.uk
  S:    Odd Fixes
  
 -HPET: High Precision Event Timers driver (hpet.c)
 +HPET: High Precision Event Timers driver (drivers/char/hpet.c)
  P:    Clemens Ladisch
  M:    clemens@ladisch.de
  S:    Maintained
@@@ -2016,12 -1953,6 +2012,12 @@@ M:    mikulas@artax.karlin.mff.cuni.c
  W:    http://artax.karlin.mff.cuni.cz/~mikulas/vyplody/hpfs/index-e.cgi
  S:    Maintained
  
 +HTCPEN TOUCHSCREEN DRIVER
 +P:    Pau Oliva Fora
 +M:    pof@eslack.org
 +L:    linux-input@vger.kernel.org
 +S:    Maintained
 +
  HUGETLB FILESYSTEM
  P:    William Irwin
  M:    wli@holomorphy.com
@@@ -2223,8 -2154,6 +2219,8 @@@ P:      Jesse Brandebur
  M:    jesse.brandeburg@intel.com
  P:    Bruce Allan
  M:    bruce.w.allan@intel.com
 +P:    PJ Waskiewicz
 +M:    peter.p.waskiewicz.jr@intel.com
  P:    John Ronciak
  M:    john.ronciak@intel.com
  L:    e1000-devel@lists.sourceforge.net
@@@ -2374,16 -2303,6 +2370,16 @@@ L:    linux-mtd@lists.infradead.or
  W:    http://www.linux-mtd.infradead.org/doc/jffs2.html
  S:    Maintained
  
 +UBI FILE SYSTEM (UBIFS)
 +P:    Artem Bityutskiy
 +M:    dedekind@infradead.org
 +P:    Adrian Hunter
 +M:    ext-adrian.hunter@nokia.com
 +L:    linux-mtd@lists.infradead.org
 +T:    git git://git.infradead.org/~dedekind/ubifs-2.6.git
 +W:    http://www.linux-mtd.infradead.org/doc/ubifs.html
 +S:    Maintained
 +
  JFS FILESYSTEM
  P:    Dave Kleikamp
  M:    shaggy@austin.ibm.com
@@@ -2580,11 -2499,13 +2576,11 @@@ W:   http://www.penguinppc.org
  L:    linuxppc-dev@ozlabs.org
  S:    Maintained
  
 -LINUX FOR POWERPC EMBEDDED MPC52XX
 +LINUX FOR POWERPC EMBEDDED MPC5XXX
  P:    Sylvain Munaut
  M:    tnt@246tNt.com
  P:    Grant Likely
  M:    grant.likely@secretlab.ca
 -W:    http://www.246tNt.com/mpc52xx/
 -W:    http://www.penguinppc.org/
  L:    linuxppc-dev@ozlabs.org
  S:    Maintained
  
@@@ -2761,10 -2682,12 +2757,10 @@@ L:   libertas-dev@lists.infradead.or
  S:    Maintained
  
  MARVELL MV643XX ETHERNET DRIVER
 -P:    Dale Farnsworth
 -M:    dale@farnsworth.org
 -P:    Manish Lachwani
 -M:    mlachwani@mvista.com
 +P:    Lennert Buytenhek
 +M:    buytenh@marvell.com
  L:    netdev@vger.kernel.org
 -S:    Odd Fixes for 2.4; Maintained for 2.6.
 +S:    Supported
  
  MATROX FRAMEBUFFER DRIVER
  P:    Petr Vandrovec
@@@ -2943,6 -2866,8 +2939,6 @@@ P:      Faisal Lati
  M:    flatif@neteffect.com
  P:    Chien Tung
  M:    ctung@neteffect.com
 -P:    Glenn Streiff
 -M:    gstreiff@neteffect.com
  L:    general@lists.openfabrics.org
  W:    http://www.neteffect.com
  S:    Supported
@@@ -3123,12 -3048,6 +3119,12 @@@ W:    http://oss.oracle.com/projects/ocfs2
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2.git
  S:    Supported
  
 +OMFS FILESYSTEM
 +P:    Bob Copeland
 +M:    me@bobcopeland.com
 +L:    linux-karma-devel@lists.sourceforge.net
 +S:    Maintained
 +
  OMNIKEY CARDMAN 4000 DRIVER
  P:    Harald Welte
  M:    laforge@gnumonks.org
@@@ -3257,7 -3176,7 +3253,7 @@@ S:      Supporte
  PCIE HOTPLUG DRIVER
  P:    Kristen Carlson Accardi
  M:    kristen.c.accardi@intel.com
 -L:    pcihpd-discuss@lists.sourceforge.net
 +L:    linux-pci@vger.kernel.org
  S:    Supported
  
  PCMCIA SUBSYSTEM
@@@ -3312,6 -3231,14 +3308,6 @@@ L:     linux-kernel@vger.kernel.or
  T:    git git.infradead.org/battery-2.6.git
  S:    Maintained
  
 -POWERPC 4xx EMAC DRIVER
 -P:    Eugene Surovegin
 -M:    ebs@ebshome.net
 -W:    http://kernel.ebshome.net/emac/
 -L:    linuxppc-dev@ozlabs.org
 -L:    netdev@vger.kernel.org
 -S:    Maintained
 -
  PNP SUPPORT
  P:    Adam Belay
  M:    ambx1@neo.rr.com
@@@ -3565,7 -3492,7 +3561,7 @@@ S:      Supporte
  
  S390 NETWORK DRIVERS
  P:    Ursula Braun
 -M:    ubraun@linux.vnet.ibm.com
 +M:    ursula.braun@de.ibm.com
  P:    Frank Blaschka
  M:    blaschka@linux.vnet.ibm.com
  M:    linux390@de.ibm.com
@@@ -3585,19 -3512,12 +3581,19 @@@ S:   Supporte
  
  S390 IUCV NETWORK LAYER
  P:    Ursula Braun
 -M:    ubraun@linux.vnet.ibm.com
 +M:    ursula.braun@de.ibm.com
  M:    linux390@de.ibm.com
  L:    linux-s390@vger.kernel.org
  W:    http://www.ibm.com/developerworks/linux/linux390/
  S:    Supported
  
 +S3C24XX SD/MMC Driver
 +P:    Ben Dooks
 +M:    ben-linux@fluff.org
 +L:    linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
 +L:    linux-kernel@vger.kernel.org
 +S:    Supported
 +
  SAA7146 VIDEO4LINUX-2 DRIVER
  P:    Michael Hunold
  M:    michael@mihu.de
@@@ -3670,12 -3590,6 +3666,12 @@@ P:    Jim Cromi
  M:    jim.cromie@gmail.com
  S:    Maintained
  
 +SDRICOH_CS MMC/SD HOST CONTROLLER INTERFACE DRIVER
 +P:    Sascha Sommer
 +M:    saschasommer@freenet.de
 +L:    sdricohcs-devel@lists.sourceforge.net (subscribers-only)
 +S:    Maintained
 +
  SECURITY CONTACT
  P:    Security Officers
  M:    security@kernel.org
@@@ -3796,12 -3710,6 +3792,12 @@@ P:    Ben Nizett
  M:    bn@niasdigital.com
  S:    Maintained
  
 +SOC-CAMERA V4L2 SUBSYSTEM
 +P:     Guennadi Liakhovetski
 +M:     g.liakhovetski@gmx.de
 +L:     video4linux-list@redhat.com
 +S:     Maintained
 +
  SOFTWARE RAID (Multiple Disks) SUPPORT
  P:    Ingo Molnar
  M:    mingo@redhat.com
@@@ -3901,7 -3809,7 +3897,7 @@@ S:      Maintaine
  SHPC HOTPLUG DRIVER
  P:    Kristen Carlson Accardi
  M:    kristen.c.accardi@intel.com
 -L:    pcihpd-discuss@lists.sourceforge.net
 +L:    linux-pci@vger.kernel.org
  S:    Supported
  
  SECURE DIGITAL HOST CONTROLLER INTERFACE DRIVER
@@@ -3968,7 -3876,7 +3964,7 @@@ M:      lethal@linux-sh.or
  L:    linux-sh@vger.kernel.org
  W:    http://www.linux-sh.org
  T:    git kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6.git
 -S:    Maintained
 +S:    Supported
  
  SUN3/3X
  P:    Sam Creasey
@@@ -4085,10 -3993,9 +4081,10 @@@ W:    http://www.buzzard.org.uk/toshiba
  S:    Maintained
  
  TPM DEVICE DRIVER
 -P:     Debora Velarde
 -P:     Rajiv Andrade
 -M:    tpmdd-devel@lists.sourceforge.net
 +P:    Debora Velarde
 +M:    debora@linux.vnet.ibm.com
 +P:    Rajiv Andrade
 +M:    srajiv@linux.vnet.ibm.com
  W:    http://tpmdd.sourceforge.net
  P:    Marcel Selhorst
  M:    tpm@selhorst.net
@@@ -4096,6 -4003,12 +4092,6 @@@ W:     http://www.prosec.rub.de/tpm
  L:    tpmdd-devel@lists.sourceforge.net
  S:    Maintained
  
 -TRIDENT 4DWAVE/SIS 7018 PCI AUDIO CORE
 -P:    Muli Ben-Yehuda
 -M:    mulix@mulix.org
 -L:    linux-kernel@vger.kernel.org
 -S:    Maintained
 -
  TRIVIAL PATCHES
  P:    Jesper Juhl
  M:    trivial@kernel.org
@@@ -4141,6 -4054,9 +4137,6 @@@ W:      http://www.uclinux.org
  L:    uclinux-dev@uclinux.org  (subscribers-only)
  S:    Maintained
  
 -UCLINUX FOR NEC V850
 -P:    Miles Bader
 -
  UCLINUX FOR RENESAS H8/300
  P:    Yoshinori Sato
  M:    ysato@users.sourceforge.jp
@@@ -4504,15 -4420,6 +4500,15 @@@ M:    kaber@trash.ne
  L:    netdev@vger.kernel.org
  S:    Maintained
  
 +VOLTAGE AND CURRENT REGULATOR FRAMEWORK
 +P:    Liam Girdwood
 +M:    lg@opensource.wolfsonmicro.com
 +P:    Mark Brown
 +M:    broonie@opensource.wolfsonmicro.com
 +W:    http://opensource.wolfsonmicro.com/node/15
 +T:    git kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6.git
 +S:    Supported
 +
  VT1211 HARDWARE MONITOR DRIVER
  P:    Juerg Haefliger
  M:    juergh@gmail.com
diff --combined drivers/hwmon/adt7473.c
index ce4a7cb5a116ad59365aa846921926a92bd5fa17,0cd6c720a854b2e95164e4c86f21e36a30af231f..3a0b63136479d7c4c701dc8eb6e3652e033c1831
@@@ -39,32 -39,20 +39,20 @@@ I2C_CLIENT_INSMOD_1(adt7473)
  #define ADT7473_REG_BASE_ADDR                 0x20
  
  #define ADT7473_REG_VOLT_BASE_ADDR            0x21
- #define ADT7473_REG_VOLT_MAX_ADDR             0x22
  #define ADT7473_REG_VOLT_MIN_BASE_ADDR                0x46
- #define ADT7473_REG_VOLT_MIN_MAX_ADDR         0x49
  
  #define ADT7473_REG_TEMP_BASE_ADDR            0x25
- #define ADT7473_REG_TEMP_MAX_ADDR             0x27
  #define ADT7473_REG_TEMP_LIMITS_BASE_ADDR     0x4E
- #define ADT7473_REG_TEMP_LIMITS_MAX_ADDR      0x53
  #define ADT7473_REG_TEMP_TMIN_BASE_ADDR               0x67
- #define ADT7473_REG_TEMP_TMIN_MAX_ADDR                0x69
  #define ADT7473_REG_TEMP_TMAX_BASE_ADDR               0x6A
- #define ADT7473_REG_TEMP_TMAX_MAX_ADDR                0x6C
  
  #define ADT7473_REG_FAN_BASE_ADDR             0x28
- #define ADT7473_REG_FAN_MAX_ADDR              0x2F
  #define ADT7473_REG_FAN_MIN_BASE_ADDR         0x54
- #define ADT7473_REG_FAN_MIN_MAX_ADDR          0x5B
  
  #define ADT7473_REG_PWM_BASE_ADDR             0x30
- #define ADT7473_REG_PWM_MAX_ADDR              0x32
  #define       ADT7473_REG_PWM_MIN_BASE_ADDR           0x64
- #define ADT7473_REG_PWM_MIN_MAX_ADDR          0x66
  #define ADT7473_REG_PWM_MAX_BASE_ADDR         0x38
- #define ADT7473_REG_PWM_MAX_MAX_ADDR          0x3A
  #define ADT7473_REG_PWM_BHVR_BASE_ADDR                0x5C
- #define ADT7473_REG_PWM_BHVR_MAX_ADDR         0x5E
  #define               ADT7473_PWM_BHVR_MASK           0xE0
  #define               ADT7473_PWM_BHVR_SHIFT          5
  
  #define               ADT7473_FAN4_ALARM              0x20
  #define               ADT7473_R1T_SHORT               0x40
  #define               ADT7473_R2T_SHORT               0x80
- #define ADT7473_REG_MAX_ADDR                  0x80
  
  #define ALARM2(x)     ((x) << 8)
  
  #define FAN_DATA_VALID(x)     ((x) && (x) != FAN_PERIOD_INVALID)
  
  struct adt7473_data {
 -      struct i2c_client       client;
        struct device           *hwmon_dev;
        struct attribute_group  attrs;
        struct mutex            lock;
        u8                      max_duty_at_overheat;
  };
  
 -static int adt7473_attach_adapter(struct i2c_adapter *adapter);
 -static int adt7473_detect(struct i2c_adapter *adapter, int address, int kind);
 -static int adt7473_detach_client(struct i2c_client *client);
 +static int adt7473_probe(struct i2c_client *client,
 +                       const struct i2c_device_id *id);
 +static int adt7473_detect(struct i2c_client *client, int kind,
 +                        struct i2c_board_info *info);
 +static int adt7473_remove(struct i2c_client *client);
 +
 +static const struct i2c_device_id adt7473_id[] = {
 +      { "adt7473", adt7473 },
 +      { }
 +};
 +MODULE_DEVICE_TABLE(i2c, adt7473_id);
  
  static struct i2c_driver adt7473_driver = {
 +      .class          = I2C_CLASS_HWMON,
        .driver = {
                .name   = "adt7473",
        },
 -      .attach_adapter = adt7473_attach_adapter,
 -      .detach_client  = adt7473_detach_client,
 +      .probe          = adt7473_probe,
 +      .remove         = adt7473_remove,
 +      .id_table       = adt7473_id,
 +      .detect         = adt7473_detect,
 +      .address_data   = &addr_data,
  };
  
  /*
@@@ -583,10 -559,9 +570,9 @@@ static ssize_t set_max_duty_at_crit(str
        struct i2c_client *client = to_i2c_client(dev);
        struct adt7473_data *data = i2c_get_clientdata(client);
        int temp = simple_strtol(buf, NULL, 10);
-       temp = temp && 0xFF;
  
        mutex_lock(&data->lock);
-       data->max_duty_at_overheat = temp;
+       data->max_duty_at_overheat = !!temp;
        reg = i2c_smbus_read_byte_data(client, ADT7473_REG_CFG4);
        if (temp)
                reg |= ADT7473_CFG4_MAX_DUTY_AT_OVT;
@@@ -1053,52 -1028,66 +1039,52 @@@ static struct attribute *adt7473_attr[
        NULL
  };
  
 -static int adt7473_attach_adapter(struct i2c_adapter *adapter)
 +/* Return 0 if detection is successful, -ENODEV otherwise */
 +static int adt7473_detect(struct i2c_client *client, int kind,
 +                        struct i2c_board_info *info)
  {
 -      if (!(adapter->class & I2C_CLASS_HWMON))
 -              return 0;
 -      return i2c_probe(adapter, &addr_data, adt7473_detect);
 -}
 -
 -static int adt7473_detect(struct i2c_adapter *adapter, int address, int kind)
 -{
 -      struct i2c_client *client;
 -      struct adt7473_data *data;
 -      int err = 0;
 +      struct i2c_adapter *adapter = client->adapter;
  
        if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
 -              goto exit;
 -
 -      data = kzalloc(sizeof(struct adt7473_data), GFP_KERNEL);
 -      if (!data) {
 -              err = -ENOMEM;
 -              goto exit;
 -      }
 -
 -      client = &data->client;
 -      client->addr = address;
 -      client->adapter = adapter;
 -      client->driver = &adt7473_driver;
 -
 -      i2c_set_clientdata(client, data);
 -
 -      mutex_init(&data->lock);
 +              return -ENODEV;
  
        if (kind <= 0) {
                int vendor, device, revision;
  
                vendor = i2c_smbus_read_byte_data(client, ADT7473_REG_VENDOR);
 -              if (vendor != ADT7473_VENDOR) {
 -                      err = -ENODEV;
 -                      goto exit_free;
 -              }
 +              if (vendor != ADT7473_VENDOR)
 +                      return -ENODEV;
  
                device = i2c_smbus_read_byte_data(client, ADT7473_REG_DEVICE);
 -              if (device != ADT7473_DEVICE) {
 -                      err = -ENODEV;
 -                      goto exit_free;
 -              }
 +              if (device != ADT7473_DEVICE)
 +                      return -ENODEV;
  
                revision = i2c_smbus_read_byte_data(client,
                                                    ADT7473_REG_REVISION);
 -              if (revision != ADT7473_REV_68 && revision != ADT7473_REV_69) {
 -                      err = -ENODEV;
 -                      goto exit_free;
 -              }
 +              if (revision != ADT7473_REV_68 && revision != ADT7473_REV_69)
 +                      return -ENODEV;
        } else
                dev_dbg(&adapter->dev, "detection forced\n");
  
 -      strlcpy(client->name, "adt7473", I2C_NAME_SIZE);
 +      strlcpy(info->type, "adt7473", I2C_NAME_SIZE);
  
 -      err = i2c_attach_client(client);
 -      if (err)
 -              goto exit_free;
 +      return 0;
 +}
 +
 +static int adt7473_probe(struct i2c_client *client,
 +                       const struct i2c_device_id *id)
 +{
 +      struct adt7473_data *data;
 +      int err;
 +
 +      data = kzalloc(sizeof(struct adt7473_data), GFP_KERNEL);
 +      if (!data) {
 +              err = -ENOMEM;
 +              goto exit;
 +      }
 +
 +      i2c_set_clientdata(client, data);
 +      mutex_init(&data->lock);
  
        dev_info(&client->dev, "%s chip found\n", client->name);
  
        data->attrs.attrs = adt7473_attr;
        err = sysfs_create_group(&client->dev.kobj, &data->attrs);
        if (err)
 -              goto exit_detach;
 +              goto exit_free;
  
        data->hwmon_dev = hwmon_device_register(&client->dev);
        if (IS_ERR(data->hwmon_dev)) {
  
  exit_remove:
        sysfs_remove_group(&client->dev.kobj, &data->attrs);
 -exit_detach:
 -      i2c_detach_client(client);
  exit_free:
        kfree(data);
  exit:
        return err;
  }
  
 -static int adt7473_detach_client(struct i2c_client *client)
 +static int adt7473_remove(struct i2c_client *client)
  {
        struct adt7473_data *data = i2c_get_clientdata(client);
  
        hwmon_device_unregister(data->hwmon_dev);
        sysfs_remove_group(&client->dev.kobj, &data->attrs);
 -      i2c_detach_client(client);
        kfree(data);
        return 0;
  }