Commit f88609a0 authored by Linus Torvalds's avatar Linus Torvalds

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

* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  MAINTAINERS: List i2c-omap and i2c-davinci drivers
  MAINTAINERS: i2c: Add third maintainer
  i2c/gpio-i2cmux: Convert to use module_platform_driver()
  i2c/busses: Use module_platform_driver()
  i2c-dev: Use memdup_user
  i2c: Convert to DEFINE_PCI_DEVICE_TABLE
  i2c-ali1535: enable SPARC support
  i2c: Fix error value returned by several bus drivers
parents 2145199c 046d0a37
...@@ -3193,6 +3193,7 @@ F: drivers/i2c/busses/i2c-stub.c ...@@ -3193,6 +3193,7 @@ F: drivers/i2c/busses/i2c-stub.c
I2C SUBSYSTEM I2C SUBSYSTEM
M: "Jean Delvare (PC drivers, core)" <khali@linux-fr.org> M: "Jean Delvare (PC drivers, core)" <khali@linux-fr.org>
M: "Ben Dooks (embedded platforms)" <ben-linux@fluff.org> M: "Ben Dooks (embedded platforms)" <ben-linux@fluff.org>
M: "Wolfram Sang (embedded platforms)" <w.sang@pengutronix.de>
L: linux-i2c@vger.kernel.org L: linux-i2c@vger.kernel.org
W: http://i2c.wiki.kernel.org/ W: http://i2c.wiki.kernel.org/
T: quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-i2c/ T: quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-i2c/
...@@ -4683,6 +4684,8 @@ Q: http://patchwork.kernel.org/project/linux-omap/list/ ...@@ -4683,6 +4684,8 @@ Q: http://patchwork.kernel.org/project/linux-omap/list/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git
S: Maintained S: Maintained
F: arch/arm/*omap*/ F: arch/arm/*omap*/
F: drivers/i2c/busses/i2c-omap.c
F: include/linux/i2c-omap.h
OMAP CLOCK FRAMEWORK SUPPORT OMAP CLOCK FRAMEWORK SUPPORT
M: Paul Walmsley <paul@pwsan.com> M: Paul Walmsley <paul@pwsan.com>
...@@ -5956,6 +5959,7 @@ L: davinci-linux-open-source@linux.davincidsp.com (subscribers-only) ...@@ -5956,6 +5959,7 @@ L: davinci-linux-open-source@linux.davincidsp.com (subscribers-only)
Q: http://patchwork.kernel.org/project/linux-davinci/list/ Q: http://patchwork.kernel.org/project/linux-davinci/list/
S: Supported S: Supported
F: arch/arm/mach-davinci F: arch/arm/mach-davinci
F: drivers/i2c/busses/i2c-davinci.c
SIS 190 ETHERNET DRIVER SIS 190 ETHERNET DRIVER
M: Francois Romieu <romieu@fr.zoreil.com> M: Francois Romieu <romieu@fr.zoreil.com>
......
...@@ -132,7 +132,8 @@ ...@@ -132,7 +132,8 @@
#define ALI1535_SMBIO_EN 0x04 /* SMB I/O Space enable */ #define ALI1535_SMBIO_EN 0x04 /* SMB I/O Space enable */
static struct pci_driver ali1535_driver; static struct pci_driver ali1535_driver;
static unsigned short ali1535_smba; static unsigned long ali1535_smba;
static unsigned short ali1535_offset;
/* Detect whether a ALI1535 can be found, and initialize it, where necessary. /* Detect whether a ALI1535 can be found, and initialize it, where necessary.
Note the differences between kernels with the old PCI BIOS interface and Note the differences between kernels with the old PCI BIOS interface and
...@@ -140,7 +141,7 @@ static unsigned short ali1535_smba; ...@@ -140,7 +141,7 @@ static unsigned short ali1535_smba;
defined to make the transition easier. */ defined to make the transition easier. */
static int __devinit ali1535_setup(struct pci_dev *dev) static int __devinit ali1535_setup(struct pci_dev *dev)
{ {
int retval = -ENODEV; int retval;
unsigned char temp; unsigned char temp;
/* Check the following things: /* Check the following things:
...@@ -149,15 +150,28 @@ static int __devinit ali1535_setup(struct pci_dev *dev) ...@@ -149,15 +150,28 @@ static int __devinit ali1535_setup(struct pci_dev *dev)
- We can use the addresses - We can use the addresses
*/ */
retval = pci_enable_device(dev);
if (retval) {
dev_err(&dev->dev, "ALI1535_smb can't enable device\n");
goto exit;
}
/* Determine the address of the SMBus area */ /* Determine the address of the SMBus area */
pci_read_config_word(dev, SMBBA, &ali1535_smba); pci_read_config_word(dev, SMBBA, &ali1535_offset);
ali1535_smba &= (0xffff & ~(ALI1535_SMB_IOSIZE - 1)); dev_dbg(&dev->dev, "ALI1535_smb is at offset 0x%04x\n", ali1535_offset);
if (ali1535_smba == 0) { ali1535_offset &= (0xffff & ~(ALI1535_SMB_IOSIZE - 1));
if (ali1535_offset == 0) {
dev_warn(&dev->dev, dev_warn(&dev->dev,
"ALI1535_smb region uninitialized - upgrade BIOS?\n"); "ALI1535_smb region uninitialized - upgrade BIOS?\n");
retval = -ENODEV;
goto exit; goto exit;
} }
if (pci_resource_flags(dev, 0) & IORESOURCE_IO)
ali1535_smba = pci_resource_start(dev, 0) + ali1535_offset;
else
ali1535_smba = ali1535_offset;
retval = acpi_check_region(ali1535_smba, ALI1535_SMB_IOSIZE, retval = acpi_check_region(ali1535_smba, ALI1535_SMB_IOSIZE,
ali1535_driver.name); ali1535_driver.name);
if (retval) if (retval)
...@@ -165,8 +179,9 @@ static int __devinit ali1535_setup(struct pci_dev *dev) ...@@ -165,8 +179,9 @@ static int __devinit ali1535_setup(struct pci_dev *dev)
if (!request_region(ali1535_smba, ALI1535_SMB_IOSIZE, if (!request_region(ali1535_smba, ALI1535_SMB_IOSIZE,
ali1535_driver.name)) { ali1535_driver.name)) {
dev_err(&dev->dev, "ALI1535_smb region 0x%x already in use!\n", dev_err(&dev->dev, "ALI1535_smb region 0x%lx already in use!\n",
ali1535_smba); ali1535_smba);
retval = -EBUSY;
goto exit; goto exit;
} }
...@@ -174,6 +189,7 @@ static int __devinit ali1535_setup(struct pci_dev *dev) ...@@ -174,6 +189,7 @@ static int __devinit ali1535_setup(struct pci_dev *dev)
pci_read_config_byte(dev, SMBCFG, &temp); pci_read_config_byte(dev, SMBCFG, &temp);
if ((temp & ALI1535_SMBIO_EN) == 0) { if ((temp & ALI1535_SMBIO_EN) == 0) {
dev_err(&dev->dev, "SMB device not enabled - upgrade BIOS?\n"); dev_err(&dev->dev, "SMB device not enabled - upgrade BIOS?\n");
retval = -ENODEV;
goto exit_free; goto exit_free;
} }
...@@ -181,6 +197,7 @@ static int __devinit ali1535_setup(struct pci_dev *dev) ...@@ -181,6 +197,7 @@ static int __devinit ali1535_setup(struct pci_dev *dev)
pci_read_config_byte(dev, SMBHSTCFG, &temp); pci_read_config_byte(dev, SMBHSTCFG, &temp);
if ((temp & 1) == 0) { if ((temp & 1) == 0) {
dev_err(&dev->dev, "SMBus controller not enabled - upgrade BIOS?\n"); dev_err(&dev->dev, "SMBus controller not enabled - upgrade BIOS?\n");
retval = -ENODEV;
goto exit_free; goto exit_free;
} }
...@@ -196,14 +213,13 @@ static int __devinit ali1535_setup(struct pci_dev *dev) ...@@ -196,14 +213,13 @@ static int __devinit ali1535_setup(struct pci_dev *dev)
*/ */
pci_read_config_byte(dev, SMBREV, &temp); pci_read_config_byte(dev, SMBREV, &temp);
dev_dbg(&dev->dev, "SMBREV = 0x%X\n", temp); dev_dbg(&dev->dev, "SMBREV = 0x%X\n", temp);
dev_dbg(&dev->dev, "ALI1535_smba = 0x%X\n", ali1535_smba); dev_dbg(&dev->dev, "ALI1535_smba = 0x%lx\n", ali1535_smba);
retval = 0; return 0;
exit:
return retval;
exit_free: exit_free:
release_region(ali1535_smba, ALI1535_SMB_IOSIZE); release_region(ali1535_smba, ALI1535_SMB_IOSIZE);
exit:
return retval; return retval;
} }
...@@ -498,7 +514,7 @@ static int __devinit ali1535_probe(struct pci_dev *dev, const struct pci_device_ ...@@ -498,7 +514,7 @@ static int __devinit ali1535_probe(struct pci_dev *dev, const struct pci_device_
ali1535_adapter.dev.parent = &dev->dev; ali1535_adapter.dev.parent = &dev->dev;
snprintf(ali1535_adapter.name, sizeof(ali1535_adapter.name), snprintf(ali1535_adapter.name, sizeof(ali1535_adapter.name),
"SMBus ALI1535 adapter at %04x", ali1535_smba); "SMBus ALI1535 adapter at %04x", ali1535_offset);
return i2c_add_adapter(&ali1535_adapter); return i2c_add_adapter(&ali1535_adapter);
} }
......
...@@ -417,7 +417,7 @@ static void __devexit ali1563_remove(struct pci_dev * dev) ...@@ -417,7 +417,7 @@ static void __devexit ali1563_remove(struct pci_dev * dev)
ali1563_shutdown(dev); ali1563_shutdown(dev);
} }
static const struct pci_device_id ali1563_id_table[] __devinitconst = { static DEFINE_PCI_DEVICE_TABLE(ali1563_id_table) = {
{ PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1563) }, { PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1563) },
{}, {},
}; };
......
...@@ -477,7 +477,7 @@ static struct i2c_adapter ali15x3_adapter = { ...@@ -477,7 +477,7 @@ static struct i2c_adapter ali15x3_adapter = {
.algo = &smbus_algorithm, .algo = &smbus_algorithm,
}; };
static const struct pci_device_id ali15x3_ids[] = { static DEFINE_PCI_DEVICE_TABLE(ali15x3_ids) = {
{ PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101) }, { PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101) },
{ 0, } { 0, }
}; };
......
...@@ -308,7 +308,7 @@ static const char* chipname[] = { ...@@ -308,7 +308,7 @@ static const char* chipname[] = {
"nVidia nForce", "AMD8111", "nVidia nForce", "AMD8111",
}; };
static const struct pci_device_id amd756_ids[] = { static DEFINE_PCI_DEVICE_TABLE(amd756_ids) = {
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_740B), { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_740B),
.driver_data = AMD756 }, .driver_data = AMD756 },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7413), { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7413),
......
...@@ -415,7 +415,7 @@ static const struct i2c_algorithm smbus_algorithm = { ...@@ -415,7 +415,7 @@ static const struct i2c_algorithm smbus_algorithm = {
}; };
static const struct pci_device_id amd8111_ids[] = { static DEFINE_PCI_DEVICE_TABLE(amd8111_ids) = {
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_SMBUS2) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_SMBUS2) },
{ 0, } { 0, }
}; };
......
...@@ -295,9 +295,6 @@ static int at91_i2c_resume(struct platform_device *pdev) ...@@ -295,9 +295,6 @@ static int at91_i2c_resume(struct platform_device *pdev)
#define at91_i2c_resume NULL #define at91_i2c_resume NULL
#endif #endif
/* work with "modprobe at91_i2c" from hotplugging or coldplugging */
MODULE_ALIAS("platform:at91_i2c");
static struct platform_driver at91_i2c_driver = { static struct platform_driver at91_i2c_driver = {
.probe = at91_i2c_probe, .probe = at91_i2c_probe,
.remove = __devexit_p(at91_i2c_remove), .remove = __devexit_p(at91_i2c_remove),
...@@ -309,19 +306,9 @@ static struct platform_driver at91_i2c_driver = { ...@@ -309,19 +306,9 @@ static struct platform_driver at91_i2c_driver = {
}, },
}; };
static int __init at91_i2c_init(void) module_platform_driver(at91_i2c_driver);
{
return platform_driver_register(&at91_i2c_driver);
}
static void __exit at91_i2c_exit(void)
{
platform_driver_unregister(&at91_i2c_driver);
}
module_init(at91_i2c_init);
module_exit(at91_i2c_exit);
MODULE_AUTHOR("Rick Bronson"); MODULE_AUTHOR("Rick Bronson");
MODULE_DESCRIPTION("I2C (TWI) driver for Atmel AT91"); MODULE_DESCRIPTION("I2C (TWI) driver for Atmel AT91");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:at91_i2c");
...@@ -426,20 +426,9 @@ static struct platform_driver au1xpsc_smbus_driver = { ...@@ -426,20 +426,9 @@ static struct platform_driver au1xpsc_smbus_driver = {
.remove = __devexit_p(i2c_au1550_remove), .remove = __devexit_p(i2c_au1550_remove),
}; };
static int __init i2c_au1550_init(void) module_platform_driver(au1xpsc_smbus_driver);
{
return platform_driver_register(&au1xpsc_smbus_driver);
}
static void __exit i2c_au1550_exit(void)
{
platform_driver_unregister(&au1xpsc_smbus_driver);
}
MODULE_AUTHOR("Dan Malek, Embedded Edge, LLC."); MODULE_AUTHOR("Dan Malek, Embedded Edge, LLC.");
MODULE_DESCRIPTION("SMBus adapter Alchemy pb1550"); MODULE_DESCRIPTION("SMBus adapter Alchemy pb1550");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:au1xpsc_smbus"); MODULE_ALIAS("platform:au1xpsc_smbus");
module_init (i2c_au1550_init);
module_exit (i2c_au1550_exit);
...@@ -724,18 +724,7 @@ static struct platform_driver cpm_i2c_driver = { ...@@ -724,18 +724,7 @@ static struct platform_driver cpm_i2c_driver = {
}, },
}; };
static int __init cpm_i2c_init(void) module_platform_driver(cpm_i2c_driver);
{
return platform_driver_register(&cpm_i2c_driver);
}
static void __exit cpm_i2c_exit(void)
{
platform_driver_unregister(&cpm_i2c_driver);
}
module_init(cpm_i2c_init);
module_exit(cpm_i2c_exit);
MODULE_AUTHOR("Jochen Friedrich <jochen@scram.de>"); MODULE_AUTHOR("Jochen Friedrich <jochen@scram.de>");
MODULE_DESCRIPTION("I2C-Bus adapter routines for CPM boards"); MODULE_DESCRIPTION("I2C-Bus adapter routines for CPM boards");
......
...@@ -349,7 +349,7 @@ static void __devexit i2c_dw_pci_remove(struct pci_dev *pdev) ...@@ -349,7 +349,7 @@ static void __devexit i2c_dw_pci_remove(struct pci_dev *pdev)
/* work with hotplug and coldplug */ /* work with hotplug and coldplug */
MODULE_ALIAS("i2c_designware-pci"); MODULE_ALIAS("i2c_designware-pci");
DEFINE_PCI_DEVICE_TABLE(i2_designware_pci_ids) = { static DEFINE_PCI_DEVICE_TABLE(i2_designware_pci_ids) = {
/* Moorestown */ /* Moorestown */
{ PCI_VDEVICE(INTEL, 0x0802), moorestown_0 }, { PCI_VDEVICE(INTEL, 0x0802), moorestown_0 },
{ PCI_VDEVICE(INTEL, 0x0803), moorestown_1 }, { PCI_VDEVICE(INTEL, 0x0803), moorestown_1 },
......
...@@ -185,7 +185,7 @@ static DEFINE_MUTEX(pch_mutex); ...@@ -185,7 +185,7 @@ static DEFINE_MUTEX(pch_mutex);
#define PCI_DEVICE_ID_ML7213_I2C 0x802D #define PCI_DEVICE_ID_ML7213_I2C 0x802D
#define PCI_DEVICE_ID_ML7223_I2C 0x8010 #define PCI_DEVICE_ID_ML7223_I2C 0x8010
static struct pci_device_id __devinitdata pch_pcidev_id[] = { static DEFINE_PCI_DEVICE_TABLE(pch_pcidev_id) = {
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_PCH_I2C), 1, }, { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_PCH_I2C), 1, },
{ PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_I2C), 2, }, { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_I2C), 2, },
{ PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_I2C), 1, }, { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_I2C), 1, },
......
...@@ -468,18 +468,7 @@ static struct platform_driver highlander_i2c_driver = { ...@@ -468,18 +468,7 @@ static struct platform_driver highlander_i2c_driver = {
.remove = __devexit_p(highlander_i2c_remove), .remove = __devexit_p(highlander_i2c_remove),
}; };
static int __init highlander_i2c_init(void) module_platform_driver(highlander_i2c_driver);
{
return platform_driver_register(&highlander_i2c_driver);
}
static void __exit highlander_i2c_exit(void)
{
platform_driver_unregister(&highlander_i2c_driver);
}
module_init(highlander_i2c_init);
module_exit(highlander_i2c_exit);
MODULE_AUTHOR("Paul Mundt"); MODULE_AUTHOR("Paul Mundt");
MODULE_DESCRIPTION("Renesas Highlander FPGA I2C/SMBus adapter"); MODULE_DESCRIPTION("Renesas Highlander FPGA I2C/SMBus adapter");
......
...@@ -105,7 +105,7 @@ static struct i2c_adapter hydra_adap = { ...@@ -105,7 +105,7 @@ static struct i2c_adapter hydra_adap = {
.algo_data = &hydra_bit_data, .algo_data = &hydra_bit_data,
}; };
static const struct pci_device_id hydra_ids[] = { static DEFINE_PCI_DEVICE_TABLE(hydra_ids) = {
{ PCI_DEVICE(PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_HYDRA) }, { PCI_DEVICE(PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_HYDRA) },
{ 0, } { 0, }
}; };
......
...@@ -609,7 +609,7 @@ static const struct i2c_algorithm smbus_algorithm = { ...@@ -609,7 +609,7 @@ static const struct i2c_algorithm smbus_algorithm = {
.functionality = i801_func, .functionality = i801_func,
}; };
static const struct pci_device_id i801_ids[] = { static DEFINE_PCI_DEVICE_TABLE(i801_ids) = {
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_3) }, { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_3) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AB_3) }, { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AB_3) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_2) }, { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_2) },
......
...@@ -815,15 +815,4 @@ static struct platform_driver ibm_iic_driver = { ...@@ -815,15 +815,4 @@ static struct platform_driver ibm_iic_driver = {
.remove = __devexit_p(iic_remove), .remove = __devexit_p(iic_remove),
}; };
static int __init iic_init(void) module_platform_driver(ibm_iic_driver);
{
return platform_driver_register(&ibm_iic_driver);
}
static void __exit iic_exit(void)
{
platform_driver_unregister(&ibm_iic_driver);
}
module_init(iic_init);
module_exit(iic_exit);
...@@ -1093,7 +1093,7 @@ static void __devexit intel_mid_i2c_remove(struct pci_dev *dev) ...@@ -1093,7 +1093,7 @@ static void __devexit intel_mid_i2c_remove(struct pci_dev *dev)
pci_release_region(dev, 0); pci_release_region(dev, 0);
} }
static struct pci_device_id intel_mid_i2c_ids[] = { static DEFINE_PCI_DEVICE_TABLE(intel_mid_i2c_ids) = {
/* Moorestown */ /* Moorestown */
{ PCI_VDEVICE(INTEL, 0x0802), 0 }, { PCI_VDEVICE(INTEL, 0x0802), 0 },
{ PCI_VDEVICE(INTEL, 0x0803), 1 }, { PCI_VDEVICE(INTEL, 0x0803), 1 },
......
...@@ -523,21 +523,7 @@ static struct platform_driver iop3xx_i2c_driver = { ...@@ -523,21 +523,7 @@ static struct platform_driver iop3xx_i2c_driver = {
}, },
}; };
static int __init module_platform_driver(iop3xx_i2c_driver);
i2c_iop3xx_init (void)
{
return platform_driver_register(&iop3xx_i2c_driver);
}
static void __exit
i2c_iop3xx_exit (void)
{
platform_driver_unregister(&iop3xx_i2c_driver);
return;
}
module_init (i2c_iop3xx_init);
module_exit (i2c_iop3xx_exit);
MODULE_AUTHOR("D-TACQ Solutions Ltd <www.d-tacq.com>"); MODULE_AUTHOR("D-TACQ Solutions Ltd <www.d-tacq.com>");
MODULE_DESCRIPTION("IOP3xx iic algorithm and driver"); MODULE_DESCRIPTION("IOP3xx iic algorithm and driver");
......
...@@ -306,20 +306,9 @@ static struct platform_driver smbus_sch_driver = { ...@@ -306,20 +306,9 @@ static struct platform_driver smbus_sch_driver = {
.remove = __devexit_p(smbus_sch_remove), .remove = __devexit_p(smbus_sch_remove),
}; };
static int __init i2c_sch_init(void) module_platform_driver(smbus_sch_driver);
{
return platform_driver_register(&smbus_sch_driver);
}
static void __exit i2c_sch_exit(void)
{
platform_driver_unregister(&smbus_sch_driver);
}
MODULE_AUTHOR("Jacob Pan <jacob.jun.pan@intel.com>"); MODULE_AUTHOR("Jacob Pan <jacob.jun.pan@intel.com>");
MODULE_DESCRIPTION("Intel SCH SMBus driver"); MODULE_DESCRIPTION("Intel SCH SMBus driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
module_init(i2c_sch_init);
module_exit(i2c_sch_exit);
MODULE_ALIAS("platform:isch_smbus"); MODULE_ALIAS("platform:isch_smbus");
...@@ -148,18 +148,7 @@ static struct platform_driver ixp2000_i2c_driver = { ...@@ -148,18 +148,7 @@ static struct platform_driver ixp2000_i2c_driver = {
}, },
}; };
static int __init ixp2000_i2c_init(void) module_platform_driver(ixp2000_i2c_driver);
{
return platform_driver_register(&ixp2000_i2c_driver);
}
static void __exit ixp2000_i2c_exit(void)
{
platform_driver_unregister(&ixp2000_i2c_driver);
}
module_init(ixp2000_i2c_init);
module_exit(ixp2000_i2c_exit);
MODULE_AUTHOR ("Deepak Saxena <dsaxena@plexity.net>"); MODULE_AUTHOR ("Deepak Saxena <dsaxena@plexity.net>");
MODULE_DESCRIPTION("IXP2000 GPIO-based I2C bus driver"); MODULE_DESCRIPTION("IXP2000 GPIO-based I2C bus driver");
......
...@@ -715,18 +715,7 @@ static struct platform_driver mpc_i2c_driver = { ...@@ -715,18 +715,7 @@ static struct platform_driver mpc_i2c_driver = {
}, },
}; };
static int __init fsl_i2c_init(void) module_platform_driver(mpc_i2c_driver);
{
return platform_driver_register(&mpc_i2c_driver);
}
static void __exit fsl_i2c_exit(void)
{
platform_driver_unregister(&mpc_i2c_driver);
}
module_init(fsl_i2c_init);
module_exit(fsl_i2c_exit);
MODULE_AUTHOR("Adrian Cox <adrian@humboldt.co.uk>"); MODULE_AUTHOR("Adrian Cox <adrian@humboldt.co.uk>");
MODULE_DESCRIPTION("I2C-Bus adapter for MPC107 bridge and " MODULE_DESCRIPTION("I2C-Bus adapter for MPC107 bridge and "
......
...@@ -611,20 +611,7 @@ static struct platform_driver mv64xxx_i2c_driver = { ...@@ -611,20 +611,7 @@ static struct platform_driver mv64xxx_i2c_driver = {
}, },
}; };
static int __init module_platform_driver(mv64xxx_i2c_driver);
mv64xxx_i2c_init(void)
{
return platform_driver_register(&mv64xxx_i2c_driver);
}
static void __exit
mv64xxx_i2c_exit(void)
{
platform_driver_unregister(&mv64xxx_i2c_driver);
}
module_init(mv64xxx_i2c_init);
module_exit(mv64xxx_i2c_exit);
MODULE_AUTHOR("Mark A. Greer <mgreer@mvista.com>"); MODULE_AUTHOR("Mark A. Greer <mgreer@mvista.com>");
MODULE_DESCRIPTION("Marvell mv64xxx host bridge i2c ctlr driver"); MODULE_DESCRIPTION("Marvell mv64xxx host bridge i2c ctlr driver");
......
...@@ -309,7 +309,7 @@ static struct i2c_algorithm smbus_algorithm = { ...@@ -309,7 +309,7 @@ static struct i2c_algorithm smbus_algorithm = {
}; };
static const struct pci_device_id nforce2_ids[] = { static DEFINE_PCI_DEVICE_TABLE(nforce2_ids) = {
{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS) }, { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS) },
{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_SMBUS) }, { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_SMBUS) },
{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3_SMBUS) }, { 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,7 +356,7 @@ static int __devinit nforce2_probe_smb (struct pci_dev *dev, int bar,
error = acpi_check_region(smbus->base, smbus->size, error = acpi_check_region(smbus->base, smbus->size,
nforce2_driver.name); nforce2_driver.name);
if (error) if (error)
return -1; return error;
if (!request_region(smbus->base, smbus->size, nforce2_driver.name)) { if (!request_region(smbus->base, smbus->size, nforce2_driver.name)) {
dev_err(&smbus->adapter.dev, "Error requesting region %02x .. %02X for %s\n", dev_err(&smbus->adapter.dev, "Error requesting region %02x .. %02X for %s\n",
......
...@@ -394,9 +394,6 @@ static struct of_device_id ocores_i2c_match[] = { ...@@ -394,9 +394,6 @@ static struct of_device_id ocores_i2c_match[] = {
}; };
MODULE_DEVICE_TABLE(of, ocores_i2c_match); MODULE_DEVICE_TABLE(of, ocores_i2c_match);
/* work with hotplug and coldplug */
MODULE_ALIAS("platform:ocores-i2c");
static struct platform_driver ocores_i2c_driver = { static struct platform_driver ocores_i2c_driver = {
.probe = ocores_i2c_probe, .probe = ocores_i2c_probe,
.remove = __devexit_p(ocores_i2c_remove), .remove = __devexit_p(ocores_i2c_remove),
...@@ -409,19 +406,9 @@ static struct platform_driver ocores_i2c_driver = { ...@@ -409,19 +406,9 @@ static struct platform_driver ocores_i2c_driver = {
}, },
}; };
static int __init ocores_i2c_init(void) module_platform_driver(ocores_i2c_driver);
{
return platform_driver_register(&ocores_i2c_driver);
}
static void __exit ocores_i2c_exit(void)
{
platform_driver_unregister(&ocores_i2c_driver);
}
module_init(ocores_i2c_init);
module_exit(ocores_i2c_exit);
MODULE_AUTHOR("Peter Korsgaard <jacmet@sunsite.dk>"); MODULE_AUTHOR("Peter Korsgaard <jacmet@sunsite.dk>");
MODULE_DESCRIPTION("OpenCores I2C bus driver"); MODULE_DESCRIPTION("OpenCores I2C bus driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:ocores-i2c");
...@@ -629,24 +629,10 @@ static struct platform_driver octeon_i2c_driver = { ...@@ -629,24 +629,10 @@ static struct platform_driver octeon_i2c_driver = {
}, },
}; };
static int __init octeon_i2c_init(void) module_platform_driver(octeon_i2c_driver);
{
int rv;
rv = platform_driver_register(&octeon_i2c_driver);
return rv;
}
static void __exit octeon_i2c_exit(void)
{
platform_driver_unregister(&octeon_i2c_driver);
}
MODULE_AUTHOR("Michael Lawnick <michael.lawnick.ext@nsn.com>"); MODULE_AUTHOR("Michael Lawnick <michael.lawnick.ext@nsn.com>");
MODULE_DESCRIPTION("I2C-Bus adapter for Cavium OCTEON processors"); MODULE_DESCRIPTION("I2C-Bus adapter for Cavium OCTEON processors");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION); MODULE_VERSION(DRV_VERSION);
MODULE_ALIAS("platform:" DRV_NAME); MODULE_ALIAS("platform:" DRV_NAME);
module_init(octeon_i2c_init);
module_exit(octeon_i2c_exit);
...@@ -401,7 +401,7 @@ static void __devexit pasemi_smb_remove(struct pci_dev *dev) ...@@ -401,7 +401,7 @@ static void __devexit pasemi_smb_remove(struct pci_dev *dev)
kfree(smbus); kfree(smbus);
} }
static const struct pci_device_id pasemi_smb_ids[] = { static DEFINE_PCI_DEVICE_TABLE(pasemi_smb_ids) = {
{ PCI_DEVICE(0x1959, 0xa003) }, { PCI_DEVICE(0x1959, 0xa003) },
{ 0, } { 0, }
}; };
......
...@@ -286,20 +286,8 @@ static struct platform_driver i2c_pca_pf_driver = { ...@@ -286,20 +286,8 @@ static struct platform_driver i2c_pca_pf_driver = {
}, },
}; };
static int __init i2c_pca_pf_init(void) module_platform_driver(i2c_pca_pf_driver);
{
return platform_driver_register(&i2c_pca_pf_driver);
}
static void __exit i2c_pca_pf_exit(void)
{
platform_driver_unregister(&i2c_pca_pf_driver);
}
MODULE_AUTHOR("Wolfram Sang <w.sang@pengutronix.de>"); MODULE_AUTHOR("Wolfram Sang <w.sang@pengutronix.de>");
MODULE_DESCRIPTION("I2C-PCA9564/PCA9665 platform driver"); MODULE_DESCRIPTION("I2C-PCA9564/PCA9665 platform driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
module_init(i2c_pca_pf_init);
module_exit(i2c_pca_pf_exit);
...@@ -472,7 +472,7 @@ static struct i2c_adapter piix4_adapter = { ...@@ -472,7 +472,7 @@ static struct i2c_adapter piix4_adapter = {
.algo = &smbus_algorithm, .algo = &smbus_algorithm,
}; };
static const struct pci_device_id piix4_ids[] = { static DEFINE_PCI_DEVICE_TABLE(piix4_ids) = {
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3) }, { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443MX_3) }, { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443MX_3) },
{ PCI_DEVICE(PCI_VENDOR_ID_EFAR, PCI_DEVICE_ID_EFAR_SLC90E66_3) }, { PCI_DEVICE(PCI_VENDOR_ID_EFAR, PCI_DEVICE_ID_EFAR_SLC90E66_3) },
......
...@@ -627,9 +627,6 @@ static struct i2c_adapter pmcmsptwi_adapter = { ...@@ -627,9 +627,6 @@ static struct i2c_adapter pmcmsptwi_adapter = {
.name = DRV_NAME, .name = DRV_NAME,
}; };
/* work with hotplug and coldplug */
MODULE_ALIAS("platform:" DRV_NAME);
static struct platform_driver pmcmsptwi_driver = { static struct platform_driver pmcmsptwi_driver = {
.probe = pmcmsptwi_probe, .probe = pmcmsptwi_probe,
.remove = __devexit_p(pmcmsptwi_remove), .remove = __devexit_p(pmcmsptwi_remove),
...@@ -639,18 +636,8 @@ static struct platform_driver pmcmsptwi_driver = { ...@@ -639,18 +636,8 @@ static struct platform_driver pmcmsptwi_driver = {
}, },
}; };
static int __init pmcmsptwi_init(void) module_platform_driver(pmcmsptwi_driver);
{
return platform_driver_register(&pmcmsptwi_driver);
}
static void __exit pmcmsptwi_exit(void)
{
platform_driver_unregister(&pmcmsptwi_driver);
}
MODULE_DESCRIPTION("PMC MSP TWI/SMBus/I2C driver"); MODULE_DESCRIPTION("PMC MSP TWI/SMBus/I2C driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:" DRV_NAME);
module_init(pmcmsptwi_init);
module_exit(pmcmsptwi_exit);
...@@ -312,10 +312,6 @@ static int __devinit i2c_powermac_probe(struct platform_device *dev) ...@@ -312,10 +312,6 @@ static int __devinit i2c_powermac_probe(struct platform_device *dev)
return rc; return rc;
} }
/* work with hotplug and coldplug */
MODULE_ALIAS("platform:i2c-powermac");
static struct platform_driver i2c_powermac_driver = { static struct platform_driver i2c_powermac_driver = {
.probe = i2c_powermac_probe, .probe = i2c_powermac_probe,
.remove = __devexit_p(i2c_powermac_remove), .remove = __devexit_p(i2c_powermac_remove),
...@@ -325,17 +321,6 @@ static struct platform_driver i2c_powermac_driver = { ...@@ -325,17 +321,6 @@ static struct platform_driver i2c_powermac_driver = {
}, },
}; };
static int __init i2c_powermac_init(void) module_platform_driver(i2c_powermac_driver);
{
platform_driver_register(&i2c_powermac_driver);
return 0;
}
MODULE_ALIAS("platform:i2c-powermac");
static void __exit i2c_powermac_cleanup(void)
{
platform_driver_unregister(&i2c_powermac_driver);
}
module_init(i2c_powermac_init);
module_exit(i2c_powermac_cleanup);
...@@ -150,7 +150,7 @@ static void __devexit ce4100_i2c_remove(struct pci_dev *dev) ...@@ -150,7 +150,7 @@ static void __devexit ce4100_i2c_remove(struct pci_dev *dev)
kfree(sds); kfree(sds);
} }
static struct pci_device_id ce4100_i2c_devices[] __devinitdata = { static DEFINE_PCI_DEVICE_TABLE(ce4100_i2c_devices) = {
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x2e68)}, { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x2e68)},
{ }, { },
}; };
......
...@@ -560,18 +560,7 @@ static struct platform_driver sh7760_i2c_drv = { ...@@ -560,18 +560,7 @@ static struct platform_driver sh7760_i2c_drv = {
.remove = __devexit_p(sh7760_i2c_remove), .remove = __devexit_p(sh7760_i2c_remove),
}; };
static int __init sh7760_i2c_init(void) module_platform_driver(sh7760_i2c_drv);
{
return platform_driver_register(&sh7760_i2c_drv);
}
static void __exit sh7760_i2c_exit(void)
{
platform_driver_unregister(&sh7760_i2c_drv);
}
module_init(sh7760_i2c_init);
module_exit(sh7760_i2c_exit);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("SH7760 I2C bus driver"); MODULE_DESCRIPTION("SH7760 I2C bus driver");
......
...@@ -156,12 +156,8 @@ static int simtec_i2c_remove(struct platform_device *dev) ...@@ -156,12 +156,8 @@ static int simtec_i2c_remove(struct platform_device *dev)
return 0; return 0;
} }
/* device driver */ /* device driver */
/* work with hotplug and coldplug */
MODULE_ALIAS("platform:simtec-i2c");
static struct platform_driver simtec_i2c_driver = { static struct platform_driver simtec_i2c_driver = {
.driver = { .driver = {
.name = "simtec-i2c", .name = "simtec-i2c",
...@@ -171,19 +167,9 @@ static struct platform_driver simtec_i2c_driver = { ...@@ -171,19 +167,9 @@ static struct platform_driver simtec_i2c_driver = {
.remove = simtec_i2c_remove, .remove = simtec_i2c_remove,
}; };
static int __init i2c_adap_simtec_init(void) module_platform_driver(simtec_i2c_driver);
{
return platform_driver_register(&simtec_i2c_driver);
}
static void __exit i2c_adap_simtec_exit(void)
{
platform_driver_unregister(&simtec_i2c_driver);
}
module_init(i2c_adap_simtec_init);
module_exit(i2c_adap_simtec_exit);
MODULE_DESCRIPTION("Simtec Generic I2C Bus driver"); MODULE_DESCRIPTION("Simtec Generic I2C Bus driver");
MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:simtec-i2c");
...@@ -147,7 +147,7 @@ static int __devinit sis5595_setup(struct pci_dev *SIS5595_dev) ...@@ -147,7 +147,7 @@ static int __devinit sis5595_setup(struct pci_dev *SIS5595_dev)
u16 a; u16 a;
u8 val; u8 val;
int *i; int *i;
int retval = -ENODEV; int retval;
/* Look for imposters */ /* Look for imposters */
for (i = blacklist; *i != 0; i++) { for (i = blacklist; *i != 0; i++) {
...@@ -223,7 +223,7 @@ static int __devinit sis5595_setup(struct pci_dev *SIS5595_dev) ...@@ -223,7 +223,7 @@ static int __devinit sis5595_setup(struct pci_dev *SIS5595_dev)
error: error:
release_region(sis5595_base + SMB_INDEX, 2); release_region(sis5595_base + SMB_INDEX, 2);
return retval; return -ENODEV;
} }
static int sis5595_transaction(struct i2c_adapter *adap) static int sis5595_transaction(struct i2c_adapter *adap)
...@@ -369,7 +369,7 @@ static struct i2c_adapter sis5595_adapter = { ...@@ -369,7 +369,7 @@ static struct i2c_adapter sis5595_adapter = {
.algo = &smbus_algorithm, .algo = &smbus_algorithm,
}; };
static const struct pci_device_id sis5595_ids[] __devinitconst = { static DEFINE_PCI_DEVICE_TABLE(sis5595_ids) = {
{ PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503) }, { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503) },
{ 0, } { 0, }
}; };
......
...@@ -393,7 +393,7 @@ static int __devinit sis630_setup(struct pci_dev *sis630_dev) ...@@ -393,7 +393,7 @@ static int __devinit sis630_setup(struct pci_dev *sis630_dev)
{ {
unsigned char b; unsigned char b;
struct pci_dev *dummy = NULL; struct pci_dev *dummy = NULL;
int retval = -ENODEV, i; int retval, i;
/* check for supported SiS devices */ /* check for supported SiS devices */
for (i=0; supported[i] > 0 ; i++) { for (i=0; supported[i] > 0 ; i++) {
...@@ -418,18 +418,21 @@ static int __devinit sis630_setup(struct pci_dev *sis630_dev) ...@@ -418,18 +418,21 @@ static int __devinit sis630_setup(struct pci_dev *sis630_dev)
*/ */
if (pci_read_config_byte(sis630_dev, SIS630_BIOS_CTL_REG,&b)) { if (pci_read_config_byte(sis630_dev, SIS630_BIOS_CTL_REG,&b)) {
dev_err(&sis630_dev->dev, "Error: Can't read bios ctl reg\n"); dev_err(&sis630_dev->dev, "Error: Can't read bios ctl reg\n");
retval = -ENODEV;
goto exit; goto exit;
} }
/* if ACPI already enabled , do nothing */ /* if ACPI already enabled , do nothing */
if (!(b & 0x80) && if (!(b & 0x80) &&
pci_write_config_byte(sis630_dev, SIS630_BIOS_CTL_REG, b | 0x80)) { pci_write_config_byte(sis630_dev, SIS630_BIOS_CTL_REG, b | 0x80)) {
dev_err(&sis630_dev->dev, "Error: Can't enable ACPI\n"); dev_err(&sis630_dev->dev, "Error: Can't enable ACPI\n");
retval = -ENODEV;
goto exit; goto exit;
} }
/* Determine the ACPI base address */ /* Determine the ACPI base address */
if (pci_read_config_word(sis630_dev,SIS630_ACPI_BASE_REG,&acpi_base)) { if (pci_read_config_word(sis630_dev,SIS630_ACPI_BASE_REG,&acpi_base)) {
dev_err(&sis630_dev->dev, "Error: Can't determine ACPI base address\n"); dev_err(&sis630_dev->dev, "Error: Can't determine ACPI base address\n");
retval = -ENODEV;
goto exit; goto exit;
} }
...@@ -445,6 +448,7 @@ static int __devinit sis630_setup(struct pci_dev *sis630_dev) ...@@ -445,6 +448,7 @@ static int __devinit sis630_setup(struct pci_dev *sis630_dev)
sis630_driver.name)) { sis630_driver.name)) {
dev_err(&sis630_dev->dev, "SMBus registers 0x%04x-0x%04x already " dev_err(&sis630_dev->dev, "SMBus registers 0x%04x-0x%04x already "
"in use!\n", acpi_base + SMB_STS, acpi_base + SMB_SAA); "in use!\n", acpi_base + SMB_STS, acpi_base + SMB_SAA);
retval = -EBUSY;
goto exit; goto exit;
} }
...@@ -468,7 +472,7 @@ static struct i2c_adapter sis630_adapter = { ...@@ -468,7 +472,7 @@ static struct i2c_adapter sis630_adapter = {
.algo = &smbus_algorithm, .algo = &smbus_algorithm,
}; };
static const struct pci_device_id sis630_ids[] __devinitconst = { static DEFINE_PCI_DEVICE_TABLE(sis630_ids) = {
{ PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503) }, { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503) },
{ PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_LPC) }, { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_LPC) },
{ 0, } { 0, }
......
...@@ -245,7 +245,7 @@ static struct i2c_adapter sis96x_adapter = { ...@@ -245,7 +245,7 @@ static struct i2c_adapter sis96x_adapter = {
.algo = &smbus_algorithm, .algo = &smbus_algorithm,
}; };
static const struct pci_device_id sis96x_ids[] = { static DEFINE_PCI_DEVICE_TABLE(sis96x_ids) = {
{ PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_SMBUS) }, { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_SMBUS) },
{ 0, } { 0, }
}; };
......
...@@ -89,7 +89,7 @@ static struct i2c_adapter vt586b_adapter = { ...@@ -89,7 +89,7 @@ static struct i2c_adapter vt586b_adapter = {
}; };
static const struct pci_device_id vt586b_ids[] __devinitconst = { static DEFINE_PCI_DEVICE_TABLE(vt586b_ids) = {
{ PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3) }, { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3) },
{ 0, } { 0, }
}; };
......
...@@ -324,7 +324,7 @@ static int __devinit vt596_probe(struct pci_dev *pdev, ...@@ -324,7 +324,7 @@ static int __devinit vt596_probe(struct pci_dev *pdev,
const struct pci_device_id *id) const struct pci_device_id *id)
{ {
unsigned char temp; unsigned char temp;
int error = -ENODEV; int error;
/* Determine the address of the SMBus areas */ /* Determine the address of the SMBus areas */
if (force_addr) { if (force_addr) {
...@@ -390,6 +390,7 @@ static int __devinit vt596_probe(struct pci_dev *pdev, ...@@ -390,6 +390,7 @@ static int __devinit vt596_probe(struct pci_dev *pdev,
dev_err(&pdev->dev, "SMBUS: Error: Host SMBus " dev_err(&pdev->dev, "SMBUS: Error: Host SMBus "
"controller not enabled! - upgrade BIOS or " "controller not enabled! - upgrade BIOS or "
"use force=1\n"); "use force=1\n");
error = -ENODEV;
goto release_region; goto release_region;
} }
} }
...@@ -422,9 +423,11 @@ static int __devinit vt596_probe(struct pci_dev *pdev, ...@@ -422,9 +423,11 @@ static int __devinit vt596_probe(struct pci_dev *pdev,
"SMBus Via Pro adapter at %04x", vt596_smba); "SMBus Via Pro adapter at %04x", vt596_smba);
vt596_pdev = pci_dev_get(pdev); vt596_pdev = pci_dev_get(pdev);
if (i2c_add_adapter(&vt596_adapter)) { error = i2c_add_adapter(&vt596_adapter);
if (error) {
pci_dev_put(vt596_pdev); pci_dev_put(vt596_pdev);
vt596_pdev = NULL; vt596_pdev = NULL;
goto release_region;
} }
/* Always return failure here. This is to allow other drivers to bind /* Always return failure here. This is to allow other drivers to bind
...@@ -438,7 +441,7 @@ static int __devinit vt596_probe(struct pci_dev *pdev, ...@@ -438,7 +441,7 @@ static int __devinit vt596_probe(struct pci_dev *pdev,
return error; return error;
} }
static const struct pci_device_id vt596_ids[] = { static DEFINE_PCI_DEVICE_TABLE(vt596_ids) = {
{ PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C596_3), { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C596_3),
.driver_data = SMBBA1 }, .driver_data = SMBBA1 },
{ PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C596B_3), { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C596B_3),
......
...@@ -795,10 +795,6 @@ static int __devexit xiic_i2c_remove(struct platform_device* pdev) ...@@ -795,10 +795,6 @@ static int __devexit xiic_i2c_remove(struct platform_device* pdev)
return 0; return 0;
} }
/* work with hotplug and coldplug */
MODULE_ALIAS("platform:"DRIVER_NAME);
static struct platform_driver xiic_i2c_driver = { static struct platform_driver xiic_i2c_driver = {
.probe = xiic_i2c_probe, .probe = xiic_i2c_probe,
.remove = __devexit_p(xiic_i2c_remove), .remove = __devexit_p(xiic_i2c_remove),
...@@ -808,19 +804,9 @@ static struct platform_driver xiic_i2c_driver = { ...@@ -808,19 +804,9 @@ static struct platform_driver xiic_i2c_driver = {
}, },
}; };
static int __init xiic_i2c_init(void) module_platform_driver(xiic_i2c_driver);
{
return platform_driver_register(&xiic_i2c_driver);
}
static void __exit xiic_i2c_exit(void)
{
platform_driver_unregister(&xiic_i2c_driver);
}
module_init(xiic_i2c_init);
module_exit(xiic_i2c_exit);
MODULE_AUTHOR("info@mocean-labs.com"); MODULE_AUTHOR("info@mocean-labs.com");
MODULE_DESCRIPTION("Xilinx I2C bus driver"); MODULE_DESCRIPTION("Xilinx I2C bus driver");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
MODULE_ALIAS("platform:"DRIVER_NAME);
...@@ -559,7 +559,7 @@ static struct platform_driver scx200_pci_driver = { ...@@ -559,7 +559,7 @@ static struct platform_driver scx200_pci_driver = {
.remove = __devexit_p(scx200_remove), .remove = __devexit_p(scx200_remove),
}; };
static const struct pci_device_id scx200_isa[] __initconst = { static DEFINE_PCI_DEVICE_TABLE(scx200_isa) = {
{ PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_SCx200_BRIDGE) }, { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_SCx200_BRIDGE) },
{ PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_SC1100_BRIDGE) }, { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_SC1100_BRIDGE) },
{ 0, } { 0, }
......
...@@ -251,15 +251,10 @@ static noinline int i2cdev_ioctl_rdrw(struct i2c_client *client, ...@@ -251,15 +251,10 @@ static noinline int i2cdev_ioctl_rdrw(struct i2c_client *client,
if (rdwr_arg.nmsgs > I2C_RDRW_IOCTL_MAX_MSGS) if (rdwr_arg.nmsgs > I2C_RDRW_IOCTL_MAX_MSGS)
return -EINVAL; return -EINVAL;
rdwr_pa = kmalloc(rdwr_arg.nmsgs * sizeof(struct i2c_msg), GFP_KERNEL); rdwr_pa = memdup_user(rdwr_arg.msgs,
if (!rdwr_pa) rdwr_arg.nmsgs * sizeof(struct i2c_msg));
return -ENOMEM; if (IS_ERR(rdwr_pa))
return PTR_ERR(rdwr_pa);
if (copy_from_user(rdwr_pa, rdwr_arg.msgs,
rdwr_arg.nmsgs * sizeof(struct i2c_msg))) {
kfree(rdwr_pa);
return -EFAULT;
}
data_ptrs = kmalloc(rdwr_arg.nmsgs * sizeof(u8 __user *), GFP_KERNEL); data_ptrs = kmalloc(rdwr_arg.nmsgs * sizeof(u8 __user *), GFP_KERNEL);
if (data_ptrs == NULL) { if (data_ptrs == NULL) {
......
...@@ -165,18 +165,7 @@ static struct platform_driver gpiomux_driver = { ...@@ -165,18 +165,7 @@ static struct platform_driver gpiomux_driver = {
}, },
}; };
static int __init gpiomux_init(void) module_platform_driver(gpiomux_driver);
{
return platform_driver_register(&gpiomux_driver);
}
static void __exit gpiomux_exit(void)
{
platform_driver_unregister(&gpiomux_driver);
}
module_init(gpiomux_init);
module_exit(gpiomux_exit);
MODULE_DESCRIPTION("GPIO-based I2C multiplexer driver"); MODULE_DESCRIPTION("GPIO-based I2C multiplexer driver");
MODULE_AUTHOR("Peter Korsgaard <peter.korsgaard@barco.com>"); MODULE_AUTHOR("Peter Korsgaard <peter.korsgaard@barco.com>");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment