diff options
Diffstat (limited to 'drivers/i2c')
47 files changed, 138 insertions, 372 deletions
diff --git a/drivers/i2c/busses/i2c-ali1535.c b/drivers/i2c/busses/i2c-ali1535.c index b6807db7b36f..e66d248fc126 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 a409cfcf0629..47ae0091e027 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 83e8a60cdc86..087ea9caa74d 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 03bcd07c4697..eb778bf15c18 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 6b6a6b1d7025..e5ac53b99b04 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 305c07504f7e..1679deef9c89 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 f314d7f433d3..582d616db346 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 b1d9cd28d8da..c1e1096ba069 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 9e89e7313d62..37f42113af31 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-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index 2d3657ab1258..5244c4724df7 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/sched.h> | 34 | #include <linux/sched.h> |
35 | #include <linux/err.h> | 35 | #include <linux/err.h> |
36 | #include <linux/interrupt.h> | 36 | #include <linux/interrupt.h> |
37 | #include <linux/of_i2c.h> | ||
37 | #include <linux/platform_device.h> | 38 | #include <linux/platform_device.h> |
38 | #include <linux/io.h> | 39 | #include <linux/io.h> |
39 | #include <linux/slab.h> | 40 | #include <linux/slab.h> |
@@ -137,6 +138,7 @@ static int __devinit dw_i2c_probe(struct platform_device *pdev) | |||
137 | sizeof(adap->name)); | 138 | sizeof(adap->name)); |
138 | adap->algo = &i2c_dw_algo; | 139 | adap->algo = &i2c_dw_algo; |
139 | adap->dev.parent = &pdev->dev; | 140 | adap->dev.parent = &pdev->dev; |
141 | adap->dev.of_node = pdev->dev.of_node; | ||
140 | 142 | ||
141 | adap->nr = pdev->id; | 143 | adap->nr = pdev->id; |
142 | r = i2c_add_numbered_adapter(adap); | 144 | r = i2c_add_numbered_adapter(adap); |
@@ -144,6 +146,7 @@ static int __devinit dw_i2c_probe(struct platform_device *pdev) | |||
144 | dev_err(&pdev->dev, "failure adding adapter\n"); | 146 | dev_err(&pdev->dev, "failure adding adapter\n"); |
145 | goto err_free_irq; | 147 | goto err_free_irq; |
146 | } | 148 | } |
149 | of_i2c_register_devices(adap); | ||
147 | 150 | ||
148 | return 0; | 151 | return 0; |
149 | 152 | ||
@@ -187,6 +190,14 @@ static int __devexit dw_i2c_remove(struct platform_device *pdev) | |||
187 | return 0; | 190 | return 0; |
188 | } | 191 | } |
189 | 192 | ||
193 | #ifdef CONFIG_OF | ||
194 | static const struct of_device_id dw_i2c_of_match[] = { | ||
195 | { .compatible = "snps,designware-i2c", }, | ||
196 | {}, | ||
197 | }; | ||
198 | MODULE_DEVICE_TABLE(of, dw_i2c_of_match); | ||
199 | #endif | ||
200 | |||
190 | /* work with hotplug and coldplug */ | 201 | /* work with hotplug and coldplug */ |
191 | MODULE_ALIAS("platform:i2c_designware"); | 202 | MODULE_ALIAS("platform:i2c_designware"); |
192 | 203 | ||
@@ -195,6 +206,7 @@ static struct platform_driver dw_i2c_driver = { | |||
195 | .driver = { | 206 | .driver = { |
196 | .name = "i2c_designware", | 207 | .name = "i2c_designware", |
197 | .owner = THIS_MODULE, | 208 | .owner = THIS_MODULE, |
209 | .of_match_table = of_match_ptr(dw_i2c_of_match), | ||
198 | }, | 210 | }, |
199 | }; | 211 | }; |
200 | 212 | ||
diff --git a/drivers/i2c/busses/i2c-diolan-u2c.c b/drivers/i2c/busses/i2c-diolan-u2c.c index 76366716a854..7eb19a5222f2 100644 --- a/drivers/i2c/busses/i2c-diolan-u2c.c +++ b/drivers/i2c/busses/i2c-diolan-u2c.c | |||
@@ -515,20 +515,7 @@ static struct usb_driver diolan_u2c_driver = { | |||
515 | .id_table = diolan_u2c_table, | 515 | .id_table = diolan_u2c_table, |
516 | }; | 516 | }; |
517 | 517 | ||
518 | static int __init diolan_u2c_init(void) | 518 | module_usb_driver(diolan_u2c_driver); |
519 | { | ||
520 | /* register this driver with the USB subsystem */ | ||
521 | return usb_register(&diolan_u2c_driver); | ||
522 | } | ||
523 | |||
524 | static void __exit diolan_u2c_exit(void) | ||
525 | { | ||
526 | /* deregister this driver with the USB subsystem */ | ||
527 | usb_deregister(&diolan_u2c_driver); | ||
528 | } | ||
529 | |||
530 | module_init(diolan_u2c_init); | ||
531 | module_exit(diolan_u2c_exit); | ||
532 | 519 | ||
533 | MODULE_AUTHOR("Guenter Roeck <guenter.roeck@ericsson.com>"); | 520 | MODULE_AUTHOR("Guenter Roeck <guenter.roeck@ericsson.com>"); |
534 | MODULE_DESCRIPTION(DRIVER_NAME " driver"); | 521 | MODULE_DESCRIPTION(DRIVER_NAME " driver"); |
diff --git a/drivers/i2c/busses/i2c-eg20t.c b/drivers/i2c/busses/i2c-eg20t.c index 8cebef49aeac..3ef3557b6e32 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, }, |
@@ -893,6 +893,13 @@ static int __devinit pch_i2c_probe(struct pci_dev *pdev, | |||
893 | /* Set the number of I2C channel instance */ | 893 | /* Set the number of I2C channel instance */ |
894 | adap_info->ch_num = id->driver_data; | 894 | adap_info->ch_num = id->driver_data; |
895 | 895 | ||
896 | ret = request_irq(pdev->irq, pch_i2c_handler, IRQF_SHARED, | ||
897 | KBUILD_MODNAME, adap_info); | ||
898 | if (ret) { | ||
899 | pch_pci_err(pdev, "request_irq FAILED\n"); | ||
900 | goto err_request_irq; | ||
901 | } | ||
902 | |||
896 | for (i = 0; i < adap_info->ch_num; i++) { | 903 | for (i = 0; i < adap_info->ch_num; i++) { |
897 | pch_adap = &adap_info->pch_data[i].pch_adapter; | 904 | pch_adap = &adap_info->pch_data[i].pch_adapter; |
898 | adap_info->pch_i2c_suspended = false; | 905 | adap_info->pch_i2c_suspended = false; |
@@ -910,28 +917,23 @@ static int __devinit pch_i2c_probe(struct pci_dev *pdev, | |||
910 | 917 | ||
911 | pch_adap->dev.parent = &pdev->dev; | 918 | pch_adap->dev.parent = &pdev->dev; |
912 | 919 | ||
920 | pch_i2c_init(&adap_info->pch_data[i]); | ||
913 | ret = i2c_add_adapter(pch_adap); | 921 | ret = i2c_add_adapter(pch_adap); |
914 | if (ret) { | 922 | if (ret) { |
915 | pch_pci_err(pdev, "i2c_add_adapter[ch:%d] FAILED\n", i); | 923 | pch_pci_err(pdev, "i2c_add_adapter[ch:%d] FAILED\n", i); |
916 | goto err_i2c_add_adapter; | 924 | goto err_add_adapter; |
917 | } | 925 | } |
918 | |||
919 | pch_i2c_init(&adap_info->pch_data[i]); | ||
920 | } | ||
921 | ret = request_irq(pdev->irq, pch_i2c_handler, IRQF_SHARED, | ||
922 | KBUILD_MODNAME, adap_info); | ||
923 | if (ret) { | ||
924 | pch_pci_err(pdev, "request_irq FAILED\n"); | ||
925 | goto err_i2c_add_adapter; | ||
926 | } | 926 | } |
927 | 927 | ||
928 | pci_set_drvdata(pdev, adap_info); | 928 | pci_set_drvdata(pdev, adap_info); |
929 | pch_pci_dbg(pdev, "returns %d.\n", ret); | 929 | pch_pci_dbg(pdev, "returns %d.\n", ret); |
930 | return 0; | 930 | return 0; |
931 | 931 | ||
932 | err_i2c_add_adapter: | 932 | err_add_adapter: |
933 | for (j = 0; j < i; j++) | 933 | for (j = 0; j < i; j++) |
934 | i2c_del_adapter(&adap_info->pch_data[j].pch_adapter); | 934 | i2c_del_adapter(&adap_info->pch_data[j].pch_adapter); |
935 | free_irq(pdev->irq, adap_info); | ||
936 | err_request_irq: | ||
935 | pci_iounmap(pdev, base_addr); | 937 | pci_iounmap(pdev, base_addr); |
936 | err_pci_iomap: | 938 | err_pci_iomap: |
937 | pci_release_regions(pdev); | 939 | pci_release_regions(pdev); |
diff --git a/drivers/i2c/busses/i2c-highlander.c b/drivers/i2c/busses/i2c-highlander.c index 63bb1cc2a042..19515df61021 100644 --- a/drivers/i2c/busses/i2c-highlander.c +++ b/drivers/i2c/busses/i2c-highlander.c | |||
@@ -52,7 +52,7 @@ struct highlander_i2c_dev { | |||
52 | size_t buf_len; | 52 | size_t buf_len; |
53 | }; | 53 | }; |
54 | 54 | ||
55 | static int iic_force_poll, iic_force_normal; | 55 | static bool iic_force_poll, iic_force_normal; |
56 | static int iic_timeout = 1000, iic_read_delay; | 56 | static int iic_timeout = 1000, iic_read_delay; |
57 | 57 | ||
58 | static inline void highlander_i2c_irq_enable(struct highlander_i2c_dev *dev) | 58 | static inline void highlander_i2c_irq_enable(struct highlander_i2c_dev *dev) |
@@ -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 9ff1695d8458..c527de17db4f 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 ab26840d0c70..5d2e2816831f 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 3c110fbc409b..806e225f3de7 100644 --- a/drivers/i2c/busses/i2c-ibm_iic.c +++ b/drivers/i2c/busses/i2c-ibm_iic.c | |||
@@ -51,11 +51,11 @@ | |||
51 | MODULE_DESCRIPTION("IBM IIC driver v" DRIVER_VERSION); | 51 | MODULE_DESCRIPTION("IBM IIC driver v" DRIVER_VERSION); |
52 | MODULE_LICENSE("GPL"); | 52 | MODULE_LICENSE("GPL"); |
53 | 53 | ||
54 | static int iic_force_poll; | 54 | static bool iic_force_poll; |
55 | module_param(iic_force_poll, bool, 0); | 55 | module_param(iic_force_poll, bool, 0); |
56 | MODULE_PARM_DESC(iic_force_poll, "Force polling mode"); | 56 | MODULE_PARM_DESC(iic_force_poll, "Force polling mode"); |
57 | 57 | ||
58 | static int iic_force_fast; | 58 | static bool iic_force_fast; |
59 | module_param(iic_force_fast, bool, 0); | 59 | module_param(iic_force_fast, bool, 0); |
60 | MODULE_PARM_DESC(iic_force_fast, "Force fast mode (400 kHz)"); | 60 | MODULE_PARM_DESC(iic_force_fast, "Force fast mode (400 kHz)"); |
61 | 61 | ||
@@ -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 e828ac85cfa7..365bad5b890b 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 f09c9319a2ba..93f147a96b62 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 0682f8f277b0..6561d275b8cf 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 c01e9519f6c1..5d263f9014d6 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 107397a606b4..a8ebb84e23f9 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 a9941c65f226..4f44a33017b0 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 ff1e127dfea8..43a96a123920 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 1b46a9d9f907..18068dee48f1 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 56dbe54e8811..ee139a598814 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-omap.c b/drivers/i2c/busses/i2c-omap.c index a43d0023446a..fa23faa20f0e 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c | |||
@@ -1047,13 +1047,14 @@ omap_i2c_probe(struct platform_device *pdev) | |||
1047 | * size. This is to ensure that we can handle the status on int | 1047 | * size. This is to ensure that we can handle the status on int |
1048 | * call back latencies. | 1048 | * call back latencies. |
1049 | */ | 1049 | */ |
1050 | if (dev->rev >= OMAP_I2C_REV_ON_3530_4430) { | 1050 | |
1051 | dev->fifo_size = 0; | 1051 | dev->fifo_size = (dev->fifo_size / 2); |
1052 | |||
1053 | if (dev->rev >= OMAP_I2C_REV_ON_3530_4430) | ||
1052 | dev->b_hw = 0; /* Disable hardware fixes */ | 1054 | dev->b_hw = 0; /* Disable hardware fixes */ |
1053 | } else { | 1055 | else |
1054 | dev->fifo_size = (dev->fifo_size / 2); | ||
1055 | dev->b_hw = 1; /* Enable hardware fixes */ | 1056 | dev->b_hw = 1; /* Enable hardware fixes */ |
1056 | } | 1057 | |
1057 | /* calculate wakeup latency constraint for MPU */ | 1058 | /* calculate wakeup latency constraint for MPU */ |
1058 | if (dev->set_mpu_wkup_lat != NULL) | 1059 | if (dev->set_mpu_wkup_lat != NULL) |
1059 | dev->latency = (1000000 * dev->fifo_size) / | 1060 | dev->latency = (1000000 * dev->fifo_size) / |
diff --git a/drivers/i2c/busses/i2c-pasemi.c b/drivers/i2c/busses/i2c-pasemi.c index 837b8c1aa02a..eaaea73209c5 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 ace67995d7de..2adbf1a8fdea 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 6d14ac2e3c41..c14d48dd601a 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 127051b06921..07b7447ecbc9 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 b289ec99eeba..7b397c6f607e 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-puv3.c b/drivers/i2c/busses/i2c-puv3.c index fac673940849..93709fbe30eb 100644 --- a/drivers/i2c/busses/i2c-puv3.c +++ b/drivers/i2c/busses/i2c-puv3.c | |||
@@ -276,8 +276,6 @@ static int puv3_i2c_resume(struct platform_device *dev) | |||
276 | #define puv3_i2c_resume NULL | 276 | #define puv3_i2c_resume NULL |
277 | #endif | 277 | #endif |
278 | 278 | ||
279 | MODULE_ALIAS("platform:puv3_i2c"); | ||
280 | |||
281 | static struct platform_driver puv3_i2c_driver = { | 279 | static struct platform_driver puv3_i2c_driver = { |
282 | .probe = puv3_i2c_probe, | 280 | .probe = puv3_i2c_probe, |
283 | .remove = __devexit_p(puv3_i2c_remove), | 281 | .remove = __devexit_p(puv3_i2c_remove), |
@@ -289,18 +287,8 @@ static struct platform_driver puv3_i2c_driver = { | |||
289 | } | 287 | } |
290 | }; | 288 | }; |
291 | 289 | ||
292 | static int __init puv3_i2c_init(void) | 290 | module_platform_driver(puv3_i2c_driver); |
293 | { | ||
294 | return platform_driver_register(&puv3_i2c_driver); | ||
295 | } | ||
296 | |||
297 | static void __exit puv3_i2c_exit(void) | ||
298 | { | ||
299 | platform_driver_unregister(&puv3_i2c_driver); | ||
300 | } | ||
301 | |||
302 | module_init(puv3_i2c_init); | ||
303 | module_exit(puv3_i2c_exit); | ||
304 | 291 | ||
305 | MODULE_DESCRIPTION("PKUnity v3 I2C driver"); | 292 | MODULE_DESCRIPTION("PKUnity v3 I2C driver"); |
306 | MODULE_LICENSE("GPL v2"); | 293 | MODULE_LICENSE("GPL v2"); |
294 | MODULE_ALIAS("platform:puv3_i2c"); | ||
diff --git a/drivers/i2c/busses/i2c-pxa-pci.c b/drivers/i2c/busses/i2c-pxa-pci.c index 632e088760a3..a05817980556 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-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index 2754cef86a06..4c1718081685 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c | |||
@@ -534,6 +534,7 @@ static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c, | |||
534 | 534 | ||
535 | /* first, try busy waiting briefly */ | 535 | /* first, try busy waiting briefly */ |
536 | do { | 536 | do { |
537 | cpu_relax(); | ||
537 | iicstat = readl(i2c->regs + S3C2410_IICSTAT); | 538 | iicstat = readl(i2c->regs + S3C2410_IICSTAT); |
538 | } while ((iicstat & S3C2410_IICSTAT_START) && --spins); | 539 | } while ((iicstat & S3C2410_IICSTAT_START) && --spins); |
539 | 540 | ||
@@ -786,7 +787,7 @@ static void s3c24xx_i2c_dt_gpio_free(struct s3c24xx_i2c *i2c) | |||
786 | #else | 787 | #else |
787 | static int s3c24xx_i2c_parse_dt_gpio(struct s3c24xx_i2c *i2c) | 788 | static int s3c24xx_i2c_parse_dt_gpio(struct s3c24xx_i2c *i2c) |
788 | { | 789 | { |
789 | return -EINVAL; | 790 | return 0; |
790 | } | 791 | } |
791 | 792 | ||
792 | static void s3c24xx_i2c_dt_gpio_free(struct s3c24xx_i2c *i2c) | 793 | static void s3c24xx_i2c_dt_gpio_free(struct s3c24xx_i2c *i2c) |
diff --git a/drivers/i2c/busses/i2c-sh7760.c b/drivers/i2c/busses/i2c-sh7760.c index a67132b2e092..c0c9dffbdb12 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 2fc08fbf67a2..4fc87e7c94c9 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 437586611d4a..87e5126d449c 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 e6f539e26f65..15cf78f65ce0 100644 --- a/drivers/i2c/busses/i2c-sis630.c +++ b/drivers/i2c/busses/i2c-sis630.c | |||
@@ -93,8 +93,8 @@ | |||
93 | static struct pci_driver sis630_driver; | 93 | static struct pci_driver sis630_driver; |
94 | 94 | ||
95 | /* insmod parameters */ | 95 | /* insmod parameters */ |
96 | static int high_clock; | 96 | static bool high_clock; |
97 | static int force; | 97 | static bool force; |
98 | module_param(high_clock, bool, 0); | 98 | module_param(high_clock, bool, 0); |
99 | MODULE_PARM_DESC(high_clock, "Set Host Master Clock to 56KHz (default 14KHz)."); | 99 | MODULE_PARM_DESC(high_clock, "Set Host Master Clock to 56KHz (default 14KHz)."); |
100 | module_param(force, bool, 0); | 100 | module_param(force, bool, 0); |
@@ -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 86837f0c4cb9..cc5d149413f7 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-tegra.c b/drivers/i2c/busses/i2c-tegra.c index 46b6500c5478..6381604696d3 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c | |||
@@ -558,7 +558,7 @@ static const struct i2c_algorithm tegra_i2c_algo = { | |||
558 | .functionality = tegra_i2c_func, | 558 | .functionality = tegra_i2c_func, |
559 | }; | 559 | }; |
560 | 560 | ||
561 | static int tegra_i2c_probe(struct platform_device *pdev) | 561 | static int __devinit tegra_i2c_probe(struct platform_device *pdev) |
562 | { | 562 | { |
563 | struct tegra_i2c_dev *i2c_dev; | 563 | struct tegra_i2c_dev *i2c_dev; |
564 | struct tegra_i2c_platform_data *pdata = pdev->dev.platform_data; | 564 | struct tegra_i2c_platform_data *pdata = pdev->dev.platform_data; |
@@ -636,7 +636,10 @@ static int tegra_i2c_probe(struct platform_device *pdev) | |||
636 | i2c_dev->bus_clk_rate = be32_to_cpup(prop); | 636 | i2c_dev->bus_clk_rate = be32_to_cpup(prop); |
637 | } | 637 | } |
638 | 638 | ||
639 | if (pdev->id == 3) | 639 | if (pdev->dev.of_node) |
640 | i2c_dev->is_dvc = of_device_is_compatible(pdev->dev.of_node, | ||
641 | "nvidia,tegra20-i2c-dvc"); | ||
642 | else if (pdev->id == 3) | ||
640 | i2c_dev->is_dvc = 1; | 643 | i2c_dev->is_dvc = 1; |
641 | init_completion(&i2c_dev->msg_complete); | 644 | init_completion(&i2c_dev->msg_complete); |
642 | 645 | ||
@@ -690,7 +693,7 @@ err_iounmap: | |||
690 | return ret; | 693 | return ret; |
691 | } | 694 | } |
692 | 695 | ||
693 | static int tegra_i2c_remove(struct platform_device *pdev) | 696 | static int __devexit tegra_i2c_remove(struct platform_device *pdev) |
694 | { | 697 | { |
695 | struct tegra_i2c_dev *i2c_dev = platform_get_drvdata(pdev); | 698 | struct tegra_i2c_dev *i2c_dev = platform_get_drvdata(pdev); |
696 | i2c_del_adapter(&i2c_dev->adapter); | 699 | i2c_del_adapter(&i2c_dev->adapter); |
@@ -742,6 +745,7 @@ static int tegra_i2c_resume(struct platform_device *pdev) | |||
742 | /* Match table for of_platform binding */ | 745 | /* Match table for of_platform binding */ |
743 | static const struct of_device_id tegra_i2c_of_match[] __devinitconst = { | 746 | static const struct of_device_id tegra_i2c_of_match[] __devinitconst = { |
744 | { .compatible = "nvidia,tegra20-i2c", }, | 747 | { .compatible = "nvidia,tegra20-i2c", }, |
748 | { .compatible = "nvidia,tegra20-i2c-dvc", }, | ||
745 | {}, | 749 | {}, |
746 | }; | 750 | }; |
747 | MODULE_DEVICE_TABLE(of, tegra_i2c_of_match); | 751 | MODULE_DEVICE_TABLE(of, tegra_i2c_of_match); |
diff --git a/drivers/i2c/busses/i2c-tiny-usb.c b/drivers/i2c/busses/i2c-tiny-usb.c index d03b04002f0d..f07307ff360d 100644 --- a/drivers/i2c/busses/i2c-tiny-usb.c +++ b/drivers/i2c/busses/i2c-tiny-usb.c | |||
@@ -262,20 +262,7 @@ static struct usb_driver i2c_tiny_usb_driver = { | |||
262 | .id_table = i2c_tiny_usb_table, | 262 | .id_table = i2c_tiny_usb_table, |
263 | }; | 263 | }; |
264 | 264 | ||
265 | static int __init usb_i2c_tiny_usb_init(void) | 265 | module_usb_driver(i2c_tiny_usb_driver); |
266 | { | ||
267 | /* register this driver with the USB subsystem */ | ||
268 | return usb_register(&i2c_tiny_usb_driver); | ||
269 | } | ||
270 | |||
271 | static void __exit usb_i2c_tiny_usb_exit(void) | ||
272 | { | ||
273 | /* deregister this driver with the USB subsystem */ | ||
274 | usb_deregister(&i2c_tiny_usb_driver); | ||
275 | } | ||
276 | |||
277 | module_init(usb_i2c_tiny_usb_init); | ||
278 | module_exit(usb_i2c_tiny_usb_exit); | ||
279 | 266 | ||
280 | /* ----- end of usb layer ------------------------------------------------ */ | 267 | /* ----- end of usb layer ------------------------------------------------ */ |
281 | 268 | ||
diff --git a/drivers/i2c/busses/i2c-via.c b/drivers/i2c/busses/i2c-via.c index 7799fe5bda88..713d31ade26b 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 0b012f1f8ac5..333011c83d52 100644 --- a/drivers/i2c/busses/i2c-viapro.c +++ b/drivers/i2c/busses/i2c-viapro.c | |||
@@ -91,7 +91,7 @@ static unsigned short SMBHSTCFG = 0xD2; | |||
91 | 91 | ||
92 | /* If force is set to anything different from 0, we forcibly enable the | 92 | /* If force is set to anything different from 0, we forcibly enable the |
93 | VT596. DANGEROUS! */ | 93 | VT596. DANGEROUS! */ |
94 | static int force; | 94 | static bool force; |
95 | module_param(force, bool, 0); | 95 | module_param(force, bool, 0); |
96 | MODULE_PARM_DESC(force, "Forcibly enable the SMBus. DANGEROUS!"); | 96 | MODULE_PARM_DESC(force, "Forcibly enable the SMBus. DANGEROUS!"); |
97 | 97 | ||
@@ -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 4bb68f35caf2..2bded7647ef2 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c | |||
@@ -426,7 +426,7 @@ static void xiic_process(struct xiic_i2c *i2c) | |||
426 | xiic_wakeup(i2c, STATE_ERROR); | 426 | xiic_wakeup(i2c, STATE_ERROR); |
427 | 427 | ||
428 | } else if (pend & (XIIC_INTR_TX_EMPTY_MASK | XIIC_INTR_TX_HALF_MASK)) { | 428 | } else if (pend & (XIIC_INTR_TX_EMPTY_MASK | XIIC_INTR_TX_HALF_MASK)) { |
429 | /* Transmit register/FIFO is empty or ½ empty */ | 429 | /* Transmit register/FIFO is empty or ½ empty */ |
430 | 430 | ||
431 | clr = pend & | 431 | clr = pend & |
432 | (XIIC_INTR_TX_EMPTY_MASK | XIIC_INTR_TX_HALF_MASK); | 432 | (XIIC_INTR_TX_EMPTY_MASK | XIIC_INTR_TX_HALF_MASK); |
@@ -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 91e349c884c5..2eacb7784d56 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, } |
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c index 57a45ce84b2d..10e7f1e76586 100644 --- a/drivers/i2c/i2c-dev.c +++ b/drivers/i2c/i2c-dev.c | |||
@@ -251,15 +251,10 @@ static noinline int i2cdev_ioctl_rdrw(struct i2c_client *client, | |||
251 | if (rdwr_arg.nmsgs > I2C_RDRW_IOCTL_MAX_MSGS) | 251 | if (rdwr_arg.nmsgs > I2C_RDRW_IOCTL_MAX_MSGS) |
252 | return -EINVAL; | 252 | return -EINVAL; |
253 | 253 | ||
254 | rdwr_pa = kmalloc(rdwr_arg.nmsgs * sizeof(struct i2c_msg), GFP_KERNEL); | 254 | rdwr_pa = memdup_user(rdwr_arg.msgs, |
255 | if (!rdwr_pa) | 255 | rdwr_arg.nmsgs * sizeof(struct i2c_msg)); |
256 | return -ENOMEM; | 256 | if (IS_ERR(rdwr_pa)) |
257 | 257 | return PTR_ERR(rdwr_pa); | |
258 | if (copy_from_user(rdwr_pa, rdwr_arg.msgs, | ||
259 | rdwr_arg.nmsgs * sizeof(struct i2c_msg))) { | ||
260 | kfree(rdwr_pa); | ||
261 | return -EFAULT; | ||
262 | } | ||
263 | 258 | ||
264 | data_ptrs = kmalloc(rdwr_arg.nmsgs * sizeof(u8 __user *), GFP_KERNEL); | 259 | data_ptrs = kmalloc(rdwr_arg.nmsgs * sizeof(u8 __user *), GFP_KERNEL); |
265 | if (data_ptrs == NULL) { | 260 | if (data_ptrs == NULL) { |
diff --git a/drivers/i2c/muxes/gpio-i2cmux.c b/drivers/i2c/muxes/gpio-i2cmux.c index 7b6ce624cd6e..e5fa695eb0fa 100644 --- a/drivers/i2c/muxes/gpio-i2cmux.c +++ b/drivers/i2c/muxes/gpio-i2cmux.c | |||
@@ -165,18 +165,7 @@ static struct platform_driver gpiomux_driver = { | |||
165 | }, | 165 | }, |
166 | }; | 166 | }; |
167 | 167 | ||
168 | static int __init gpiomux_init(void) | 168 | module_platform_driver(gpiomux_driver); |
169 | { | ||
170 | return platform_driver_register(&gpiomux_driver); | ||
171 | } | ||
172 | |||
173 | static void __exit gpiomux_exit(void) | ||
174 | { | ||
175 | platform_driver_unregister(&gpiomux_driver); | ||
176 | } | ||
177 | |||
178 | module_init(gpiomux_init); | ||
179 | module_exit(gpiomux_exit); | ||
180 | 169 | ||
181 | MODULE_DESCRIPTION("GPIO-based I2C multiplexer driver"); | 170 | MODULE_DESCRIPTION("GPIO-based I2C multiplexer driver"); |
182 | MODULE_AUTHOR("Peter Korsgaard <peter.korsgaard@barco.com>"); | 171 | MODULE_AUTHOR("Peter Korsgaard <peter.korsgaard@barco.com>"); |