Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
[powerpc.git] / drivers / i2c / busses / i2c-nforce2.c
index e0b7a91..4d18e6e 100644 (file)
@@ -97,11 +97,7 @@ struct nforce2_smbus {
 #define NVIDIA_SMB_PRTCL_I2C_BLOCK_DATA                0x4a
 #define NVIDIA_SMB_PRTCL_PEC                   0x80
 
-
-/* Other settings */
-#define MAX_TIMEOUT 256
-
-
+static struct pci_driver nforce2_driver;
 
 static s32 nforce2_access(struct i2c_adapter *adap, u16 addr,
                       unsigned short flags, char read_write,
@@ -118,7 +114,6 @@ static struct i2c_adapter nforce2_adapter = {
        .owner          = THIS_MODULE,
        .class          = I2C_CLASS_HWMON,
        .algo           = &smbus_algorithm,
-       .name           = "unset",
 };
 
 /* Return -1 on error. See smbus.h for more information */
@@ -193,13 +188,6 @@ static s32 nforce2_access(struct i2c_adapter * adap, u16 addr,
                        dev_err(&adap->dev, "I2C_SMBUS_BLOCK_PROC_CALL not supported!\n");
                        return -1;
 
-               case I2C_SMBUS_WORD_DATA_PEC:
-               case I2C_SMBUS_BLOCK_DATA_PEC:
-               case I2C_SMBUS_PROC_CALL_PEC:
-               case I2C_SMBUS_BLOCK_PROC_CALL_PEC:
-                       dev_err(&adap->dev, "Unexpected software PEC transaction %d\n.", size);
-                       return -1;
-
                default:
                        dev_err(&adap->dev, "Unsupported transaction %d\n", size);
                        return -1;
@@ -290,7 +278,7 @@ static int __devinit nforce2_probe_smb (struct pci_dev *dev, int reg,
        smbus->base = iobase & 0xfffc;
        smbus->size = 8;
 
-       if (!request_region(smbus->base, smbus->size, "nForce2 SMBus")) {
+       if (!request_region(smbus->base, smbus->size, nforce2_driver.name)) {
                dev_err(&smbus->adapter.dev, "Error requesting region %02x .. %02X for %s\n",
                        smbus->base, smbus->base+smbus->size-1, name);
                return -1;
@@ -318,10 +306,8 @@ static int __devinit nforce2_probe(struct pci_dev *dev, const struct pci_device_
        int res1, res2;
 
        /* we support 2 SMBus adapters */
-       if (!(smbuses = (void *)kmalloc(2*sizeof(struct nforce2_smbus),
-                                       GFP_KERNEL)))
+       if (!(smbuses = kzalloc(2*sizeof(struct nforce2_smbus), GFP_KERNEL)))
                return -ENOMEM;
-       memset (smbuses, 0, 2*sizeof(struct nforce2_smbus));
        pci_set_drvdata(dev, smbuses);
 
        /* SMBus adapter 1 */