diff options
Diffstat (limited to 'drivers/i2c/busses/i2c-nforce2.c')
-rw-r--r-- | drivers/i2c/busses/i2c-nforce2.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c index fe9c0f42a2b7..fd26036e68a3 100644 --- a/drivers/i2c/busses/i2c-nforce2.c +++ b/drivers/i2c/busses/i2c-nforce2.c | |||
@@ -97,6 +97,7 @@ struct nforce2_smbus { | |||
97 | #define NVIDIA_SMB_PRTCL_I2C_BLOCK_DATA 0x4a | 97 | #define NVIDIA_SMB_PRTCL_I2C_BLOCK_DATA 0x4a |
98 | #define NVIDIA_SMB_PRTCL_PEC 0x80 | 98 | #define NVIDIA_SMB_PRTCL_PEC 0x80 |
99 | 99 | ||
100 | static struct pci_driver nforce2_driver; | ||
100 | 101 | ||
101 | static s32 nforce2_access(struct i2c_adapter *adap, u16 addr, | 102 | static s32 nforce2_access(struct i2c_adapter *adap, u16 addr, |
102 | unsigned short flags, char read_write, | 103 | unsigned short flags, char read_write, |
@@ -113,7 +114,6 @@ static struct i2c_adapter nforce2_adapter = { | |||
113 | .owner = THIS_MODULE, | 114 | .owner = THIS_MODULE, |
114 | .class = I2C_CLASS_HWMON, | 115 | .class = I2C_CLASS_HWMON, |
115 | .algo = &smbus_algorithm, | 116 | .algo = &smbus_algorithm, |
116 | .name = "unset", | ||
117 | }; | 117 | }; |
118 | 118 | ||
119 | /* Return -1 on error. See smbus.h for more information */ | 119 | /* Return -1 on error. See smbus.h for more information */ |
@@ -188,13 +188,6 @@ static s32 nforce2_access(struct i2c_adapter * adap, u16 addr, | |||
188 | dev_err(&adap->dev, "I2C_SMBUS_BLOCK_PROC_CALL not supported!\n"); | 188 | dev_err(&adap->dev, "I2C_SMBUS_BLOCK_PROC_CALL not supported!\n"); |
189 | return -1; | 189 | return -1; |
190 | 190 | ||
191 | case I2C_SMBUS_WORD_DATA_PEC: | ||
192 | case I2C_SMBUS_BLOCK_DATA_PEC: | ||
193 | case I2C_SMBUS_PROC_CALL_PEC: | ||
194 | case I2C_SMBUS_BLOCK_PROC_CALL_PEC: | ||
195 | dev_err(&adap->dev, "Unexpected software PEC transaction %d\n.", size); | ||
196 | return -1; | ||
197 | |||
198 | default: | 191 | default: |
199 | dev_err(&adap->dev, "Unsupported transaction %d\n", size); | 192 | dev_err(&adap->dev, "Unsupported transaction %d\n", size); |
200 | return -1; | 193 | return -1; |
@@ -285,7 +278,7 @@ static int __devinit nforce2_probe_smb (struct pci_dev *dev, int reg, | |||
285 | smbus->base = iobase & 0xfffc; | 278 | smbus->base = iobase & 0xfffc; |
286 | smbus->size = 8; | 279 | smbus->size = 8; |
287 | 280 | ||
288 | if (!request_region(smbus->base, smbus->size, "nForce2 SMBus")) { | 281 | if (!request_region(smbus->base, smbus->size, nforce2_driver.name)) { |
289 | dev_err(&smbus->adapter.dev, "Error requesting region %02x .. %02X for %s\n", | 282 | dev_err(&smbus->adapter.dev, "Error requesting region %02x .. %02X for %s\n", |
290 | smbus->base, smbus->base+smbus->size-1, name); | 283 | smbus->base, smbus->base+smbus->size-1, name); |
291 | return -1; | 284 | return -1; |
@@ -313,10 +306,8 @@ static int __devinit nforce2_probe(struct pci_dev *dev, const struct pci_device_ | |||
313 | int res1, res2; | 306 | int res1, res2; |
314 | 307 | ||
315 | /* we support 2 SMBus adapters */ | 308 | /* we support 2 SMBus adapters */ |
316 | if (!(smbuses = (void *)kmalloc(2*sizeof(struct nforce2_smbus), | 309 | if (!(smbuses = kzalloc(2*sizeof(struct nforce2_smbus), GFP_KERNEL))) |
317 | GFP_KERNEL))) | ||
318 | return -ENOMEM; | 310 | return -ENOMEM; |
319 | memset (smbuses, 0, 2*sizeof(struct nforce2_smbus)); | ||
320 | pci_set_drvdata(dev, smbuses); | 311 | pci_set_drvdata(dev, smbuses); |
321 | 312 | ||
322 | /* SMBus adapter 1 */ | 313 | /* SMBus adapter 1 */ |
@@ -356,6 +347,7 @@ static void __devexit nforce2_remove(struct pci_dev *dev) | |||
356 | } | 347 | } |
357 | 348 | ||
358 | static struct pci_driver nforce2_driver = { | 349 | static struct pci_driver nforce2_driver = { |
350 | .owner = THIS_MODULE, | ||
359 | .name = "nForce2_smbus", | 351 | .name = "nForce2_smbus", |
360 | .id_table = nforce2_ids, | 352 | .id_table = nforce2_ids, |
361 | .probe = nforce2_probe, | 353 | .probe = nforce2_probe, |