diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-10-30 01:58:41 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-30 01:58:41 -0500 |
commit | fce45c1c8a6b5334fa88bbb9b1496b0699d3fef0 (patch) | |
tree | cba2597077cf33d122f8d771bf84618cc5374cf6 /drivers/i2c/busses/i2c-amd8111.c | |
parent | 15dbb5a3f971a28040ae6cbcd8bbdf19b629fa83 (diff) | |
parent | 81cfb8864c73230eb1c37753aba517db15cf4d8f (diff) |
Merge branch 'upstream'
Diffstat (limited to 'drivers/i2c/busses/i2c-amd8111.c')
-rw-r--r-- | drivers/i2c/busses/i2c-amd8111.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/i2c/busses/i2c-amd8111.c b/drivers/i2c/busses/i2c-amd8111.c index 45ea24ba14d5..f3b79a68dbec 100644 --- a/drivers/i2c/busses/i2c-amd8111.c +++ b/drivers/i2c/busses/i2c-amd8111.c | |||
@@ -30,6 +30,8 @@ struct amd_smbus { | |||
30 | int size; | 30 | int size; |
31 | }; | 31 | }; |
32 | 32 | ||
33 | static struct pci_driver amd8111_driver; | ||
34 | |||
33 | /* | 35 | /* |
34 | * AMD PCI control registers definitions. | 36 | * AMD PCI control registers definitions. |
35 | */ | 37 | */ |
@@ -242,7 +244,6 @@ static s32 amd8111_access(struct i2c_adapter * adap, u16 addr, unsigned short fl | |||
242 | break; | 244 | break; |
243 | 245 | ||
244 | case I2C_SMBUS_BLOCK_PROC_CALL: | 246 | case I2C_SMBUS_BLOCK_PROC_CALL: |
245 | protocol |= pec; | ||
246 | len = min_t(u8, data->block[0], 31); | 247 | len = min_t(u8, data->block[0], 31); |
247 | amd_ec_write(smbus, AMD_SMB_CMD, command); | 248 | amd_ec_write(smbus, AMD_SMB_CMD, command); |
248 | amd_ec_write(smbus, AMD_SMB_BCNT, len); | 249 | amd_ec_write(smbus, AMD_SMB_BCNT, len); |
@@ -252,13 +253,6 @@ static s32 amd8111_access(struct i2c_adapter * adap, u16 addr, unsigned short fl | |||
252 | read_write = I2C_SMBUS_READ; | 253 | read_write = I2C_SMBUS_READ; |
253 | break; | 254 | break; |
254 | 255 | ||
255 | case I2C_SMBUS_WORD_DATA_PEC: | ||
256 | case I2C_SMBUS_BLOCK_DATA_PEC: | ||
257 | case I2C_SMBUS_PROC_CALL_PEC: | ||
258 | case I2C_SMBUS_BLOCK_PROC_CALL_PEC: | ||
259 | dev_warn(&adap->dev, "Unexpected software PEC transaction %d\n.", size); | ||
260 | return -1; | ||
261 | |||
262 | default: | 256 | default: |
263 | dev_warn(&adap->dev, "Unsupported transaction %d\n", size); | 257 | dev_warn(&adap->dev, "Unsupported transaction %d\n", size); |
264 | return -1; | 258 | return -1; |
@@ -343,16 +337,15 @@ static int __devinit amd8111_probe(struct pci_dev *dev, const struct pci_device_ | |||
343 | if (~pci_resource_flags(dev, 0) & IORESOURCE_IO) | 337 | if (~pci_resource_flags(dev, 0) & IORESOURCE_IO) |
344 | return -ENODEV; | 338 | return -ENODEV; |
345 | 339 | ||
346 | smbus = kmalloc(sizeof(struct amd_smbus), GFP_KERNEL); | 340 | smbus = kzalloc(sizeof(struct amd_smbus), GFP_KERNEL); |
347 | if (!smbus) | 341 | if (!smbus) |
348 | return -ENOMEM; | 342 | return -ENOMEM; |
349 | memset(smbus, 0, sizeof(struct amd_smbus)); | ||
350 | 343 | ||
351 | smbus->dev = dev; | 344 | smbus->dev = dev; |
352 | smbus->base = pci_resource_start(dev, 0); | 345 | smbus->base = pci_resource_start(dev, 0); |
353 | smbus->size = pci_resource_len(dev, 0); | 346 | smbus->size = pci_resource_len(dev, 0); |
354 | 347 | ||
355 | if (!request_region(smbus->base, smbus->size, "amd8111 SMBus 2.0")) | 348 | if (!request_region(smbus->base, smbus->size, amd8111_driver.name)) |
356 | goto out_kfree; | 349 | goto out_kfree; |
357 | 350 | ||
358 | smbus->adapter.owner = THIS_MODULE; | 351 | smbus->adapter.owner = THIS_MODULE; |
@@ -391,6 +384,7 @@ static void __devexit amd8111_remove(struct pci_dev *dev) | |||
391 | } | 384 | } |
392 | 385 | ||
393 | static struct pci_driver amd8111_driver = { | 386 | static struct pci_driver amd8111_driver = { |
387 | .owner = THIS_MODULE, | ||
394 | .name = "amd8111_smbus2", | 388 | .name = "amd8111_smbus2", |
395 | .id_table = amd8111_ids, | 389 | .id_table = amd8111_ids, |
396 | .probe = amd8111_probe, | 390 | .probe = amd8111_probe, |