linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / i2c / busses / i2c-ali1535.c
index c0a85e2..3eb4789 100644 (file)
@@ -53,7 +53,6 @@
 
 /* Note: we assume there can only be one ALI1535, with one SMBus interface */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
                                        /*  -> Read  = 1                */
 #define        ALI1535_SMBIO_EN        0x04    /* SMB I/O Space enable         */
 
-
+static struct pci_driver ali1535_driver;
 static unsigned short ali1535_smba;
-DECLARE_MUTEX(i2c_ali1535_sem);
+static DECLARE_MUTEX(i2c_ali1535_sem);
 
 /* Detect whether a ALI1535 can be found, and initialize it, where necessary.
    Note the differences between kernels with the old PCI BIOS interface and
@@ -163,7 +162,8 @@ static int ali1535_setup(struct pci_dev *dev)
                goto exit;
        }
 
-       if (!request_region(ali1535_smba, ALI1535_SMB_IOSIZE, "ali1535-smb")) {
+       if (!request_region(ali1535_smba, ALI1535_SMB_IOSIZE,
+                           ali1535_driver.name)) {
                dev_err(&dev->dev, "ALI1535_smb region 0x%x already in use!\n",
                        ali1535_smba);
                goto exit;
@@ -465,7 +465,7 @@ EXIT:
 }
 
 
-u32 ali1535_func(struct i2c_adapter *adapter)
+static u32 ali1535_func(struct i2c_adapter *adapter)
 {
        return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
            I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
@@ -473,8 +473,6 @@ u32 ali1535_func(struct i2c_adapter *adapter)
 }
 
 static struct i2c_algorithm smbus_algorithm = {
-       .name           = "Non-i2c SMBus adapter",
-       .id             = I2C_ALGO_SMBUS,
        .smbus_xfer     = ali1535_access,
        .functionality  = ali1535_func,
 };
@@ -483,19 +481,15 @@ static struct i2c_adapter ali1535_adapter = {
        .owner          = THIS_MODULE,
        .class          = I2C_CLASS_HWMON,
        .algo           = &smbus_algorithm,
-       .name           = "unset",
 };
 
 static struct pci_device_id ali1535_ids[] = {
-       {
-               .vendor =       PCI_VENDOR_ID_AL,
-               .device =       PCI_DEVICE_ID_AL_M7101,
-               .subvendor =    PCI_ANY_ID,
-               .subdevice =    PCI_ANY_ID,
-       },
+       { PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101) },
        { },
 };
 
+MODULE_DEVICE_TABLE (pci, ali1535_ids);
+
 static int __devinit ali1535_probe(struct pci_dev *dev, const struct pci_device_id *id)
 {
        if (ali1535_setup(dev)) {
@@ -527,7 +521,7 @@ static struct pci_driver ali1535_driver = {
 
 static int __init i2c_ali1535_init(void)
 {
-       return pci_module_init(&ali1535_driver);
+       return pci_register_driver(&ali1535_driver);
 }
 
 static void __exit i2c_ali1535_exit(void)