[PATCH 2.6] I2C: macintoch/therm_* drivers cleanups

From: Jean Delvare (khali_at_linux-fr.org)
Date: 11/29/04

  • Next message: Peter Chubb: "Config files that aren't mach_defconfig..."
    Date:	Mon, 29 Nov 2004 23:18:55 +0100
    To: Greg KH <greg@kroah.com>
    
    

    Hi Greg,

    This patch cleans the macintoch/therm_* drivers a bit. It removes
    useless IDs, cleans names (no white space), some coding style fixes as
    well, etc. It's exactly the same as what I posted yesterday as a
    candidate fix to bug #3823:
    http://bugzilla.kernel.org/show_bug.cgi?id=3823

    Although it isn't the proper fix for that bug, as you underlined, this
    still sounds like a sane set of cleanups for these drivers.

    Please apply,
    thanks.

    Signed-off-by: Jean Delvare <khali@linux-fr.org>

    diff -ruN linux-2.6.10-rc2/drivers/macintosh.orig/therm_adt746x.c linux-2.6.10-rc2/drivers/macintosh/therm_adt746x.c
    --- linux-2.6.10-rc2/drivers/macintosh.orig/therm_adt746x.c 2004-11-28 11:32:54.000000000 +0100
    +++ linux-2.6.10-rc2/drivers/macintosh/therm_adt746x.c 2004-11-28 15:19:54.000000000 +0100
    @@ -169,11 +169,11 @@
     }
     
     static struct i2c_driver thermostat_driver = {
    - .name ="Apple Thermostat ADT746x",
    - .id =0xDEAD7467,
    - .flags =I2C_DF_NOTIFY,
    - .attach_adapter =&attach_thermostat,
    - .detach_adapter =&detach_thermostat,
    + .owner = THIS_MODULE,
    + .name = "therm_adt746x",
    + .flags = I2C_DF_NOTIFY,
    + .attach_adapter = attach_thermostat,
    + .detach_adapter = detach_thermostat,
     };
     
     static int read_fan_speed(struct thermostat *th, u8 addr)
    @@ -380,7 +380,6 @@
             th->clt.addr = addr;
             th->clt.adapter = adapter;
             th->clt.driver = &thermostat_driver;
    - th->clt.id = 0xDEAD7467;
             strcpy(th->clt.name, "thermostat");
     
             rc = read_reg(th, 0);
    diff -ruN linux-2.6.10-rc2/drivers/macintosh.orig/therm_pm72.c linux-2.6.10-rc2/drivers/macintosh/therm_pm72.c
    --- linux-2.6.10-rc2/drivers/macintosh.orig/therm_pm72.c 2004-11-28 11:32:54.000000000 +0100
    +++ linux-2.6.10-rc2/drivers/macintosh/therm_pm72.c 2004-11-28 13:43:25.000000000 +0100
    @@ -235,8 +235,8 @@
     
     static struct i2c_driver therm_pm72_driver =
     {
    + .owner = THIS_MODULE,
             .name = "therm_pm72",
    - .id = 0xDEADBEEF,
             .flags = I2C_DF_NOTIFY,
             .attach_adapter = therm_pm72_attach,
             .detach_adapter = therm_pm72_detach,
    @@ -266,7 +266,6 @@
             clt->addr = (id >> 1) & 0x7f;
             clt->adapter = adap;
             clt->driver = &therm_pm72_driver;
    - clt->id = 0xDEADBEEF;
             strncpy(clt->name, name, I2C_NAME_SIZE-1);
     
             if (i2c_attach_client(clt)) {
    diff -ruN linux-2.6.10-rc2/drivers/macintosh.orig/therm_windtunnel.c linux-2.6.10-rc2/drivers/macintosh/therm_windtunnel.c
    --- linux-2.6.10-rc2/drivers/macintosh.orig/therm_windtunnel.c 2004-10-24 09:48:16.000000000 +0200
    +++ linux-2.6.10-rc2/drivers/macintosh/therm_windtunnel.c 2004-11-28 15:19:42.000000000 +0100
    @@ -353,12 +353,12 @@
     }
     
     static struct i2c_driver g4fan_driver = {
    - .name = "Apple G4 Thermostat/Fan",
    + .owner = THIS_MODULE,
    + .name = "therm_windtunnel",
             .id = I2C_DRIVERID_G4FAN,
             .flags = I2C_DF_NOTIFY,
    - .attach_adapter = &do_attach,
    - .detach_client = &do_detach,
    - .command = NULL,
    + .attach_adapter = do_attach,
    + .detach_client = do_detach,
     };
     
     static int

    -- 
    Jean Delvare
    http://khali.linux-fr.org/
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Peter Chubb: "Config files that aren't mach_defconfig..."

    Relevant Pages

    • Re: [PATCH] I2C fixes for 2.6.10-rc2
      ... This patch cleans the macintoch/therm_* drivers a bit. ... static int read_fan_speed ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: best way to handle LEDs
      ... On Thu, 3 Nov 2005, Russell King wrote: ... > drivers to busy wait instead of sleeping. ... static int local_kernel_thread{ ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] I2C fixes for 2.6.10-rc2
      ... that when a process wakes by an interrupt, ... there are other drivers with the exact same problem. ... static int pcf_isa_init ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [PATCH 2.6] I2C: Kill i2c_client.id (3/5)
      ... Stop using i2c_client.id in misc drivers. ... client id is then useless and can be removed. ... static int ioc_client_reg ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • [PATCH] I2C: Kill i2c_client.id (3/5)
      ... Stop using i2c_client.id in misc drivers. ... client id is then useless and can be removed. ... static int ioc_client_reg ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)