Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging

* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
i2c-parport: Fix adapter list handling
i2c-i801: Move device ID definitions to driver

+19 -17
+5
drivers/i2c/busses/i2c-i801.c
··· 134 134 SMBHSTSTS_BUS_ERR | SMBHSTSTS_DEV_ERR | \ 135 135 SMBHSTSTS_INTR) 136 136 137 + /* Older devices have their ID defined in <linux/pci_ids.h> */ 138 + #define PCI_DEVICE_ID_INTEL_COUGARPOINT_SMBUS 0x1c22 139 + #define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS 0x1d22 137 140 /* Patsburg also has three 'Integrated Device Function' SMBus controllers */ 138 141 #define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF0 0x1d70 139 142 #define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF1 0x1d71 140 143 #define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF2 0x1d72 144 + #define PCI_DEVICE_ID_INTEL_DH89XXCC_SMBUS 0x2330 145 + #define PCI_DEVICE_ID_INTEL_5_3400_SERIES_SMBUS 0x3b30 141 146 142 147 struct i801_priv { 143 148 struct i2c_adapter adapter;
+14 -13
drivers/i2c/busses/i2c-parport.c
··· 1 1 /* ------------------------------------------------------------------------ * 2 2 * i2c-parport.c I2C bus over parallel port * 3 3 * ------------------------------------------------------------------------ * 4 - Copyright (C) 2003-2010 Jean Delvare <khali@linux-fr.org> 4 + Copyright (C) 2003-2011 Jean Delvare <khali@linux-fr.org> 5 5 6 6 Based on older i2c-philips-par.c driver 7 7 Copyright (C) 1995-2000 Simon G. Vogl ··· 33 33 #include <linux/i2c-algo-bit.h> 34 34 #include <linux/i2c-smbus.h> 35 35 #include <linux/slab.h> 36 + #include <linux/list.h> 37 + #include <linux/mutex.h> 36 38 #include "i2c-parport.h" 37 39 38 40 /* ----- Device list ------------------------------------------------------ */ ··· 45 43 struct i2c_algo_bit_data algo_data; 46 44 struct i2c_smbus_alert_setup alert_data; 47 45 struct i2c_client *ara; 48 - struct i2c_par *next; 46 + struct list_head node; 49 47 }; 50 48 51 - static struct i2c_par *adapter_list; 49 + static LIST_HEAD(adapter_list); 50 + static DEFINE_MUTEX(adapter_list_lock); 52 51 53 52 /* ----- Low-level parallel port access ----------------------------------- */ 54 53 ··· 231 228 } 232 229 233 230 /* Add the new adapter to the list */ 234 - adapter->next = adapter_list; 235 - adapter_list = adapter; 231 + mutex_lock(&adapter_list_lock); 232 + list_add_tail(&adapter->node, &adapter_list); 233 + mutex_unlock(&adapter_list_lock); 236 234 return; 237 235 238 236 ERROR1: ··· 245 241 246 242 static void i2c_parport_detach (struct parport *port) 247 243 { 248 - struct i2c_par *adapter, *prev; 244 + struct i2c_par *adapter, *_n; 249 245 250 246 /* Walk the list */ 251 - for (prev = NULL, adapter = adapter_list; adapter; 252 - prev = adapter, adapter = adapter->next) { 247 + mutex_lock(&adapter_list_lock); 248 + list_for_each_entry_safe(adapter, _n, &adapter_list, node) { 253 249 if (adapter->pdev->port == port) { 254 250 if (adapter->ara) { 255 251 parport_disable_irq(port); ··· 263 259 264 260 parport_release(adapter->pdev); 265 261 parport_unregister_device(adapter->pdev); 266 - if (prev) 267 - prev->next = adapter->next; 268 - else 269 - adapter_list = adapter->next; 262 + list_del(&adapter->node); 270 263 kfree(adapter); 271 - return; 272 264 } 273 265 } 266 + mutex_unlock(&adapter_list_lock); 274 267 } 275 268 276 269 static struct parport_driver i2c_parport_driver = {
-4
include/linux/pci_ids.h
··· 2477 2477 #define PCI_DEVICE_ID_INTEL_82840_HB 0x1a21 2478 2478 #define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30 2479 2479 #define PCI_DEVICE_ID_INTEL_IOAT 0x1a38 2480 - #define PCI_DEVICE_ID_INTEL_COUGARPOINT_SMBUS 0x1c22 2481 2480 #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MIN 0x1c41 2482 2481 #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MAX 0x1c5f 2483 - #define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS 0x1d22 2484 2482 #define PCI_DEVICE_ID_INTEL_PATSBURG_LPC_0 0x1d40 2485 2483 #define PCI_DEVICE_ID_INTEL_PATSBURG_LPC_1 0x1d41 2486 2484 #define PCI_DEVICE_ID_INTEL_DH89XXCC_LPC_MIN 0x2310 2487 2485 #define PCI_DEVICE_ID_INTEL_DH89XXCC_LPC_MAX 0x231f 2488 - #define PCI_DEVICE_ID_INTEL_DH89XXCC_SMBUS 0x2330 2489 2486 #define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 2490 2487 #define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 2491 2488 #define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413 ··· 2693 2696 #define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60 2694 2697 #define PCI_DEVICE_ID_INTEL_5_3400_SERIES_LPC_MIN 0x3b00 2695 2698 #define PCI_DEVICE_ID_INTEL_5_3400_SERIES_LPC_MAX 0x3b1f 2696 - #define PCI_DEVICE_ID_INTEL_5_3400_SERIES_SMBUS 0x3b30 2697 2699 #define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f 2698 2700 #define PCI_DEVICE_ID_INTEL_5100_16 0x65f0 2699 2701 #define PCI_DEVICE_ID_INTEL_5100_21 0x65f5