I2C fixes for 2.6.10-rc2
Subsystems (6)
PATCH 1/1 I2C fixes for 2.6.10-rc2
Hi,
Here are some i2c driver fixes and the addition of a new chip driver for 2.6.10-rc2 (it is self-contained) for 2.6.10-rc2
Please pull from: bk://kernel.bkbits.net/gregkh/linux/i2c-2.6
Individual patches will follow, sent to the sensors and linux-kernel lists.
thanks,
greg k-h
drivers/i2c/busses/i2c-elektor.c | 28 drivers/i2c/busses/i2c-ite.c | 31 drivers/i2c/busses/i2c-nforce2.c | 9 drivers/i2c/chips/Kconfig | 9 drivers/i2c/chips/Makefile | 1 drivers/i2c/chips/adm1026.c | 1781 ++++++++++++++++++++++++++++++++++- drivers/i2c/chips/w83l785ts.c | 9 drivers/macintosh/therm_adt746x.c | 11 drivers/macintosh/therm_pm72.c | 3 drivers/macintosh/therm_windtunnel.c | 8 drivers/w1/Kconfig | 2 drivers/w1/dscore.c | 40 drivers/w1/dscore.h | 34 drivers/w1/w1_int.c | 11 drivers/w1/w1_netlink.c | 3 include/linux/pci_ids.h | 1 16 files changed, 1902 insertions(+), 79 deletions(-)
-----
<jthiessen:penguincomputing.com>:
o I2C: add adm1026 chip driver
Aristeu Sergio Rozanski Filho:
o i2c-ite: get rid of cli()/sti()
o [2/2] i2c-elektor: adding missing casts
o i2c-elektor: get rid of cli/sti
Evgeniy Polyakov:
o W1: check nls in return path
o drivers/w1/dscore: fix the inline mess
o w1: make W1_DS9490_BRIDGE available
o w1: do not stop and oops if netlink socket was not allocated
Greg Kroah-Hartman:
o I2C: make fixup_fan_min static in adm1026 driver
Jean Delvare:
o I2C: macintoch/therm_* drivers cleanups
o I2C: Add support for the nForce2 Ultra 400 to i2c-nforce2
o I2C: More verbose w83l785ts driver
PATCH 1/1 I2C fixes for 2.6.10-rc2
ChangeSet 1.2223.2.1, 2004/11/24 14:24:06-08:00, [email protected]
[PATCH] I2C: More verbose w83l785ts driver
This simple patch increases the verbosity of the w83l785ts hardware monitoring driver. I wrote it months ago in the hope it would help solve a reported problem [1]. Not sure whether it did (no news from user since July), but the extra debug info may help in the future and doesn't hurt otherwise, so let's have this in for every user (not that many AFAIK), just in case.
[1] http://bugzilla.kernel.org/show_bug.cgi?id=2899
drivers/i2c/chips/w83l785ts.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
drivers/i2c/chips/w83l785ts.c +6 -3
@@ -280,14 +280,17 @@* default value requested by the caller. */ for (i =1 ; i <=MAX_RETRIES ; i++) { value =i2c_smbus_read_byte_data (client, reg); -if (value >=0 ) +if (value >=0 ) { +dev_dbg (&client->dev,"Read 0x%02x from register " +"0x%02x.\n" , value, reg);return value; + }dev_dbg (&client->dev,"Read failed, will retry in %d.\n" , i);msleep (i); } -dev_err (&client->dev,"Couldn't read value from register. " -"Please report.\n" ); +dev_err (&client->dev,"Couldn't read value from register 0x%02x. " +"Please report.\n" , reg);return defval; }
ChangeSet 1.2223.2.2, 2004/11/24 14:24:32-08:00, [email protected]
[PATCH] w1: do not stop and oops if netlink socket was not allocated.
Do not panic if netlink socket was not created.
This will allow only first device to broadcast it's slave updates. We need kernel connector here.
drivers/w1/w1_int.c | 9 +++------ drivers/w1/w1_netlink.c | 3 +++ 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/w1/w1_int.c +3 -6
@@ -89,11 +89,8 @@ dev->seq =1 ; dev->nls =netlink_kernel_create (NETLINK_NFLOG ,NULL );if (!dev->nls) { -printk (KERN_ERR "Failed to create new netlink socket(%u).\n" , -NETLINK_NFLOG ); -memset (dev,0 ,sizeof (struct w1_master )); -kfree (dev); - dev =NULL ; +printk (KERN_ERR "Failed to create new netlink socket(%u) for w1 master %s.\n" , +NETLINK_NFLOG , dev->dev.bus_id); } err =device_register (&dev->dev);
@@ -112,7 +109,7 @@void w1_free_dev (struct w1_master *dev) {device_unregister (&dev->dev); -if (dev->nls->sk_socket) +if (dev->nls && dev->nls->sk_socket)sock_release (dev->nls->sk_socket);memset (dev,0 ,sizeof (struct w1_master ) +sizeof (struct w1_bus_master ));kfree (dev);
drivers/w1/w1_netlink.c +3 -0
@@ -34,6 +34,9 @@struct w1_netlink_msg *data;struct nlmsghdr *nlh; +if (!dev->nls) +return ; + size =NLMSG_SPACE (sizeof (struct w1_netlink_msg )); skb =alloc_skb (size,GFP_ATOMIC );
ChangeSet 1.2223.2.3, 2004/11/24 14:24:57-08:00, [email protected]
[PATCH] w1: make W1_DS9490_BRIDGE available
W1_DS9490R_BRIDGE kconfig typo.
drivers/w1/Kconfig | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/w1/Kconfig +1 -1
@@ -30,7 +30,7 @@ This support is also available as a module. If so, the module will be called ds9490r.ko. -config W1_DS9490R_BRIDGE +config W1_DS9490_BRIDGE tristate "DS9490R USB <-> W1 transport layer for 1-wire" depends on W1_DS9490 help
ChangeSet 1.2223.2.4, 2004/11/24 14:25:23-08:00, [email protected]
[PATCH] drivers/w1/dscore: fix the inline mess
Remove unneded inlines.
drivers/w1/dscore.c | 40 ++++++++++++++++++++-------------------- drivers/w1/dscore.h | 34 +++++++++++++++++----------------- 2 files changed, 37 insertions(+), 37 deletions(-)
drivers/w1/dscore.c +20 -20
@@ -35,26 +35,26 @@int ds_probe (struct usb_interface *,const struct usb_device_id *);void ds_disconnect (struct usb_interface *); -inline int ds_touch_bit (struct ds_device *,u8 ,u8 *); -inline int ds_read_byte (struct ds_device *,u8 *); -inline int ds_read_bit (struct ds_device *,u8 *); -inline int ds_write_byte (struct ds_device *,u8 ); -inline int ds_write_bit (struct ds_device *,u8 ); -inline int ds_start_pulse (struct ds_device *,int ); -inline int ds_set_speed (struct ds_device *,int ); -inline int ds_reset (struct ds_device *,struct ds_status *); -inline int ds_detect (struct ds_device *,struct ds_status *); -inline int ds_stop_pulse (struct ds_device *,int ); -inline int ds_send_data (struct ds_device *,unsigned char *,int ); -inline int ds_recv_data (struct ds_device *,unsigned char *,int ); -inline int ds_recv_status (struct ds_device *,struct ds_status *); -inline struct ds_device *ds_get_device (void ); -inline void ds_put_device (struct ds_device *); +int ds_touch_bit (struct ds_device *,u8 ,u8 *); +int ds_read_byte (struct ds_device *,u8 *); +int ds_read_bit (struct ds_device *,u8 *); +int ds_write_byte (struct ds_device *,u8 ); +int ds_write_bit (struct ds_device *,u8 ); +int ds_start_pulse (struct ds_device *,int ); +int ds_set_speed (struct ds_device *,int ); +int ds_reset (struct ds_device *,struct ds_status *); +int ds_detect (struct ds_device *,struct ds_status *); +int ds_stop_pulse (struct ds_device *,int ); +int ds_send_data (struct ds_device *,unsigned char *,int ); +int ds_recv_data (struct ds_device *,unsigned char *,int ); +int ds_recv_status (struct ds_device *,struct ds_status *); +struct ds_device *ds_get_device (void ); +void ds_put_device (struct ds_device *);static inline void ds_dump_status (unsigned char *,unsigned char *,int ); -static inline int ds_send_control (struct ds_device *,u16 ,u16 ); -static inline int ds_send_control_mode (struct ds_device *,u16 ,u16 ); -static inline int ds_send_control_cmd (struct ds_device *,u16 ,u16 ); +static int ds_send_control (struct ds_device *,u16 ,u16 ); +static int ds_send_control_mode (struct ds_device *,u16 ,u16 ); +static int ds_send_control_cmd (struct ds_device *,u16 ,u16 );static struct usb_driver ds_driver = {
@@ -503,7 +503,7 @@return 0 ; } -inline int ds_read_block (struct ds_device *dev,u8 *buf,int len) +int ds_read_block (struct ds_device *dev,u8 *buf,int len) {struct ds_status st;int err;
@@ -529,7 +529,7 @@return err; } -inline int ds_write_block (struct ds_device *dev,u8 *buf,int len) +int ds_write_block (struct ds_device *dev,u8 *buf,int len) {int err;struct ds_status st;
drivers/w1/dscore.h +17 -17
@@ -151,23 +151,23 @@ }; -inline int ds_touch_bit (struct ds_device *,u8 ,u8 *); -inline int ds_read_byte (struct ds_device *,u8 *); -inline int ds_read_bit (struct ds_device *,u8 *); -inline int ds_write_byte (struct ds_device *,u8 ); -inline int ds_write_bit (struct ds_device *,u8 ); -inline int ds_start_pulse (struct ds_device *,int ); -inline int ds_set_speed (struct ds_device *,int ); -inline int ds_reset (struct ds_device *,struct ds_status *); -inline int ds_detect (struct ds_device *,struct ds_status *); -inline int ds_stop_pulse (struct ds_device *,int ); -inline int ds_send_data (struct ds_device *,unsigned char *,int ); -inline int ds_recv_data (struct ds_device *,unsigned char *,int ); -inline int ds_recv_status (struct ds_device *,struct ds_status *); -inline struct ds_device *ds_get_device (void ); -inline void ds_put_device (struct ds_device *); -inline int ds_write_block (struct ds_device *,u8 *,int ); -inline int ds_read_block (struct ds_device *,u8 *,int ); +int ds_touch_bit (struct ds_device *,u8 ,u8 *); +int ds_read_byte (struct ds_device *,u8 *); +int ds_read_bit (struct ds_device *,u8 *); +int ds_write_byte (struct ds_device *,u8 ); +int ds_write_bit (struct ds_device *,u8 ); +int ds_start_pulse (struct ds_device *,int ); +int ds_set_speed (struct ds_device *,int ); +int ds_reset (struct ds_device *,struct ds_status *); +int ds_detect (struct ds_device *,struct ds_status *); +int ds_stop_pulse (struct ds_device *,int ); +int ds_send_data (struct ds_device *,unsigned char *,int ); +int ds_recv_data (struct ds_device *,unsigned char *,int ); +int ds_recv_status (struct ds_device *,struct ds_status *); +struct ds_device *ds_get_device (void ); +void ds_put_device (struct ds_device *); +int ds_write_block (struct ds_device *,u8 *,int ); +int ds_read_block (struct ds_device *,u8 *,int );#endif /* __DSCORE_H */
ChangeSet 1.2223.2.5, 2004/11/24 14:25:49-08:00, [email protected]
[PATCH] i2c-elektor: get rid of cli/sti
this patch get rid of cli()/sti(). while correcting this I found that when a process wakes by an interrupt, pcf_pending doesn't come back to 0 and next caller will return imediately. also, there are other drivers with the exact same problem. if you don't have any comments on this, I'll do the same for other drivers.
[I2C] i2c-elektor: getting rid of cli()/sti() usage
drivers/i2c/busses/i2c-elektor.c | 22 ++++++++++++++++++---- 1 files changed, 18 insertions(+), 4 deletions(-)
drivers/i2c/busses/i2c-elektor.c +18 -4
@@ -59,6 +59,7 @@static wait_queue_head_t pcf_wait;static int pcf_pending; +static spinlock_t lock;/* ----- local functions ---------------------------------------------- */
@@ -111,14 +112,24 @@static void pcf_isa_waitforpin (void ) {int timeout =2 ; +long flags;if (irq >0 ) { -cli (); +spin_lock_irqsave (&lock, flags);if (pcf_pending ==0 ) { -interruptible_sleep_on_timeout (&pcf_wait, timeout*HZ ); - }else +spin_unlock_irqrestore (&lock, flags); +if (interruptible_sleep_on_timeout (&pcf_wait, + timeout*HZ )) { +spin_lock_irqsave (&lock, flags); +if (pcf_pending ==1 ) { + pcf_pending =0 ; + } +spin_unlock_irqrestore (&lock, flags); + } + }else { pcf_pending =0 ; -sti (); +spin_unlock_irqrestore (&lock, flags); + } }else {udelay (100 ); }
@@ -126,7 +137,9 @@static irqreturn_t pcf_isa_handler (int this_irq,void *dev_id,struct pt_regs *regs) { +spin_lock (&lock); pcf_pending =1 ; +spin_unlock (&lock);wake_up_interruptible (&pcf_wait);return IRQ_HANDLED ; }
@@ -134,6 +147,7 @@static int pcf_isa_init (void ) { +spin_lock_init (&lock);if (!mmapped) {if (!request_region (base,2 ,"i2c (isa bus adapter)" )) { printk(KERN_ERR
ChangeSet 1.2223.2.6, 2004/11/24 14:26:15-08:00, [email protected]
[PATCH] [2/2] i2c-elektor: adding missing casts
[I2C] i2c-elektor: adding missing casts
drivers/i2c/busses/i2c-elektor.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/i2c/busses/i2c-elektor.c +3 -3
@@ -80,10 +80,10 @@break ;case 2 :/* double mapped I/O needed for UP2000 board, I don't know why this... */ -writeb (val, address); +writeb (val, (void *)address);/* fall */ case 1 :/* memory mapped I/O */ -writeb (val, address); +writeb (val, (void *)address);break ; } }
@@ -91,7 +91,7 @@static int pcf_isa_getbyte (void *data,int ctl) {int address = ctl ? (base +1 ) : base; -int val = mmapped ?readb (address) :inb (address); +int val = mmapped ?readb ((void *)address) :inb (address);pr_debug ("i2c-elektor: Read 0x%X 0x%02X\n" , address, val);
ChangeSet 1.2223.2.7, 2004/11/24 14:34:25-08:00, [email protected]
[PATCH] I2C: add adm1026 chip driver
Here is the revised adm1026 driver port for kernel 2.6.10-rc2. It takes into account Jean Delvare's and Mark Hoffman's comments and recommendations, and provides pretty much the entire feature set of the 2.4.X kernel driver, but in (hopefully) a manner compliant with the standards for the 2.6.X kernel lm_sensors drivers.
As discussed in previous messages, control over the pwm output is provided via:
pwm[1-3] {0-255}
pwm[1-3]_enable {0-2} (off, manual, automatic fan control)
Note that there is really only one pwm register and one enable bit. pwm[2-3] and pwm[2-3]_enable are provided for the sake of a chip-indpendent interface, and are simply RW mirrors of pwm1 and pwm1_enable, respectively.
Access to the DAC is provided via:
analog_out {0-2500} (millivolts)
No way is currently provided to turn on DAC-mediated automatic fan control. See my previous email in this thread for the reasons why.
Control over automatic fan "on" temperatures are provided by:
temp[1-3]_auto_point1_temp {-128000 - 127000}
Hardware-determined hysteresis and range values are revealed in:
temp[1-3]_auto_point1_temp_hyst {temp[1-3]_auto_point1_temp - 6000}
temp[1-3]_auto_point2_temp {temp[1-3]_auto_point1_temp + 20000}
Failsafe critical temperatures at which the fans go to maximum speed are controled via:
temp[1-3]_crit_enable {0-1} (off, on)
temp[1-3]_crit {-128000 - 127000}
Again, there is really only one "enable critical-temperature-fan-maximization" bit. temp[2-3]_crit_enable are simply RW mirrors of temp1_crit_enable
These values override any values set for the pwm-mediated automatic fan control.
VRM is now set via Rudolf Marek's functions. VID is read from the assumed correct set of pins (GPIO11-GPIO15), and no longer a user-writable field.
In keeping with Greg KH's changes,
normal_i2c_rangenormal_isa_range
have been removed,
and
normal_i2c
has been updated to enumerate all addresses. (Just adding 0x2d)
Finally, the val-comparison-before-assignment bug has been corrected.
drivers/i2c/chips/Kconfig | 9 drivers/i2c/chips/Makefile | 1 drivers/i2c/chips/adm1026.c | 1779 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 1789 insertions(+)
drivers/i2c/chips/Kconfig +9 -0
@@ -32,6 +32,15 @@ This driver can also be built as a module. If so, the module will be called adm1025. +config SENSORS_ADM1026 + tristate "Analog Devices ADM1026 and compatibles" + depends on I2C && EXPERIMENTAL + select I2C_SENSOR + help + If you say yes here you get support for Analog Devices ADM1026 + This driver can also be built as a module. If so, the module + will be called adm1026. + config SENSORS_ADM1031 tristate "Analog Devices ADM1031 and compatibles" depends on I2C && EXPERIMENTAL
drivers/i2c/chips/Makefile +1 -0
@@ -9,6 +9,7 @@ obj-$(CONFIG_SENSORS_ADM1021) += adm1021.o obj-$(CONFIG_SENSORS_ADM1025) += adm1025.o +obj-$(CONFIG_SENSORS_ADM1026) += adm1026.o obj-$(CONFIG_SENSORS_ADM1031) += adm1031.o obj-$(CONFIG_SENSORS_DS1621) += ds1621.o obj-$(CONFIG_SENSORS_EEPROM) += eeprom.o
drivers/i2c/chips/adm1026.c new file +1779 -0
1,779 lines not on this page · raw message
ChangeSet 1.2223.2.8, 2004/11/24 14:34:51-08:00, [email protected]
[PATCH] I2C: make fixup_fan_min static in adm1026 driver.
drivers/i2c/chips/adm1026.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/chips/adm1026.c +1 -1
@@ -914,7 +914,7 @@fan_offset (8 );/* Adjust fan_min to account for new fan divisor */ -void fixup_fan_min (struct device *dev,int fan,int old_div) +static void fixup_fan_min (struct device *dev,int fan,int old_div) {struct i2c_client *client =to_i2c_client (dev);struct adm1026_data *data =i2c_get_clientdata (client);
ChangeSet 1.2223.2.9, 2004/11/29 15:07:15-08:00, [email protected]
[PATCH] i2c-ite: get rid of cli()/sti()
I found only this one. Next time I'll try to make better grep expressions :^)
[I2C] i2c-ite: get rid of cli()/sti()
drivers/i2c/busses/i2c-ite.c | 31 +++++++++++++++++++++++-------- 1 files changed, 23 insertions(+), 8 deletions(-)
drivers/i2c/busses/i2c-ite.c +23 -8
@@ -62,6 +62,7 @@static struct iic_ite gpi;static wait_queue_head_t iic_wait;static int iic_pending; +static spinlock_t lock;/* ----- local functions ---------------------------------------------- */
@@ -108,6 +109,7 @@static void iic_ite_waitforpin (void ) {int timeout =2 ; +long flags;/* If interrupts are enabled (which they are), then put the process to * sleep. This process will be awakened by two events -- either the
@@ -116,24 +118,36 @@* of time and return. */ if (gpi.iic_irq >0 ) { -cli (); +spin_lock_irqsave (&lock, flags);if (iic_pending ==0 ) { -interruptible_sleep_on_timeout (&iic_wait, timeout*HZ ); - }else +spin_unlock_irqrestore (&lock, flags); +if (interruptible_sleep_on_timeout (&iic_wait, timeout*HZ )) { +spin_lock_irqsave (&lock, flags); +if (iic_pending ==1 ) { + iic_pending =0 ; + } +spin_unlock_irqrestore (&lock, flags); + } + }else { iic_pending =0 ; -sti (); +spin_unlock_irqrestore (&lock, flags); + } }else {udelay (100 ); } } -static void iic_ite_handler (int this_irq,void *dev_id,struct pt_regs *regs) +static irqreturn_t iic_ite_handler (int this_irq,void *dev_id, +struct pt_regs *regs) { - - iic_pending =1 ; +spin_lock (&lock); + iic_pending =1 ; +spin_unlock (&lock); + +wake_up_interruptible (&iic_wait); -wake_up_interruptible (&iic_wait); +return IRQ_HANDLED ; }
@@ -221,6 +235,7 @@ iic_ite_data.data = (void *)piic;init_waitqueue_head (&iic_wait); +spin_lock_init (&lock);if (iic_hw_resrc_init () ==0 ) {if (i2c_iic_add_bus (&iic_ite_ops) <0 )return -ENODEV ;
ChangeSet 1.2223.2.10, 2004/11/29 15:41:38-08:00, [email protected]
[PATCH] I2C: Add support for the nForce2 Ultra 400 to i2c-nforce2
This simple patch adds support for the nForce2 Ultra 400 to i2c-nforce2. I just made a similar update on the 2.4/CVS version of the driver.
drivers/i2c/busses/i2c-nforce2.c | 9 ++++++--- include/linux/pci_ids.h | 1 + 2 files changed, 7 insertions(+), 3 deletions(-)
drivers/i2c/busses/i2c-nforce2.c +6 -3
@@ -24,9 +24,10 @@*/ /* -SUPPORTED DEVICES PCI ID -nForce2 MCP 0064 -nForce3 Pro150 MCP 00D4 +SUPPORTED DEVICES PCI ID +nForce2 MCP 0064 +nForce2 Ultra 400 MCP 0084 +nForce3 Pro150 MCP 00D4 This driver supports the 2 SMBuses that are included in the MCP2 of the nForce2 chipset.
@@ -290,6 +291,8 @@static struct pci_device_id nforce2_ids[] = { {PCI_VENDOR_ID_NVIDIA ,PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS , +PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,0 }, + {PCI_VENDOR_ID_NVIDIA ,PCI_DEVICE_ID_NVIDIA_NFORCE2S_SMBUS ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,0 }, {PCI_VENDOR_ID_NVIDIA ,PCI_DEVICE_ID_NVIDIA_NFORCE3_SMBUS ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,0 },
include/linux/pci_ids.h +1 -0
@@ -1087,6 +1087,7 @@#define PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE 0x0065#define PCI_DEVICE_ID_NVIDIA_NVENET_2 0x0066#define PCI_DEVICE_ID_NVIDIA_MCP2_AUDIO 0x006a +#define PCI_DEVICE_ID_NVIDIA_NFORCE2S_SMBUS 0x0084#define PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE 0x0085#define PCI_DEVICE_ID_NVIDIA_NVENET_4 0x0086#define PCI_DEVICE_ID_NVIDIA_NVENET_5 0x008c
ChangeSet 1.2223.2.11, 2004/11/29 15:42:04-08:00, [email protected]
[PATCH] I2C: macintoch/therm_* drivers cleanups
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.
drivers/macintosh/therm_adt746x.c | 11 +++++------ drivers/macintosh/therm_pm72.c | 3 +-- drivers/macintosh/therm_windtunnel.c | 8 ++++---- 3 files changed, 10 insertions(+), 12 deletions(-)
drivers/macintosh/therm_adt746x.c +5 -6
@@ -170,11 +170,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)
@@ -381,7 +381,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 );
drivers/macintosh/therm_pm72.c +1 -2
@@ -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)) {
drivers/macintosh/therm_windtunnel.c +4 -4
@@ -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
ChangeSet 1.2223.2.12, 2004/11/30 15:23:40-08:00, [email protected]
[PATCH] W1: check nls in return path.
Check netlink socket being non NULL in error return path.
drivers/w1/w1_int.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/w1/w1_int.c +1 -1
@@ -96,7 +96,7 @@ err =device_register (&dev->dev);if (err) {printk (KERN_ERR "Failed to register master device. err=%d\n" , err); -if (dev->nls->sk_socket) +if (dev->nls && dev->nls->sk_socket)sock_release (dev->nls->sk_socket);memset (dev,0 ,sizeof (struct w1_master ));kfree (dev);