diff options
Diffstat (limited to 'drivers/i2c/busses')
38 files changed, 83 insertions, 283 deletions
diff --git a/drivers/i2c/busses/i2c-ali1535.c b/drivers/i2c/busses/i2c-ali1535.c index b6807db7b36..e66d248fc12 100644 --- a/drivers/i2c/busses/i2c-ali1535.c +++ b/drivers/i2c/busses/i2c-ali1535.c | |||
@@ -132,7 +132,8 @@ | |||
132 | #define ALI1535_SMBIO_EN 0x04 /* SMB I/O Space enable */ | 132 | #define ALI1535_SMBIO_EN 0x04 /* SMB I/O Space enable */ |
133 | 133 | ||
134 | static struct pci_driver ali1535_driver; | 134 | static struct pci_driver ali1535_driver; |
135 | static unsigned short ali1535_smba; | 135 | static unsigned long ali1535_smba; |
136 | static unsigned short ali1535_offset; | ||
136 | 137 | ||
137 | /* Detect whether a ALI1535 can be found, and initialize it, where necessary. | 138 | /* Detect whether a ALI1535 can be found, and initialize it, where necessary. |
138 | Note the differences between kernels with the old PCI BIOS interface and | 139 | Note the differences between kernels with the old PCI BIOS interface and |
@@ -140,7 +141,7 @@ static unsigned short ali1535_smba; | |||
140 | defined to make the transition easier. */ | 141 | defined to make the transition easier. */ |
141 | static int __devinit ali1535_setup(struct pci_dev *dev) | 142 | static int __devinit ali1535_setup(struct pci_dev *dev) |
142 | { | 143 | { |
143 | int retval = -ENODEV; | 144 | int retval; |
144 | unsigned char temp; | 145 | unsigned char temp; |
145 | 146 | ||
146 | /* Check the following things: | 147 | /* Check the following things: |
@@ -149,15 +150,28 @@ static int __devinit ali1535_setup(struct pci_dev *dev) | |||
149 | - We can use the addresses | 150 | - We can use the addresses |
150 | */ | 151 | */ |
151 | 152 | ||
153 | retval = pci_enable_device(dev); | ||
154 | if (retval) { | ||
155 | dev_err(&dev->dev, "ALI1535_smb can't enable device\n"); | ||
156 | goto exit; | ||
157 | } | ||
158 | |||
152 | /* Determine the address of the SMBus area */ | 159 | /* Determine the address of the SMBus area */ |
153 | pci_read_config_word(dev, SMBBA, &ali1535_smba); | 160 | pci_read_config_word(dev, SMBBA, &ali1535_offset); |
154 | ali1535_smba &= (0xffff & ~(ALI1535_SMB_IOSIZE - 1)); | 161 | dev_dbg(&dev->dev, "ALI1535_smb is at offset 0x%04x\n", ali1535_offset); |
155 | if (ali1535_smba == 0) { | 162 | ali1535_offset &= (0xffff & ~(ALI1535_SMB_IOSIZE - 1)); |
163 | if (ali1535_offset == 0) { | ||
156 | dev_warn(&dev->dev, | 164 | dev_warn(&dev->dev, |
157 | "ALI1535_smb region uninitialized - upgrade BIOS?\n"); | 165 | "ALI1535_smb region uninitialized - upgrade BIOS?\n"); |
166 | retval = -ENODEV; | ||
158 | goto exit; | 167 | goto exit; |
159 | } | 168 | } |
160 | 169 | ||
170 | if (pci_resource_flags(dev, 0) & IORESOURCE_IO) | ||
171 | ali1535_smba = pci_resource_start(dev, 0) + ali1535_offset; | ||
172 | else | ||
173 | ali1535_smba = ali1535_offset; | ||
174 | |||
161 | retval = acpi_check_region(ali1535_smba, ALI1535_SMB_IOSIZE, | 175 | retval = acpi_check_region(ali1535_smba, ALI1535_SMB_IOSIZE, |
162 | ali1535_driver.name); | 176 | ali1535_driver.name); |
163 | if (retval) | 177 | if (retval) |
@@ -165,8 +179,9 @@ static int __devinit ali1535_setup(struct pci_dev *dev) | |||
165 | 179 | ||
166 | if (!request_region(ali1535_smba, ALI1535_SMB_IOSIZE, | 180 | if (!request_region(ali1535_smba, ALI1535_SMB_IOSIZE, |
167 | ali1535_driver.name)) { | 181 | ali1535_driver.name)) { |
168 | dev_err(&dev->dev, "ALI1535_smb region 0x%x already in use!\n", | 182 | dev_err(&dev->dev, "ALI1535_smb region 0x%lx already in use!\n", |
169 | ali1535_smba); | 183 | ali1535_smba); |
184 | retval = -EBUSY; | ||
170 | goto exit; | 185 | goto exit; |
171 | } | 186 | } |
172 | 187 | ||
@@ -174,6 +189,7 @@ static int __devinit ali1535_setup(struct pci_dev *dev) | |||
174 | pci_read_config_byte(dev, SMBCFG, &temp); | 189 | pci_read_config_byte(dev, SMBCFG, &temp); |
175 | if ((temp & ALI1535_SMBIO_EN) == 0) { | 190 | if ((temp & ALI1535_SMBIO_EN) == 0) { |
176 | dev_err(&dev->dev, "SMB device not enabled - upgrade BIOS?\n"); | 191 | dev_err(&dev->dev, "SMB device not enabled - upgrade BIOS?\n"); |
192 | retval = -ENODEV; | ||
177 | goto exit_free; | 193 | goto exit_free; |
178 | } | 194 | } |
179 | 195 | ||
@@ -181,6 +197,7 @@ static int __devinit ali1535_setup(struct pci_dev *dev) | |||
181 | pci_read_config_byte(dev, SMBHSTCFG, &temp); | 197 | pci_read_config_byte(dev, SMBHSTCFG, &temp); |
182 | if ((temp & 1) == 0) { | 198 | if ((temp & 1) == 0) { |
183 | dev_err(&dev->dev, "SMBus controller not enabled - upgrade BIOS?\n"); | 199 | dev_err(&dev->dev, "SMBus controller not enabled - upgrade BIOS?\n"); |
200 | retval = -ENODEV; | ||
184 | goto exit_free; | 201 | goto exit_free; |
185 | } | 202 | } |
186 | 203 | ||
@@ -196,14 +213,13 @@ static int __devinit ali1535_setup(struct pci_dev *dev) | |||
196 | */ | 213 | */ |
197 | pci_read_config_byte(dev, SMBREV, &temp); | 214 | pci_read_config_byte(dev, SMBREV, &temp); |
198 | dev_dbg(&dev->dev, "SMBREV = 0x%X\n", temp); | 215 | dev_dbg(&dev->dev, "SMBREV = 0x%X\n", temp); |
199 | dev_dbg(&dev->dev, "ALI1535_smba = 0x%X\n", ali1535_smba); | 216 | dev_dbg(&dev->dev, "ALI1535_smba = 0x%lx\n", ali1535_smba); |
200 | 217 | ||
201 | retval = 0; | 218 | return 0; |
202 | exit: | ||
203 | return retval; | ||
204 | 219 | ||
205 | exit_free: | 220 | exit_free: |
206 | release_region(ali1535_smba, ALI1535_SMB_IOSIZE); | 221 | release_region(ali1535_smba, ALI1535_SMB_IOSIZE); |
222 | exit: | ||
207 | return retval; | 223 | return retval; |
208 | } | 224 | } |
209 | 225 | ||
@@ -498,7 +514,7 @@ static int __devinit ali1535_probe(struct pci_dev *dev, const struct pci_device_ | |||
498 | ali1535_adapter.dev.parent = &dev->dev; | 514 | ali1535_adapter.dev.parent = &dev->dev; |
499 | 515 | ||
500 | snprintf(ali1535_adapter.name, sizeof(ali1535_adapter.name), | 516 | snprintf(ali1535_adapter.name, sizeof(ali1535_adapter.name), |
501 | "SMBus ALI1535 adapter at %04x", ali1535_smba); | 517 | "SMBus ALI1535 adapter at %04x", ali1535_offset); |
502 | return i2c_add_adapter(&ali1535_adapter); | 518 | return i2c_add_adapter(&ali1535_adapter); |
503 | } | 519 | } |
504 | 520 | ||
diff --git a/drivers/i2c/busses/i2c-ali1563.c b/drivers/i2c/busses/i2c-ali1563.c index a409cfcf062..47ae0091e02 100644 --- a/drivers/i2c/busses/i2c-ali1563.c +++ b/drivers/i2c/busses/i2c-ali1563.c | |||
@@ -417,7 +417,7 @@ static void __devexit ali1563_remove(struct pci_dev * dev) | |||
417 | ali1563_shutdown(dev); | 417 | ali1563_shutdown(dev); |
418 | } | 418 | } |
419 | 419 | ||
420 | static const struct pci_device_id ali1563_id_table[] __devinitconst = { | 420 | static DEFINE_PCI_DEVICE_TABLE(ali1563_id_table) = { |
421 | { PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1563) }, | 421 | { PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1563) }, |
422 | {}, | 422 | {}, |
423 | }; | 423 | }; |
diff --git a/drivers/i2c/busses/i2c-ali15x3.c b/drivers/i2c/busses/i2c-ali15x3.c index 83e8a60cdc8..087ea9caa74 100644 --- a/drivers/i2c/busses/i2c-ali15x3.c +++ b/drivers/i2c/busses/i2c-ali15x3.c | |||
@@ -477,7 +477,7 @@ static struct i2c_adapter ali15x3_adapter = { | |||
477 | .algo = &smbus_algorithm, | 477 | .algo = &smbus_algorithm, |
478 | }; | 478 | }; |
479 | 479 | ||
480 | static const struct pci_device_id ali15x3_ids[] = { | 480 | static DEFINE_PCI_DEVICE_TABLE(ali15x3_ids) = { |
481 | { PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101) }, | 481 | { PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101) }, |
482 | { 0, } | 482 | { 0, } |
483 | }; | 483 | }; |
diff --git a/drivers/i2c/busses/i2c-amd756.c b/drivers/i2c/busses/i2c-amd756.c index 03bcd07c469..eb778bf15c1 100644 --- a/drivers/i2c/busses/i2c-amd756.c +++ b/drivers/i2c/busses/i2c-amd756.c | |||
@@ -308,7 +308,7 @@ static const char* chipname[] = { | |||
308 | "nVidia nForce", "AMD8111", | 308 | "nVidia nForce", "AMD8111", |
309 | }; | 309 | }; |
310 | 310 | ||
311 | static const struct pci_device_id amd756_ids[] = { | 311 | static DEFINE_PCI_DEVICE_TABLE(amd756_ids) = { |
312 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_740B), | 312 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_740B), |
313 | .driver_data = AMD756 }, | 313 | .driver_data = AMD756 }, |
314 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7413), | 314 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7413), |
diff --git a/drivers/i2c/busses/i2c-amd8111.c b/drivers/i2c/busses/i2c-amd8111.c index 6b6a6b1d702..e5ac53b99b0 100644 --- a/drivers/i2c/busses/i2c-amd8111.c +++ b/drivers/i2c/busses/i2c-amd8111.c | |||
@@ -415,7 +415,7 @@ static const struct i2c_algorithm smbus_algorithm = { | |||
415 | }; | 415 | }; |
416 | 416 | ||
417 | 417 | ||
418 | static const struct pci_device_id amd8111_ids[] = { | 418 | static DEFINE_PCI_DEVICE_TABLE(amd8111_ids) = { |
419 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_SMBUS2) }, | 419 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_SMBUS2) }, |
420 | { 0, } | 420 | { 0, } |
421 | }; | 421 | }; |
diff --git a/drivers/i2c/busses/i2c-at91.c b/drivers/i2c/busses/i2c-at91.c index 305c07504f7..1679deef9c8 100644 --- a/drivers/i2c/busses/i2c-at91.c +++ b/drivers/i2c/busses/i2c-at91.c | |||
@@ -295,9 +295,6 @@ static int at91_i2c_resume(struct platform_device *pdev) | |||
295 | #define at91_i2c_resume NULL | 295 | #define at91_i2c_resume NULL |
296 | #endif | 296 | #endif |
297 | 297 | ||
298 | /* work with "modprobe at91_i2c" from hotplugging or coldplugging */ | ||
299 | MODULE_ALIAS("platform:at91_i2c"); | ||
300 | |||
301 | static struct platform_driver at91_i2c_driver = { | 298 | static struct platform_driver at91_i2c_driver = { |
302 | .probe = at91_i2c_probe, | 299 | .probe = at91_i2c_probe, |
303 | .remove = __devexit_p(at91_i2c_remove), | 300 | .remove = __devexit_p(at91_i2c_remove), |
@@ -309,19 +306,9 @@ static struct platform_driver at91_i2c_driver = { | |||
309 | }, | 306 | }, |
310 | }; | 307 | }; |
311 | 308 | ||
312 | static int __init at91_i2c_init(void) | 309 | module_platform_driver(at91_i2c_driver); |
313 | { | ||
314 | return platform_driver_register(&at91_i2c_driver); | ||
315 | } | ||
316 | |||
317 | static void __exit at91_i2c_exit(void) | ||
318 | { | ||
319 | platform_driver_unregister(&at91_i2c_driver); | ||
320 | } | ||
321 | |||
322 | module_init(at91_i2c_init); | ||
323 | module_exit(at91_i2c_exit); | ||
324 | 310 | ||
325 | MODULE_AUTHOR("Rick Bronson"); | 311 | MODULE_AUTHOR("Rick Bronson"); |
326 | MODULE_DESCRIPTION("I2C (TWI) driver for Atmel AT91"); | 312 | MODULE_DESCRIPTION("I2C (TWI) driver for Atmel AT91"); |
327 | MODULE_LICENSE("GPL"); | 313 | MODULE_LICENSE("GPL"); |
314 | MODULE_ALIAS("platform:at91_i2c"); | ||
diff --git a/drivers/i2c/busses/i2c-au1550.c b/drivers/i2c/busses/i2c-au1550.c index f314d7f433d..582d616db34 100644 --- a/drivers/i2c/busses/i2c-au1550.c +++ b/drivers/i2c/busses/i2c-au1550.c | |||
@@ -426,20 +426,9 @@ static struct platform_driver au1xpsc_smbus_driver = { | |||
426 | .remove = __devexit_p(i2c_au1550_remove), | 426 | .remove = __devexit_p(i2c_au1550_remove), |
427 | }; | 427 | }; |
428 | 428 | ||
429 | static int __init i2c_au1550_init(void) | 429 | module_platform_driver(au1xpsc_smbus_driver); |
430 | { | ||
431 | return platform_driver_register(&au1xpsc_smbus_driver); | ||
432 | } | ||
433 | |||
434 | static void __exit i2c_au1550_exit(void) | ||
435 | { | ||
436 | platform_driver_unregister(&au1xpsc_smbus_driver); | ||
437 | } | ||
438 | 430 | ||
439 | MODULE_AUTHOR("Dan Malek, Embedded Edge, LLC."); | 431 | MODULE_AUTHOR("Dan Malek, Embedded Edge, LLC."); |
440 | MODULE_DESCRIPTION("SMBus adapter Alchemy pb1550"); | 432 | MODULE_DESCRIPTION("SMBus adapter Alchemy pb1550"); |
441 | MODULE_LICENSE("GPL"); | 433 | MODULE_LICENSE("GPL"); |
442 | MODULE_ALIAS("platform:au1xpsc_smbus"); | 434 | MODULE_ALIAS("platform:au1xpsc_smbus"); |
443 | |||
444 | module_init (i2c_au1550_init); | ||
445 | module_exit (i2c_au1550_exit); | ||
diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c index b1d9cd28d8d..c1e1096ba06 100644 --- a/drivers/i2c/busses/i2c-cpm.c +++ b/drivers/i2c/busses/i2c-cpm.c | |||
@@ -724,18 +724,7 @@ static struct platform_driver cpm_i2c_driver = { | |||
724 | }, | 724 | }, |
725 | }; | 725 | }; |
726 | 726 | ||
727 | static int __init cpm_i2c_init(void) | 727 | module_platform_driver(cpm_i2c_driver); |
728 | { | ||
729 | return platform_driver_register(&cpm_i2c_driver); | ||
730 | } | ||
731 | |||
732 | static void __exit cpm_i2c_exit(void) | ||
733 | { | ||
734 | platform_driver_unregister(&cpm_i2c_driver); | ||
735 | } | ||
736 | |||
737 | module_init(cpm_i2c_init); | ||
738 | module_exit(cpm_i2c_exit); | ||
739 | 728 | ||
740 | MODULE_AUTHOR("Jochen Friedrich <jochen@scram.de>"); | 729 | MODULE_AUTHOR("Jochen Friedrich <jochen@scram.de>"); |
741 | MODULE_DESCRIPTION("I2C-Bus adapter routines for CPM boards"); | 730 | MODULE_DESCRIPTION("I2C-Bus adapter routines for CPM boards"); |
diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c index 9e89e7313d6..37f42113af3 100644 --- a/drivers/i2c/busses/i2c-designware-pcidrv.c +++ b/drivers/i2c/busses/i2c-designware-pcidrv.c | |||
@@ -349,7 +349,7 @@ static void __devexit i2c_dw_pci_remove(struct pci_dev *pdev) | |||
349 | /* work with hotplug and coldplug */ | 349 | /* work with hotplug and coldplug */ |
350 | MODULE_ALIAS("i2c_designware-pci"); | 350 | MODULE_ALIAS("i2c_designware-pci"); |
351 | 351 | ||
352 | DEFINE_PCI_DEVICE_TABLE(i2_designware_pci_ids) = { | 352 | static DEFINE_PCI_DEVICE_TABLE(i2_designware_pci_ids) = { |
353 | /* Moorestown */ | 353 | /* Moorestown */ |
354 | { PCI_VDEVICE(INTEL, 0x0802), moorestown_0 }, | 354 | { PCI_VDEVICE(INTEL, 0x0802), moorestown_0 }, |
355 | { PCI_VDEVICE(INTEL, 0x0803), moorestown_1 }, | 355 | { PCI_VDEVICE(INTEL, 0x0803), moorestown_1 }, |
diff --git a/drivers/i2c/busses/i2c-eg20t.c b/drivers/i2c/busses/i2c-eg20t.c index 18936ac9d51..3ef3557b6e3 100644 --- a/drivers/i2c/busses/i2c-eg20t.c +++ b/drivers/i2c/busses/i2c-eg20t.c | |||
@@ -185,7 +185,7 @@ static DEFINE_MUTEX(pch_mutex); | |||
185 | #define PCI_DEVICE_ID_ML7213_I2C 0x802D | 185 | #define PCI_DEVICE_ID_ML7213_I2C 0x802D |
186 | #define PCI_DEVICE_ID_ML7223_I2C 0x8010 | 186 | #define PCI_DEVICE_ID_ML7223_I2C 0x8010 |
187 | 187 | ||
188 | static struct pci_device_id __devinitdata pch_pcidev_id[] = { | 188 | static DEFINE_PCI_DEVICE_TABLE(pch_pcidev_id) = { |
189 | { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_PCH_I2C), 1, }, | 189 | { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_PCH_I2C), 1, }, |
190 | { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_I2C), 2, }, | 190 | { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_I2C), 2, }, |
191 | { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_I2C), 1, }, | 191 | { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_I2C), 1, }, |
diff --git a/drivers/i2c/busses/i2c-highlander.c b/drivers/i2c/busses/i2c-highlander.c index fa88868cb55..19515df6102 100644 --- a/drivers/i2c/busses/i2c-highlander.c +++ b/drivers/i2c/busses/i2c-highlander.c | |||
@@ -468,18 +468,7 @@ static struct platform_driver highlander_i2c_driver = { | |||
468 | .remove = __devexit_p(highlander_i2c_remove), | 468 | .remove = __devexit_p(highlander_i2c_remove), |
469 | }; | 469 | }; |
470 | 470 | ||
471 | static int __init highlander_i2c_init(void) | 471 | module_platform_driver(highlander_i2c_driver); |
472 | { | ||
473 | return platform_driver_register(&highlander_i2c_driver); | ||
474 | } | ||
475 | |||
476 | static void __exit highlander_i2c_exit(void) | ||
477 | { | ||
478 | platform_driver_unregister(&highlander_i2c_driver); | ||
479 | } | ||
480 | |||
481 | module_init(highlander_i2c_init); | ||
482 | module_exit(highlander_i2c_exit); | ||
483 | 472 | ||
484 | MODULE_AUTHOR("Paul Mundt"); | 473 | MODULE_AUTHOR("Paul Mundt"); |
485 | MODULE_DESCRIPTION("Renesas Highlander FPGA I2C/SMBus adapter"); | 474 | MODULE_DESCRIPTION("Renesas Highlander FPGA I2C/SMBus adapter"); |
diff --git a/drivers/i2c/busses/i2c-hydra.c b/drivers/i2c/busses/i2c-hydra.c index 9ff1695d845..c527de17db4 100644 --- a/drivers/i2c/busses/i2c-hydra.c +++ b/drivers/i2c/busses/i2c-hydra.c | |||
@@ -105,7 +105,7 @@ static struct i2c_adapter hydra_adap = { | |||
105 | .algo_data = &hydra_bit_data, | 105 | .algo_data = &hydra_bit_data, |
106 | }; | 106 | }; |
107 | 107 | ||
108 | static const struct pci_device_id hydra_ids[] = { | 108 | static DEFINE_PCI_DEVICE_TABLE(hydra_ids) = { |
109 | { PCI_DEVICE(PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_HYDRA) }, | 109 | { PCI_DEVICE(PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_HYDRA) }, |
110 | { 0, } | 110 | { 0, } |
111 | }; | 111 | }; |
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index ab26840d0c7..5d2e2816831 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c | |||
@@ -609,7 +609,7 @@ static const struct i2c_algorithm smbus_algorithm = { | |||
609 | .functionality = i801_func, | 609 | .functionality = i801_func, |
610 | }; | 610 | }; |
611 | 611 | ||
612 | static const struct pci_device_id i801_ids[] = { | 612 | static DEFINE_PCI_DEVICE_TABLE(i801_ids) = { |
613 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_3) }, | 613 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_3) }, |
614 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AB_3) }, | 614 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AB_3) }, |
615 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_2) }, | 615 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_2) }, |
diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c index c08ceb957aa..806e225f3de 100644 --- a/drivers/i2c/busses/i2c-ibm_iic.c +++ b/drivers/i2c/busses/i2c-ibm_iic.c | |||
@@ -815,15 +815,4 @@ static struct platform_driver ibm_iic_driver = { | |||
815 | .remove = __devexit_p(iic_remove), | 815 | .remove = __devexit_p(iic_remove), |
816 | }; | 816 | }; |
817 | 817 | ||
818 | static int __init iic_init(void) | 818 | module_platform_driver(ibm_iic_driver); |
819 | { | ||
820 | return platform_driver_register(&ibm_iic_driver); | ||
821 | } | ||
822 | |||
823 | static void __exit iic_exit(void) | ||
824 | { | ||
825 | platform_driver_unregister(&ibm_iic_driver); | ||
826 | } | ||
827 | |||
828 | module_init(iic_init); | ||
829 | module_exit(iic_exit); | ||
diff --git a/drivers/i2c/busses/i2c-intel-mid.c b/drivers/i2c/busses/i2c-intel-mid.c index e828ac85cfa..365bad5b890 100644 --- a/drivers/i2c/busses/i2c-intel-mid.c +++ b/drivers/i2c/busses/i2c-intel-mid.c | |||
@@ -1093,7 +1093,7 @@ static void __devexit intel_mid_i2c_remove(struct pci_dev *dev) | |||
1093 | pci_release_region(dev, 0); | 1093 | pci_release_region(dev, 0); |
1094 | } | 1094 | } |
1095 | 1095 | ||
1096 | static struct pci_device_id intel_mid_i2c_ids[] = { | 1096 | static DEFINE_PCI_DEVICE_TABLE(intel_mid_i2c_ids) = { |
1097 | /* Moorestown */ | 1097 | /* Moorestown */ |
1098 | { PCI_VDEVICE(INTEL, 0x0802), 0 }, | 1098 | { PCI_VDEVICE(INTEL, 0x0802), 0 }, |
1099 | { PCI_VDEVICE(INTEL, 0x0803), 1 }, | 1099 | { PCI_VDEVICE(INTEL, 0x0803), 1 }, |
diff --git a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c index f09c9319a2b..93f147a96b6 100644 --- a/drivers/i2c/busses/i2c-iop3xx.c +++ b/drivers/i2c/busses/i2c-iop3xx.c | |||
@@ -523,21 +523,7 @@ static struct platform_driver iop3xx_i2c_driver = { | |||
523 | }, | 523 | }, |
524 | }; | 524 | }; |
525 | 525 | ||
526 | static int __init | 526 | module_platform_driver(iop3xx_i2c_driver); |
527 | i2c_iop3xx_init (void) | ||
528 | { | ||
529 | return platform_driver_register(&iop3xx_i2c_driver); | ||
530 | } | ||
531 | |||
532 | static void __exit | ||
533 | i2c_iop3xx_exit (void) | ||
534 | { | ||
535 | platform_driver_unregister(&iop3xx_i2c_driver); | ||
536 | return; | ||
537 | } | ||
538 | |||
539 | module_init (i2c_iop3xx_init); | ||
540 | module_exit (i2c_iop3xx_exit); | ||
541 | 527 | ||
542 | MODULE_AUTHOR("D-TACQ Solutions Ltd <www.d-tacq.com>"); | 528 | MODULE_AUTHOR("D-TACQ Solutions Ltd <www.d-tacq.com>"); |
543 | MODULE_DESCRIPTION("IOP3xx iic algorithm and driver"); | 529 | MODULE_DESCRIPTION("IOP3xx iic algorithm and driver"); |
diff --git a/drivers/i2c/busses/i2c-isch.c b/drivers/i2c/busses/i2c-isch.c index 0682f8f277b..6561d275b8c 100644 --- a/drivers/i2c/busses/i2c-isch.c +++ b/drivers/i2c/busses/i2c-isch.c | |||
@@ -306,20 +306,9 @@ static struct platform_driver smbus_sch_driver = { | |||
306 | .remove = __devexit_p(smbus_sch_remove), | 306 | .remove = __devexit_p(smbus_sch_remove), |
307 | }; | 307 | }; |
308 | 308 | ||
309 | static int __init i2c_sch_init(void) | 309 | module_platform_driver(smbus_sch_driver); |
310 | { | ||
311 | return platform_driver_register(&smbus_sch_driver); | ||
312 | } | ||
313 | |||
314 | static void __exit i2c_sch_exit(void) | ||
315 | { | ||
316 | platform_driver_unregister(&smbus_sch_driver); | ||
317 | } | ||
318 | 310 | ||
319 | MODULE_AUTHOR("Jacob Pan <jacob.jun.pan@intel.com>"); | 311 | MODULE_AUTHOR("Jacob Pan <jacob.jun.pan@intel.com>"); |
320 | MODULE_DESCRIPTION("Intel SCH SMBus driver"); | 312 | MODULE_DESCRIPTION("Intel SCH SMBus driver"); |
321 | MODULE_LICENSE("GPL"); | 313 | MODULE_LICENSE("GPL"); |
322 | |||
323 | module_init(i2c_sch_init); | ||
324 | module_exit(i2c_sch_exit); | ||
325 | MODULE_ALIAS("platform:isch_smbus"); | 314 | MODULE_ALIAS("platform:isch_smbus"); |
diff --git a/drivers/i2c/busses/i2c-ixp2000.c b/drivers/i2c/busses/i2c-ixp2000.c index c01e9519f6c..5d263f9014d 100644 --- a/drivers/i2c/busses/i2c-ixp2000.c +++ b/drivers/i2c/busses/i2c-ixp2000.c | |||
@@ -148,18 +148,7 @@ static struct platform_driver ixp2000_i2c_driver = { | |||
148 | }, | 148 | }, |
149 | }; | 149 | }; |
150 | 150 | ||
151 | static int __init ixp2000_i2c_init(void) | 151 | module_platform_driver(ixp2000_i2c_driver); |
152 | { | ||
153 | return platform_driver_register(&ixp2000_i2c_driver); | ||
154 | } | ||
155 | |||
156 | static void __exit ixp2000_i2c_exit(void) | ||
157 | { | ||
158 | platform_driver_unregister(&ixp2000_i2c_driver); | ||
159 | } | ||
160 | |||
161 | module_init(ixp2000_i2c_init); | ||
162 | module_exit(ixp2000_i2c_exit); | ||
163 | 152 | ||
164 | MODULE_AUTHOR ("Deepak Saxena <dsaxena@plexity.net>"); | 153 | MODULE_AUTHOR ("Deepak Saxena <dsaxena@plexity.net>"); |
165 | MODULE_DESCRIPTION("IXP2000 GPIO-based I2C bus driver"); | 154 | MODULE_DESCRIPTION("IXP2000 GPIO-based I2C bus driver"); |
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c index 107397a606b..a8ebb84e23f 100644 --- a/drivers/i2c/busses/i2c-mpc.c +++ b/drivers/i2c/busses/i2c-mpc.c | |||
@@ -715,18 +715,7 @@ static struct platform_driver mpc_i2c_driver = { | |||
715 | }, | 715 | }, |
716 | }; | 716 | }; |
717 | 717 | ||
718 | static int __init fsl_i2c_init(void) | 718 | module_platform_driver(mpc_i2c_driver); |
719 | { | ||
720 | return platform_driver_register(&mpc_i2c_driver); | ||
721 | } | ||
722 | |||
723 | static void __exit fsl_i2c_exit(void) | ||
724 | { | ||
725 | platform_driver_unregister(&mpc_i2c_driver); | ||
726 | } | ||
727 | |||
728 | module_init(fsl_i2c_init); | ||
729 | module_exit(fsl_i2c_exit); | ||
730 | 719 | ||
731 | MODULE_AUTHOR("Adrian Cox <adrian@humboldt.co.uk>"); | 720 | MODULE_AUTHOR("Adrian Cox <adrian@humboldt.co.uk>"); |
732 | MODULE_DESCRIPTION("I2C-Bus adapter for MPC107 bridge and " | 721 | MODULE_DESCRIPTION("I2C-Bus adapter for MPC107 bridge and " |
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c index a9941c65f22..4f44a33017b 100644 --- a/drivers/i2c/busses/i2c-mv64xxx.c +++ b/drivers/i2c/busses/i2c-mv64xxx.c | |||
@@ -611,20 +611,7 @@ static struct platform_driver mv64xxx_i2c_driver = { | |||
611 | }, | 611 | }, |
612 | }; | 612 | }; |
613 | 613 | ||
614 | static int __init | 614 | module_platform_driver(mv64xxx_i2c_driver); |
615 | mv64xxx_i2c_init(void) | ||
616 | { | ||
617 | return platform_driver_register(&mv64xxx_i2c_driver); | ||
618 | } | ||
619 | |||
620 | static void __exit | ||
621 | mv64xxx_i2c_exit(void) | ||
622 | { | ||
623 | platform_driver_unregister(&mv64xxx_i2c_driver); | ||
624 | } | ||
625 | |||
626 | module_init(mv64xxx_i2c_init); | ||
627 | module_exit(mv64xxx_i2c_exit); | ||
628 | 615 | ||
629 | MODULE_AUTHOR("Mark A. Greer <mgreer@mvista.com>"); | 616 | MODULE_AUTHOR("Mark A. Greer <mgreer@mvista.com>"); |
630 | MODULE_DESCRIPTION("Marvell mv64xxx host bridge i2c ctlr driver"); | 617 | MODULE_DESCRIPTION("Marvell mv64xxx host bridge i2c ctlr driver"); |
diff --git a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c index ff1e127dfea..43a96a12392 100644 --- a/drivers/i2c/busses/i2c-nforce2.c +++ b/drivers/i2c/busses/i2c-nforce2.c | |||
@@ -309,7 +309,7 @@ static struct i2c_algorithm smbus_algorithm = { | |||
309 | }; | 309 | }; |
310 | 310 | ||
311 | 311 | ||
312 | static const struct pci_device_id nforce2_ids[] = { | 312 | static DEFINE_PCI_DEVICE_TABLE(nforce2_ids) = { |
313 | { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS) }, | 313 | { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS) }, |
314 | { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_SMBUS) }, | 314 | { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_SMBUS) }, |
315 | { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3_SMBUS) }, | 315 | { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3_SMBUS) }, |
@@ -356,7 +356,7 @@ static int __devinit nforce2_probe_smb (struct pci_dev *dev, int bar, | |||
356 | error = acpi_check_region(smbus->base, smbus->size, | 356 | error = acpi_check_region(smbus->base, smbus->size, |
357 | nforce2_driver.name); | 357 | nforce2_driver.name); |
358 | if (error) | 358 | if (error) |
359 | return -1; | 359 | return error; |
360 | 360 | ||
361 | if (!request_region(smbus->base, smbus->size, nforce2_driver.name)) { | 361 | if (!request_region(smbus->base, smbus->size, nforce2_driver.name)) { |
362 | dev_err(&smbus->adapter.dev, "Error requesting region %02x .. %02X for %s\n", | 362 | dev_err(&smbus->adapter.dev, "Error requesting region %02x .. %02X for %s\n", |
diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c index 1b46a9d9f90..18068dee48f 100644 --- a/drivers/i2c/busses/i2c-ocores.c +++ b/drivers/i2c/busses/i2c-ocores.c | |||
@@ -394,9 +394,6 @@ static struct of_device_id ocores_i2c_match[] = { | |||
394 | }; | 394 | }; |
395 | MODULE_DEVICE_TABLE(of, ocores_i2c_match); | 395 | MODULE_DEVICE_TABLE(of, ocores_i2c_match); |
396 | 396 | ||
397 | /* work with hotplug and coldplug */ | ||
398 | MODULE_ALIAS("platform:ocores-i2c"); | ||
399 | |||
400 | static struct platform_driver ocores_i2c_driver = { | 397 | static struct platform_driver ocores_i2c_driver = { |
401 | .probe = ocores_i2c_probe, | 398 | .probe = ocores_i2c_probe, |
402 | .remove = __devexit_p(ocores_i2c_remove), | 399 | .remove = __devexit_p(ocores_i2c_remove), |
@@ -409,19 +406,9 @@ static struct platform_driver ocores_i2c_driver = { | |||
409 | }, | 406 | }, |
410 | }; | 407 | }; |
411 | 408 | ||
412 | static int __init ocores_i2c_init(void) | 409 | module_platform_driver(ocores_i2c_driver); |
413 | { | ||
414 | return platform_driver_register(&ocores_i2c_driver); | ||
415 | } | ||
416 | |||
417 | static void __exit ocores_i2c_exit(void) | ||
418 | { | ||
419 | platform_driver_unregister(&ocores_i2c_driver); | ||
420 | } | ||
421 | |||
422 | module_init(ocores_i2c_init); | ||
423 | module_exit(ocores_i2c_exit); | ||
424 | 410 | ||
425 | MODULE_AUTHOR("Peter Korsgaard <jacmet@sunsite.dk>"); | 411 | MODULE_AUTHOR("Peter Korsgaard <jacmet@sunsite.dk>"); |
426 | MODULE_DESCRIPTION("OpenCores I2C bus driver"); | 412 | MODULE_DESCRIPTION("OpenCores I2C bus driver"); |
427 | MODULE_LICENSE("GPL"); | 413 | MODULE_LICENSE("GPL"); |
414 | MODULE_ALIAS("platform:ocores-i2c"); | ||
diff --git a/drivers/i2c/busses/i2c-octeon.c b/drivers/i2c/busses/i2c-octeon.c index 56dbe54e881..ee139a59881 100644 --- a/drivers/i2c/busses/i2c-octeon.c +++ b/drivers/i2c/busses/i2c-octeon.c | |||
@@ -629,24 +629,10 @@ static struct platform_driver octeon_i2c_driver = { | |||
629 | }, | 629 | }, |
630 | }; | 630 | }; |
631 | 631 | ||
632 | static int __init octeon_i2c_init(void) | 632 | module_platform_driver(octeon_i2c_driver); |
633 | { | ||
634 | int rv; | ||
635 | |||
636 | rv = platform_driver_register(&octeon_i2c_driver); | ||
637 | return rv; | ||
638 | } | ||
639 | |||
640 | static void __exit octeon_i2c_exit(void) | ||
641 | { | ||
642 | platform_driver_unregister(&octeon_i2c_driver); | ||
643 | } | ||
644 | 633 | ||
645 | MODULE_AUTHOR("Michael Lawnick <michael.lawnick.ext@nsn.com>"); | 634 | MODULE_AUTHOR("Michael Lawnick <michael.lawnick.ext@nsn.com>"); |
646 | MODULE_DESCRIPTION("I2C-Bus adapter for Cavium OCTEON processors"); | 635 | MODULE_DESCRIPTION("I2C-Bus adapter for Cavium OCTEON processors"); |
647 | MODULE_LICENSE("GPL"); | 636 | MODULE_LICENSE("GPL"); |
648 | MODULE_VERSION(DRV_VERSION); | 637 | MODULE_VERSION(DRV_VERSION); |
649 | MODULE_ALIAS("platform:" DRV_NAME); | 638 | MODULE_ALIAS("platform:" DRV_NAME); |
650 | |||
651 | module_init(octeon_i2c_init); | ||
652 | module_exit(octeon_i2c_exit); | ||
diff --git a/drivers/i2c/busses/i2c-pasemi.c b/drivers/i2c/busses/i2c-pasemi.c index 837b8c1aa02..eaaea73209c 100644 --- a/drivers/i2c/busses/i2c-pasemi.c +++ b/drivers/i2c/busses/i2c-pasemi.c | |||
@@ -401,7 +401,7 @@ static void __devexit pasemi_smb_remove(struct pci_dev *dev) | |||
401 | kfree(smbus); | 401 | kfree(smbus); |
402 | } | 402 | } |
403 | 403 | ||
404 | static const struct pci_device_id pasemi_smb_ids[] = { | 404 | static DEFINE_PCI_DEVICE_TABLE(pasemi_smb_ids) = { |
405 | { PCI_DEVICE(0x1959, 0xa003) }, | 405 | { PCI_DEVICE(0x1959, 0xa003) }, |
406 | { 0, } | 406 | { 0, } |
407 | }; | 407 | }; |
diff --git a/drivers/i2c/busses/i2c-pca-platform.c b/drivers/i2c/busses/i2c-pca-platform.c index ace67995d7d..2adbf1a8fde 100644 --- a/drivers/i2c/busses/i2c-pca-platform.c +++ b/drivers/i2c/busses/i2c-pca-platform.c | |||
@@ -286,20 +286,8 @@ static struct platform_driver i2c_pca_pf_driver = { | |||
286 | }, | 286 | }, |
287 | }; | 287 | }; |
288 | 288 | ||
289 | static int __init i2c_pca_pf_init(void) | 289 | module_platform_driver(i2c_pca_pf_driver); |
290 | { | ||
291 | return platform_driver_register(&i2c_pca_pf_driver); | ||
292 | } | ||
293 | |||
294 | static void __exit i2c_pca_pf_exit(void) | ||
295 | { | ||
296 | platform_driver_unregister(&i2c_pca_pf_driver); | ||
297 | } | ||
298 | 290 | ||
299 | MODULE_AUTHOR("Wolfram Sang <w.sang@pengutronix.de>"); | 291 | MODULE_AUTHOR("Wolfram Sang <w.sang@pengutronix.de>"); |
300 | MODULE_DESCRIPTION("I2C-PCA9564/PCA9665 platform driver"); | 292 | MODULE_DESCRIPTION("I2C-PCA9564/PCA9665 platform driver"); |
301 | MODULE_LICENSE("GPL"); | 293 | MODULE_LICENSE("GPL"); |
302 | |||
303 | module_init(i2c_pca_pf_init); | ||
304 | module_exit(i2c_pca_pf_exit); | ||
305 | |||
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c index 6d14ac2e3c4..c14d48dd601 100644 --- a/drivers/i2c/busses/i2c-piix4.c +++ b/drivers/i2c/busses/i2c-piix4.c | |||
@@ -472,7 +472,7 @@ static struct i2c_adapter piix4_adapter = { | |||
472 | .algo = &smbus_algorithm, | 472 | .algo = &smbus_algorithm, |
473 | }; | 473 | }; |
474 | 474 | ||
475 | static const struct pci_device_id piix4_ids[] = { | 475 | static DEFINE_PCI_DEVICE_TABLE(piix4_ids) = { |
476 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3) }, | 476 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3) }, |
477 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443MX_3) }, | 477 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443MX_3) }, |
478 | { PCI_DEVICE(PCI_VENDOR_ID_EFAR, PCI_DEVICE_ID_EFAR_SLC90E66_3) }, | 478 | { PCI_DEVICE(PCI_VENDOR_ID_EFAR, PCI_DEVICE_ID_EFAR_SLC90E66_3) }, |
diff --git a/drivers/i2c/busses/i2c-pmcmsp.c b/drivers/i2c/busses/i2c-pmcmsp.c index 127051b0692..07b7447ecbc 100644 --- a/drivers/i2c/busses/i2c-pmcmsp.c +++ b/drivers/i2c/busses/i2c-pmcmsp.c | |||
@@ -627,9 +627,6 @@ static struct i2c_adapter pmcmsptwi_adapter = { | |||
627 | .name = DRV_NAME, | 627 | .name = DRV_NAME, |
628 | }; | 628 | }; |
629 | 629 | ||
630 | /* work with hotplug and coldplug */ | ||
631 | MODULE_ALIAS("platform:" DRV_NAME); | ||
632 | |||
633 | static struct platform_driver pmcmsptwi_driver = { | 630 | static struct platform_driver pmcmsptwi_driver = { |
634 | .probe = pmcmsptwi_probe, | 631 | .probe = pmcmsptwi_probe, |
635 | .remove = __devexit_p(pmcmsptwi_remove), | 632 | .remove = __devexit_p(pmcmsptwi_remove), |
@@ -639,18 +636,8 @@ static struct platform_driver pmcmsptwi_driver = { | |||
639 | }, | 636 | }, |
640 | }; | 637 | }; |
641 | 638 | ||
642 | static int __init pmcmsptwi_init(void) | 639 | module_platform_driver(pmcmsptwi_driver); |
643 | { | ||
644 | return platform_driver_register(&pmcmsptwi_driver); | ||
645 | } | ||
646 | |||
647 | static void __exit pmcmsptwi_exit(void) | ||
648 | { | ||
649 | platform_driver_unregister(&pmcmsptwi_driver); | ||
650 | } | ||
651 | 640 | ||
652 | MODULE_DESCRIPTION("PMC MSP TWI/SMBus/I2C driver"); | 641 | MODULE_DESCRIPTION("PMC MSP TWI/SMBus/I2C driver"); |
653 | MODULE_LICENSE("GPL"); | 642 | MODULE_LICENSE("GPL"); |
654 | 643 | MODULE_ALIAS("platform:" DRV_NAME); | |
655 | module_init(pmcmsptwi_init); | ||
656 | module_exit(pmcmsptwi_exit); | ||
diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-powermac.c index b289ec99eeb..7b397c6f607 100644 --- a/drivers/i2c/busses/i2c-powermac.c +++ b/drivers/i2c/busses/i2c-powermac.c | |||
@@ -312,10 +312,6 @@ static int __devinit i2c_powermac_probe(struct platform_device *dev) | |||
312 | return rc; | 312 | return rc; |
313 | } | 313 | } |
314 | 314 | ||
315 | |||
316 | /* work with hotplug and coldplug */ | ||
317 | MODULE_ALIAS("platform:i2c-powermac"); | ||
318 | |||
319 | static struct platform_driver i2c_powermac_driver = { | 315 | static struct platform_driver i2c_powermac_driver = { |
320 | .probe = i2c_powermac_probe, | 316 | .probe = i2c_powermac_probe, |
321 | .remove = __devexit_p(i2c_powermac_remove), | 317 | .remove = __devexit_p(i2c_powermac_remove), |
@@ -325,17 +321,6 @@ static struct platform_driver i2c_powermac_driver = { | |||
325 | }, | 321 | }, |
326 | }; | 322 | }; |
327 | 323 | ||
328 | static int __init i2c_powermac_init(void) | 324 | module_platform_driver(i2c_powermac_driver); |
329 | { | ||
330 | platform_driver_register(&i2c_powermac_driver); | ||
331 | return 0; | ||
332 | } | ||
333 | 325 | ||
334 | 326 | MODULE_ALIAS("platform:i2c-powermac"); | |
335 | static void __exit i2c_powermac_cleanup(void) | ||
336 | { | ||
337 | platform_driver_unregister(&i2c_powermac_driver); | ||
338 | } | ||
339 | |||
340 | module_init(i2c_powermac_init); | ||
341 | module_exit(i2c_powermac_cleanup); | ||
diff --git a/drivers/i2c/busses/i2c-pxa-pci.c b/drivers/i2c/busses/i2c-pxa-pci.c index 632e088760a..a0581798055 100644 --- a/drivers/i2c/busses/i2c-pxa-pci.c +++ b/drivers/i2c/busses/i2c-pxa-pci.c | |||
@@ -150,7 +150,7 @@ static void __devexit ce4100_i2c_remove(struct pci_dev *dev) | |||
150 | kfree(sds); | 150 | kfree(sds); |
151 | } | 151 | } |
152 | 152 | ||
153 | static struct pci_device_id ce4100_i2c_devices[] __devinitdata = { | 153 | static DEFINE_PCI_DEVICE_TABLE(ce4100_i2c_devices) = { |
154 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x2e68)}, | 154 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x2e68)}, |
155 | { }, | 155 | { }, |
156 | }; | 156 | }; |
diff --git a/drivers/i2c/busses/i2c-sh7760.c b/drivers/i2c/busses/i2c-sh7760.c index a67132b2e09..c0c9dffbdb1 100644 --- a/drivers/i2c/busses/i2c-sh7760.c +++ b/drivers/i2c/busses/i2c-sh7760.c | |||
@@ -560,18 +560,7 @@ static struct platform_driver sh7760_i2c_drv = { | |||
560 | .remove = __devexit_p(sh7760_i2c_remove), | 560 | .remove = __devexit_p(sh7760_i2c_remove), |
561 | }; | 561 | }; |
562 | 562 | ||
563 | static int __init sh7760_i2c_init(void) | 563 | module_platform_driver(sh7760_i2c_drv); |
564 | { | ||
565 | return platform_driver_register(&sh7760_i2c_drv); | ||
566 | } | ||
567 | |||
568 | static void __exit sh7760_i2c_exit(void) | ||
569 | { | ||
570 | platform_driver_unregister(&sh7760_i2c_drv); | ||
571 | } | ||
572 | |||
573 | module_init(sh7760_i2c_init); | ||
574 | module_exit(sh7760_i2c_exit); | ||
575 | 564 | ||
576 | MODULE_LICENSE("GPL"); | 565 | MODULE_LICENSE("GPL"); |
577 | MODULE_DESCRIPTION("SH7760 I2C bus driver"); | 566 | MODULE_DESCRIPTION("SH7760 I2C bus driver"); |
diff --git a/drivers/i2c/busses/i2c-simtec.c b/drivers/i2c/busses/i2c-simtec.c index 2fc08fbf67a..4fc87e7c94c 100644 --- a/drivers/i2c/busses/i2c-simtec.c +++ b/drivers/i2c/busses/i2c-simtec.c | |||
@@ -156,12 +156,8 @@ static int simtec_i2c_remove(struct platform_device *dev) | |||
156 | return 0; | 156 | return 0; |
157 | } | 157 | } |
158 | 158 | ||
159 | |||
160 | /* device driver */ | 159 | /* device driver */ |
161 | 160 | ||
162 | /* work with hotplug and coldplug */ | ||
163 | MODULE_ALIAS("platform:simtec-i2c"); | ||
164 | |||
165 | static struct platform_driver simtec_i2c_driver = { | 161 | static struct platform_driver simtec_i2c_driver = { |
166 | .driver = { | 162 | .driver = { |
167 | .name = "simtec-i2c", | 163 | .name = "simtec-i2c", |
@@ -171,19 +167,9 @@ static struct platform_driver simtec_i2c_driver = { | |||
171 | .remove = simtec_i2c_remove, | 167 | .remove = simtec_i2c_remove, |
172 | }; | 168 | }; |
173 | 169 | ||
174 | static int __init i2c_adap_simtec_init(void) | 170 | module_platform_driver(simtec_i2c_driver); |
175 | { | ||
176 | return platform_driver_register(&simtec_i2c_driver); | ||
177 | } | ||
178 | |||
179 | static void __exit i2c_adap_simtec_exit(void) | ||
180 | { | ||
181 | platform_driver_unregister(&simtec_i2c_driver); | ||
182 | } | ||
183 | |||
184 | module_init(i2c_adap_simtec_init); | ||
185 | module_exit(i2c_adap_simtec_exit); | ||
186 | 171 | ||
187 | MODULE_DESCRIPTION("Simtec Generic I2C Bus driver"); | 172 | MODULE_DESCRIPTION("Simtec Generic I2C Bus driver"); |
188 | MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); | 173 | MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); |
189 | MODULE_LICENSE("GPL"); | 174 | MODULE_LICENSE("GPL"); |
175 | MODULE_ALIAS("platform:simtec-i2c"); | ||
diff --git a/drivers/i2c/busses/i2c-sis5595.c b/drivers/i2c/busses/i2c-sis5595.c index 437586611d4..87e5126d449 100644 --- a/drivers/i2c/busses/i2c-sis5595.c +++ b/drivers/i2c/busses/i2c-sis5595.c | |||
@@ -147,7 +147,7 @@ static int __devinit sis5595_setup(struct pci_dev *SIS5595_dev) | |||
147 | u16 a; | 147 | u16 a; |
148 | u8 val; | 148 | u8 val; |
149 | int *i; | 149 | int *i; |
150 | int retval = -ENODEV; | 150 | int retval; |
151 | 151 | ||
152 | /* Look for imposters */ | 152 | /* Look for imposters */ |
153 | for (i = blacklist; *i != 0; i++) { | 153 | for (i = blacklist; *i != 0; i++) { |
@@ -223,7 +223,7 @@ static int __devinit sis5595_setup(struct pci_dev *SIS5595_dev) | |||
223 | 223 | ||
224 | error: | 224 | error: |
225 | release_region(sis5595_base + SMB_INDEX, 2); | 225 | release_region(sis5595_base + SMB_INDEX, 2); |
226 | return retval; | 226 | return -ENODEV; |
227 | } | 227 | } |
228 | 228 | ||
229 | static int sis5595_transaction(struct i2c_adapter *adap) | 229 | static int sis5595_transaction(struct i2c_adapter *adap) |
@@ -369,7 +369,7 @@ static struct i2c_adapter sis5595_adapter = { | |||
369 | .algo = &smbus_algorithm, | 369 | .algo = &smbus_algorithm, |
370 | }; | 370 | }; |
371 | 371 | ||
372 | static const struct pci_device_id sis5595_ids[] __devinitconst = { | 372 | static DEFINE_PCI_DEVICE_TABLE(sis5595_ids) = { |
373 | { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503) }, | 373 | { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503) }, |
374 | { 0, } | 374 | { 0, } |
375 | }; | 375 | }; |
diff --git a/drivers/i2c/busses/i2c-sis630.c b/drivers/i2c/busses/i2c-sis630.c index 58893772c3d..15cf78f65ce 100644 --- a/drivers/i2c/busses/i2c-sis630.c +++ b/drivers/i2c/busses/i2c-sis630.c | |||
@@ -393,7 +393,7 @@ static int __devinit sis630_setup(struct pci_dev *sis630_dev) | |||
393 | { | 393 | { |
394 | unsigned char b; | 394 | unsigned char b; |
395 | struct pci_dev *dummy = NULL; | 395 | struct pci_dev *dummy = NULL; |
396 | int retval = -ENODEV, i; | 396 | int retval, i; |
397 | 397 | ||
398 | /* check for supported SiS devices */ | 398 | /* check for supported SiS devices */ |
399 | for (i=0; supported[i] > 0 ; i++) { | 399 | for (i=0; supported[i] > 0 ; i++) { |
@@ -418,18 +418,21 @@ static int __devinit sis630_setup(struct pci_dev *sis630_dev) | |||
418 | */ | 418 | */ |
419 | if (pci_read_config_byte(sis630_dev, SIS630_BIOS_CTL_REG,&b)) { | 419 | if (pci_read_config_byte(sis630_dev, SIS630_BIOS_CTL_REG,&b)) { |
420 | dev_err(&sis630_dev->dev, "Error: Can't read bios ctl reg\n"); | 420 | dev_err(&sis630_dev->dev, "Error: Can't read bios ctl reg\n"); |
421 | retval = -ENODEV; | ||
421 | goto exit; | 422 | goto exit; |
422 | } | 423 | } |
423 | /* if ACPI already enabled , do nothing */ | 424 | /* if ACPI already enabled , do nothing */ |
424 | if (!(b & 0x80) && | 425 | if (!(b & 0x80) && |
425 | pci_write_config_byte(sis630_dev, SIS630_BIOS_CTL_REG, b | 0x80)) { | 426 | pci_write_config_byte(sis630_dev, SIS630_BIOS_CTL_REG, b | 0x80)) { |
426 | dev_err(&sis630_dev->dev, "Error: Can't enable ACPI\n"); | 427 | dev_err(&sis630_dev->dev, "Error: Can't enable ACPI\n"); |
428 | retval = -ENODEV; | ||
427 | goto exit; | 429 | goto exit; |
428 | } | 430 | } |
429 | 431 | ||
430 | /* Determine the ACPI base address */ | 432 | /* Determine the ACPI base address */ |
431 | if (pci_read_config_word(sis630_dev,SIS630_ACPI_BASE_REG,&acpi_base)) { | 433 | if (pci_read_config_word(sis630_dev,SIS630_ACPI_BASE_REG,&acpi_base)) { |
432 | dev_err(&sis630_dev->dev, "Error: Can't determine ACPI base address\n"); | 434 | dev_err(&sis630_dev->dev, "Error: Can't determine ACPI base address\n"); |
435 | retval = -ENODEV; | ||
433 | goto exit; | 436 | goto exit; |
434 | } | 437 | } |
435 | 438 | ||
@@ -445,6 +448,7 @@ static int __devinit sis630_setup(struct pci_dev *sis630_dev) | |||
445 | sis630_driver.name)) { | 448 | sis630_driver.name)) { |
446 | dev_err(&sis630_dev->dev, "SMBus registers 0x%04x-0x%04x already " | 449 | dev_err(&sis630_dev->dev, "SMBus registers 0x%04x-0x%04x already " |
447 | "in use!\n", acpi_base + SMB_STS, acpi_base + SMB_SAA); | 450 | "in use!\n", acpi_base + SMB_STS, acpi_base + SMB_SAA); |
451 | retval = -EBUSY; | ||
448 | goto exit; | 452 | goto exit; |
449 | } | 453 | } |
450 | 454 | ||
@@ -468,7 +472,7 @@ static struct i2c_adapter sis630_adapter = { | |||
468 | .algo = &smbus_algorithm, | 472 | .algo = &smbus_algorithm, |
469 | }; | 473 | }; |
470 | 474 | ||
471 | static const struct pci_device_id sis630_ids[] __devinitconst = { | 475 | static DEFINE_PCI_DEVICE_TABLE(sis630_ids) = { |
472 | { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503) }, | 476 | { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503) }, |
473 | { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_LPC) }, | 477 | { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_LPC) }, |
474 | { 0, } | 478 | { 0, } |
diff --git a/drivers/i2c/busses/i2c-sis96x.c b/drivers/i2c/busses/i2c-sis96x.c index 86837f0c4cb..cc5d149413f 100644 --- a/drivers/i2c/busses/i2c-sis96x.c +++ b/drivers/i2c/busses/i2c-sis96x.c | |||
@@ -245,7 +245,7 @@ static struct i2c_adapter sis96x_adapter = { | |||
245 | .algo = &smbus_algorithm, | 245 | .algo = &smbus_algorithm, |
246 | }; | 246 | }; |
247 | 247 | ||
248 | static const struct pci_device_id sis96x_ids[] = { | 248 | static DEFINE_PCI_DEVICE_TABLE(sis96x_ids) = { |
249 | { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_SMBUS) }, | 249 | { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_SMBUS) }, |
250 | { 0, } | 250 | { 0, } |
251 | }; | 251 | }; |
diff --git a/drivers/i2c/busses/i2c-via.c b/drivers/i2c/busses/i2c-via.c index 7799fe5bda8..713d31ade26 100644 --- a/drivers/i2c/busses/i2c-via.c +++ b/drivers/i2c/busses/i2c-via.c | |||
@@ -89,7 +89,7 @@ static struct i2c_adapter vt586b_adapter = { | |||
89 | }; | 89 | }; |
90 | 90 | ||
91 | 91 | ||
92 | static const struct pci_device_id vt586b_ids[] __devinitconst = { | 92 | static DEFINE_PCI_DEVICE_TABLE(vt586b_ids) = { |
93 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3) }, | 93 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3) }, |
94 | { 0, } | 94 | { 0, } |
95 | }; | 95 | }; |
diff --git a/drivers/i2c/busses/i2c-viapro.c b/drivers/i2c/busses/i2c-viapro.c index 2a62c998044..333011c83d5 100644 --- a/drivers/i2c/busses/i2c-viapro.c +++ b/drivers/i2c/busses/i2c-viapro.c | |||
@@ -324,7 +324,7 @@ static int __devinit vt596_probe(struct pci_dev *pdev, | |||
324 | const struct pci_device_id *id) | 324 | const struct pci_device_id *id) |
325 | { | 325 | { |
326 | unsigned char temp; | 326 | unsigned char temp; |
327 | int error = -ENODEV; | 327 | int error; |
328 | 328 | ||
329 | /* Determine the address of the SMBus areas */ | 329 | /* Determine the address of the SMBus areas */ |
330 | if (force_addr) { | 330 | if (force_addr) { |
@@ -390,6 +390,7 @@ found: | |||
390 | dev_err(&pdev->dev, "SMBUS: Error: Host SMBus " | 390 | dev_err(&pdev->dev, "SMBUS: Error: Host SMBus " |
391 | "controller not enabled! - upgrade BIOS or " | 391 | "controller not enabled! - upgrade BIOS or " |
392 | "use force=1\n"); | 392 | "use force=1\n"); |
393 | error = -ENODEV; | ||
393 | goto release_region; | 394 | goto release_region; |
394 | } | 395 | } |
395 | } | 396 | } |
@@ -422,9 +423,11 @@ found: | |||
422 | "SMBus Via Pro adapter at %04x", vt596_smba); | 423 | "SMBus Via Pro adapter at %04x", vt596_smba); |
423 | 424 | ||
424 | vt596_pdev = pci_dev_get(pdev); | 425 | vt596_pdev = pci_dev_get(pdev); |
425 | if (i2c_add_adapter(&vt596_adapter)) { | 426 | error = i2c_add_adapter(&vt596_adapter); |
427 | if (error) { | ||
426 | pci_dev_put(vt596_pdev); | 428 | pci_dev_put(vt596_pdev); |
427 | vt596_pdev = NULL; | 429 | vt596_pdev = NULL; |
430 | goto release_region; | ||
428 | } | 431 | } |
429 | 432 | ||
430 | /* Always return failure here. This is to allow other drivers to bind | 433 | /* Always return failure here. This is to allow other drivers to bind |
@@ -438,7 +441,7 @@ release_region: | |||
438 | return error; | 441 | return error; |
439 | } | 442 | } |
440 | 443 | ||
441 | static const struct pci_device_id vt596_ids[] = { | 444 | static DEFINE_PCI_DEVICE_TABLE(vt596_ids) = { |
442 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C596_3), | 445 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C596_3), |
443 | .driver_data = SMBBA1 }, | 446 | .driver_data = SMBBA1 }, |
444 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C596B_3), | 447 | { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C596B_3), |
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index ac083a28ae0..2bded7647ef 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c | |||
@@ -795,10 +795,6 @@ static int __devexit xiic_i2c_remove(struct platform_device* pdev) | |||
795 | return 0; | 795 | return 0; |
796 | } | 796 | } |
797 | 797 | ||
798 | |||
799 | /* work with hotplug and coldplug */ | ||
800 | MODULE_ALIAS("platform:"DRIVER_NAME); | ||
801 | |||
802 | static struct platform_driver xiic_i2c_driver = { | 798 | static struct platform_driver xiic_i2c_driver = { |
803 | .probe = xiic_i2c_probe, | 799 | .probe = xiic_i2c_probe, |
804 | .remove = __devexit_p(xiic_i2c_remove), | 800 | .remove = __devexit_p(xiic_i2c_remove), |
@@ -808,19 +804,9 @@ static struct platform_driver xiic_i2c_driver = { | |||
808 | }, | 804 | }, |
809 | }; | 805 | }; |
810 | 806 | ||
811 | static int __init xiic_i2c_init(void) | 807 | module_platform_driver(xiic_i2c_driver); |
812 | { | ||
813 | return platform_driver_register(&xiic_i2c_driver); | ||
814 | } | ||
815 | |||
816 | static void __exit xiic_i2c_exit(void) | ||
817 | { | ||
818 | platform_driver_unregister(&xiic_i2c_driver); | ||
819 | } | ||
820 | |||
821 | module_init(xiic_i2c_init); | ||
822 | module_exit(xiic_i2c_exit); | ||
823 | 808 | ||
824 | MODULE_AUTHOR("info@mocean-labs.com"); | 809 | MODULE_AUTHOR("info@mocean-labs.com"); |
825 | MODULE_DESCRIPTION("Xilinx I2C bus driver"); | 810 | MODULE_DESCRIPTION("Xilinx I2C bus driver"); |
826 | MODULE_LICENSE("GPL v2"); | 811 | MODULE_LICENSE("GPL v2"); |
812 | MODULE_ALIAS("platform:"DRIVER_NAME); | ||
diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c index 91e349c884c..2eacb7784d5 100644 --- a/drivers/i2c/busses/scx200_acb.c +++ b/drivers/i2c/busses/scx200_acb.c | |||
@@ -559,7 +559,7 @@ static struct platform_driver scx200_pci_driver = { | |||
559 | .remove = __devexit_p(scx200_remove), | 559 | .remove = __devexit_p(scx200_remove), |
560 | }; | 560 | }; |
561 | 561 | ||
562 | static const struct pci_device_id scx200_isa[] __initconst = { | 562 | static DEFINE_PCI_DEVICE_TABLE(scx200_isa) = { |
563 | { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_SCx200_BRIDGE) }, | 563 | { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_SCx200_BRIDGE) }, |
564 | { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_SC1100_BRIDGE) }, | 564 | { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_SC1100_BRIDGE) }, |
565 | { 0, } | 565 | { 0, } |