]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/i2c/busses/i2c-ali1535.c
[PATCH] remove many unneeded #includes of sched.h
[net-next-2.6.git] / drivers / i2c / busses / i2c-ali1535.c
index 3eb47890db40b24e627e468487595a696115b252..6fd8ad7faa0637e57a3b7c1b4440bfb086827404 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 <asm/io.h>
-#include <asm/semaphore.h>
 
 
 /* ALI1535 SMBus address offsets */
 
 static struct pci_driver ali1535_driver;
 static unsigned short ali1535_smba;
-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
@@ -345,7 +342,6 @@ static s32 ali1535_access(struct i2c_adapter *adap, u16 addr,
        int timeout;
        s32 result = 0;
 
-       down(&i2c_ali1535_sem);
        /* 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:
-       up(&i2c_ali1535_sem);
        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,
 };