i2c-omap: Switch to static adapter numbering
[powerpc.git] / drivers / i2c / busses / i2c-ali1535.c
index 115a731..f14372a 100644 (file)
 #include <linux/pci.h>
 #include <linux/kernel.h>
 #include <linux/stddef.h>
-#include <linux/sched.h>
 #include <linux/delay.h>
 #include <linux/ioport.h>
 #include <linux/i2c.h>
 #include <linux/init.h>
-#include <linux/mutex.h>
 #include <asm/io.h>
 
 
 
 static struct pci_driver ali1535_driver;
 static unsigned short ali1535_smba;
-static DEFINE_MUTEX(i2c_ali1535_mutex);
 
 /* Detect whether a ALI1535 can be found, and initialize it, where necessary.
    Note the differences between kernels with the old PCI BIOS interface and
@@ -345,7 +342,6 @@ static s32 ali1535_access(struct i2c_adapter *adap, u16 addr,
        int timeout;
        s32 result = 0;
 
-       mutex_lock(&i2c_ali1535_mutex);
        /* make sure SMBus is idle */
        temp = inb_p(SMBHSTSTS);
        for (timeout = 0;
@@ -460,7 +456,6 @@ static s32 ali1535_access(struct i2c_adapter *adap, u16 addr,
                break;
        }
 EXIT:
-       mutex_unlock(&i2c_ali1535_mutex);
        return result;
 }
 
@@ -472,13 +467,14 @@ static u32 ali1535_func(struct i2c_adapter *adapter)
            I2C_FUNC_SMBUS_BLOCK_DATA;
 }
 
-static struct i2c_algorithm smbus_algorithm = {
+static const struct i2c_algorithm smbus_algorithm = {
        .smbus_xfer     = ali1535_access,
        .functionality  = ali1535_func,
 };
 
 static struct i2c_adapter ali1535_adapter = {
        .owner          = THIS_MODULE,
+       .id             = I2C_HW_SMBUS_ALI1535,
        .class          = I2C_CLASS_HWMON,
        .algo           = &smbus_algorithm,
 };
@@ -498,10 +494,10 @@ static int __devinit ali1535_probe(struct pci_dev *dev, const struct pci_device_
                return -ENODEV;
        }
 
-       /* set up the driverfs linkage to our parent device */
+       /* set up the sysfs linkage to our parent device */
        ali1535_adapter.dev.parent = &dev->dev;
 
-       snprintf(ali1535_adapter.name, I2C_NAME_SIZE, 
+       snprintf(ali1535_adapter.name, sizeof(ali1535_adapter.name),
                "SMBus ALI1535 adapter at %04x", ali1535_smba);
        return i2c_add_adapter(&ali1535_adapter);
 }