diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/hwmon/ltc4215.c | 47 | ||||
| -rw-r--r-- | drivers/hwmon/ltc4245.c | 131 | ||||
| -rw-r--r-- | drivers/i2c/busses/i2c-amd756.c | 2 | ||||
| -rw-r--r-- | drivers/i2c/busses/i2c-amd8111.c | 4 | ||||
| -rw-r--r-- | drivers/i2c/busses/i2c-i801.c | 4 | ||||
| -rw-r--r-- | drivers/i2c/busses/i2c-isch.c | 2 | ||||
| -rw-r--r-- | drivers/i2c/busses/i2c-piix4.c | 4 | ||||
| -rw-r--r-- | drivers/i2c/busses/i2c-sis96x.c | 2 | ||||
| -rw-r--r-- | drivers/i2c/busses/i2c-viapro.c | 2 | ||||
| -rw-r--r-- | drivers/leds/leds-pca9532.c | 3 | ||||
| -rw-r--r-- | drivers/macintosh/therm_adt746x.c | 4 | ||||
| -rw-r--r-- | drivers/macintosh/therm_pm72.c | 4 | ||||
| -rw-r--r-- | drivers/macintosh/windfarm_lm75_sensor.c | 4 | ||||
| -rw-r--r-- | drivers/macintosh/windfarm_max6690_sensor.c | 4 | ||||
| -rw-r--r-- | drivers/macintosh/windfarm_smu_sat.c | 4 | ||||
| -rw-r--r-- | drivers/mfd/ab3100-core.c | 4 | ||||
| -rw-r--r-- | drivers/misc/eeprom/max6875.c | 29 | ||||
| -rw-r--r-- | drivers/staging/iio/light/tsl2561.c | 4 | ||||
| -rw-r--r-- | drivers/w1/masters/ds2482.c | 35 |
19 files changed, 48 insertions, 245 deletions
diff --git a/drivers/hwmon/ltc4215.c b/drivers/hwmon/ltc4215.c index 6c9a04136e0a..00d975eb5b83 100644 --- a/drivers/hwmon/ltc4215.c +++ b/drivers/hwmon/ltc4215.c | |||
| @@ -20,11 +20,6 @@ | |||
| 20 | #include <linux/hwmon.h> | 20 | #include <linux/hwmon.h> |
| 21 | #include <linux/hwmon-sysfs.h> | 21 | #include <linux/hwmon-sysfs.h> |
| 22 | 22 | ||
| 23 | static const unsigned short normal_i2c[] = { I2C_CLIENT_END }; | ||
| 24 | |||
| 25 | /* Insmod parameters */ | ||
| 26 | I2C_CLIENT_INSMOD_1(ltc4215); | ||
| 27 | |||
| 28 | /* Here are names of the chip's registers (a.k.a. commands) */ | 23 | /* Here are names of the chip's registers (a.k.a. commands) */ |
| 29 | enum ltc4215_cmd { | 24 | enum ltc4215_cmd { |
| 30 | LTC4215_CONTROL = 0x00, /* rw */ | 25 | LTC4215_CONTROL = 0x00, /* rw */ |
| @@ -246,9 +241,13 @@ static const struct attribute_group ltc4215_group = { | |||
| 246 | static int ltc4215_probe(struct i2c_client *client, | 241 | static int ltc4215_probe(struct i2c_client *client, |
| 247 | const struct i2c_device_id *id) | 242 | const struct i2c_device_id *id) |
| 248 | { | 243 | { |
| 244 | struct i2c_adapter *adapter = client->adapter; | ||
| 249 | struct ltc4215_data *data; | 245 | struct ltc4215_data *data; |
| 250 | int ret; | 246 | int ret; |
| 251 | 247 | ||
| 248 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | ||
| 249 | return -ENODEV; | ||
| 250 | |||
| 252 | data = kzalloc(sizeof(*data), GFP_KERNEL); | 251 | data = kzalloc(sizeof(*data), GFP_KERNEL); |
| 253 | if (!data) { | 252 | if (!data) { |
| 254 | ret = -ENOMEM; | 253 | ret = -ENOMEM; |
| @@ -294,56 +293,20 @@ static int ltc4215_remove(struct i2c_client *client) | |||
| 294 | return 0; | 293 | return 0; |
| 295 | } | 294 | } |
| 296 | 295 | ||
| 297 | static int ltc4215_detect(struct i2c_client *client, | ||
| 298 | int kind, | ||
| 299 | struct i2c_board_info *info) | ||
| 300 | { | ||
| 301 | struct i2c_adapter *adapter = client->adapter; | ||
| 302 | |||
| 303 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | ||
| 304 | return -ENODEV; | ||
| 305 | |||
| 306 | if (kind < 0) { /* probed detection - check the chip type */ | ||
| 307 | s32 v; /* 8 bits from the chip, or -ERRNO */ | ||
| 308 | |||
| 309 | /* | ||
| 310 | * Register 0x01 bit b7 is reserved, expect 0 | ||
| 311 | * Register 0x03 bit b6 and b7 are reserved, expect 0 | ||
| 312 | */ | ||
| 313 | v = i2c_smbus_read_byte_data(client, LTC4215_ALERT); | ||
| 314 | if (v < 0 || (v & (1 << 7)) != 0) | ||
| 315 | return -ENODEV; | ||
| 316 | |||
| 317 | v = i2c_smbus_read_byte_data(client, LTC4215_FAULT); | ||
| 318 | if (v < 0 || (v & ((1 << 6) | (1 << 7))) != 0) | ||
| 319 | return -ENODEV; | ||
| 320 | } | ||
| 321 | |||
| 322 | strlcpy(info->type, "ltc4215", I2C_NAME_SIZE); | ||
| 323 | dev_info(&adapter->dev, "ltc4215 %s at address 0x%02x\n", | ||
| 324 | kind < 0 ? "probed" : "forced", | ||
| 325 | client->addr); | ||
| 326 | |||
| 327 | return 0; | ||
| 328 | } | ||
| 329 | |||
| 330 | static const struct i2c_device_id ltc4215_id[] = { | 296 | static const struct i2c_device_id ltc4215_id[] = { |
| 331 | { "ltc4215", ltc4215 }, | 297 | { "ltc4215", 0 }, |
| 332 | { } | 298 | { } |
| 333 | }; | 299 | }; |
| 334 | MODULE_DEVICE_TABLE(i2c, ltc4215_id); | 300 | MODULE_DEVICE_TABLE(i2c, ltc4215_id); |
| 335 | 301 | ||
| 336 | /* This is the driver that will be inserted */ | 302 | /* This is the driver that will be inserted */ |
| 337 | static struct i2c_driver ltc4215_driver = { | 303 | static struct i2c_driver ltc4215_driver = { |
| 338 | .class = I2C_CLASS_HWMON, | ||
| 339 | .driver = { | 304 | .driver = { |
| 340 | .name = "ltc4215", | 305 | .name = "ltc4215", |
| 341 | }, | 306 | }, |
| 342 | .probe = ltc4215_probe, | 307 | .probe = ltc4215_probe, |
| 343 | .remove = ltc4215_remove, | 308 | .remove = ltc4215_remove, |
| 344 | .id_table = ltc4215_id, | 309 | .id_table = ltc4215_id, |
| 345 | .detect = ltc4215_detect, | ||
| 346 | .address_data = &addr_data, | ||
| 347 | }; | 310 | }; |
| 348 | 311 | ||
| 349 | static int __init ltc4215_init(void) | 312 | static int __init ltc4215_init(void) |
diff --git a/drivers/hwmon/ltc4245.c b/drivers/hwmon/ltc4245.c index e38964333612..65c232a9d0c5 100644 --- a/drivers/hwmon/ltc4245.c +++ b/drivers/hwmon/ltc4245.c | |||
| @@ -22,15 +22,6 @@ | |||
| 22 | #include <linux/hwmon.h> | 22 | #include <linux/hwmon.h> |
| 23 | #include <linux/hwmon-sysfs.h> | 23 | #include <linux/hwmon-sysfs.h> |
| 24 | 24 | ||
| 25 | /* Valid addresses are 0x20 - 0x3f | ||
| 26 | * | ||
| 27 | * For now, we do not probe, since some of these addresses | ||
| 28 | * are known to be unfriendly to probing */ | ||
| 29 | static const unsigned short normal_i2c[] = { I2C_CLIENT_END }; | ||
| 30 | |||
| 31 | /* Insmod parameters */ | ||
| 32 | I2C_CLIENT_INSMOD_1(ltc4245); | ||
| 33 | |||
| 34 | /* Here are names of the chip's registers (a.k.a. commands) */ | 25 | /* Here are names of the chip's registers (a.k.a. commands) */ |
| 35 | enum ltc4245_cmd { | 26 | enum ltc4245_cmd { |
| 36 | LTC4245_STATUS = 0x00, /* readonly */ | 27 | LTC4245_STATUS = 0x00, /* readonly */ |
| @@ -369,9 +360,13 @@ static const struct attribute_group ltc4245_group = { | |||
| 369 | static int ltc4245_probe(struct i2c_client *client, | 360 | static int ltc4245_probe(struct i2c_client *client, |
| 370 | const struct i2c_device_id *id) | 361 | const struct i2c_device_id *id) |
| 371 | { | 362 | { |
| 363 | struct i2c_adapter *adapter = client->adapter; | ||
| 372 | struct ltc4245_data *data; | 364 | struct ltc4245_data *data; |
| 373 | int ret; | 365 | int ret; |
| 374 | 366 | ||
| 367 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | ||
| 368 | return -ENODEV; | ||
| 369 | |||
| 375 | data = kzalloc(sizeof(*data), GFP_KERNEL); | 370 | data = kzalloc(sizeof(*data), GFP_KERNEL); |
| 376 | if (!data) { | 371 | if (!data) { |
| 377 | ret = -ENOMEM; | 372 | ret = -ENOMEM; |
| @@ -418,136 +413,20 @@ static int ltc4245_remove(struct i2c_client *client) | |||
| 418 | return 0; | 413 | return 0; |
| 419 | } | 414 | } |
| 420 | 415 | ||
| 421 | /* Check that some bits in a control register appear at all possible | ||
| 422 | * locations without changing value | ||
| 423 | * | ||
| 424 | * @client: the i2c client to use | ||
| 425 | * @reg: the register to read | ||
| 426 | * @bits: the bits to check (0xff checks all bits, | ||
| 427 | * 0x03 checks only the last two bits) | ||
| 428 | * | ||
| 429 | * return -ERRNO if the register read failed | ||
| 430 | * return -ENODEV if the register value doesn't stay constant at all | ||
| 431 | * possible addresses | ||
| 432 | * | ||
| 433 | * return 0 for success | ||
| 434 | */ | ||
| 435 | static int ltc4245_check_control_reg(struct i2c_client *client, u8 reg, u8 bits) | ||
| 436 | { | ||
| 437 | int i; | ||
| 438 | s32 v, voff1, voff2; | ||
| 439 | |||
| 440 | /* Read register and check for error */ | ||
| 441 | v = i2c_smbus_read_byte_data(client, reg); | ||
| 442 | if (v < 0) | ||
| 443 | return v; | ||
| 444 | |||
| 445 | v &= bits; | ||
| 446 | |||
| 447 | for (i = 0x00; i < 0xff; i += 0x20) { | ||
| 448 | |||
| 449 | voff1 = i2c_smbus_read_byte_data(client, reg + i); | ||
| 450 | if (voff1 < 0) | ||
| 451 | return voff1; | ||
| 452 | |||
| 453 | voff2 = i2c_smbus_read_byte_data(client, reg + i + 0x08); | ||
| 454 | if (voff2 < 0) | ||
| 455 | return voff2; | ||
| 456 | |||
| 457 | voff1 &= bits; | ||
| 458 | voff2 &= bits; | ||
| 459 | |||
| 460 | if (v != voff1 || v != voff2) | ||
| 461 | return -ENODEV; | ||
| 462 | } | ||
| 463 | |||
| 464 | return 0; | ||
| 465 | } | ||
| 466 | |||
| 467 | static int ltc4245_detect(struct i2c_client *client, | ||
| 468 | int kind, | ||
| 469 | struct i2c_board_info *info) | ||
| 470 | { | ||
| 471 | struct i2c_adapter *adapter = client->adapter; | ||
| 472 | |||
| 473 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | ||
| 474 | return -ENODEV; | ||
| 475 | |||
| 476 | if (kind < 0) { /* probed detection - check the chip type */ | ||
| 477 | s32 v; /* 8 bits from the chip, or -ERRNO */ | ||
| 478 | |||
| 479 | /* Chip registers 0x00-0x07 are control registers | ||
| 480 | * Chip registers 0x10-0x1f are data registers | ||
| 481 | * | ||
| 482 | * Address bits b7-b5 are ignored. This makes the chip "repeat" | ||
| 483 | * in steps of 0x20. Any control registers should appear with | ||
| 484 | * the same values across all duplicated addresses. | ||
| 485 | * | ||
| 486 | * Register 0x02 bit b2 is reserved, expect 0 | ||
| 487 | * Register 0x07 bits b7 to b4 are reserved, expect 0 | ||
| 488 | * | ||
| 489 | * Registers 0x01, 0x02 are control registers and should not | ||
| 490 | * change on their own. | ||
| 491 | * | ||
| 492 | * Register 0x06 bits b6 and b7 are control bits, and should | ||
| 493 | * not change on their own. | ||
| 494 | * | ||
| 495 | * Register 0x07 bits b3 to b0 are control bits, and should | ||
| 496 | * not change on their own. | ||
| 497 | */ | ||
| 498 | |||
| 499 | /* read register 0x02 reserved bit, expect 0 */ | ||
| 500 | v = i2c_smbus_read_byte_data(client, LTC4245_CONTROL); | ||
| 501 | if (v < 0 || (v & 0x04) != 0) | ||
| 502 | return -ENODEV; | ||
| 503 | |||
| 504 | /* read register 0x07 reserved bits, expect 0 */ | ||
| 505 | v = i2c_smbus_read_byte_data(client, LTC4245_ADCADR); | ||
| 506 | if (v < 0 || (v & 0xf0) != 0) | ||
| 507 | return -ENODEV; | ||
| 508 | |||
| 509 | /* check that the alert register appears at all locations */ | ||
| 510 | if (ltc4245_check_control_reg(client, LTC4245_ALERT, 0xff)) | ||
| 511 | return -ENODEV; | ||
| 512 | |||
| 513 | /* check that the control register appears at all locations */ | ||
| 514 | if (ltc4245_check_control_reg(client, LTC4245_CONTROL, 0xff)) | ||
| 515 | return -ENODEV; | ||
| 516 | |||
| 517 | /* check that register 0x06 bits b6 and b7 stay constant */ | ||
| 518 | if (ltc4245_check_control_reg(client, LTC4245_GPIO, 0xc0)) | ||
| 519 | return -ENODEV; | ||
| 520 | |||
| 521 | /* check that register 0x07 bits b3-b0 stay constant */ | ||
| 522 | if (ltc4245_check_control_reg(client, LTC4245_ADCADR, 0x0f)) | ||
| 523 | return -ENODEV; | ||
| 524 | } | ||
| 525 | |||
| 526 | strlcpy(info->type, "ltc4245", I2C_NAME_SIZE); | ||
| 527 | dev_info(&adapter->dev, "ltc4245 %s at address 0x%02x\n", | ||
| 528 | kind < 0 ? "probed" : "forced", | ||
| 529 | client->addr); | ||
| 530 | |||
| 531 | return 0; | ||
| 532 | } | ||
| 533 | |||
| 534 | static const struct i2c_device_id ltc4245_id[] = { | 416 | static const struct i2c_device_id ltc4245_id[] = { |
| 535 | { "ltc4245", ltc4245 }, | 417 | { "ltc4245", 0 }, |
| 536 | { } | 418 | { } |
| 537 | }; | 419 | }; |
| 538 | MODULE_DEVICE_TABLE(i2c, ltc4245_id); | 420 | MODULE_DEVICE_TABLE(i2c, ltc4245_id); |
| 539 | 421 | ||
| 540 | /* This is the driver that will be inserted */ | 422 | /* This is the driver that will be inserted */ |
| 541 | static struct i2c_driver ltc4245_driver = { | 423 | static struct i2c_driver ltc4245_driver = { |
| 542 | .class = I2C_CLASS_HWMON, | ||
| 543 | .driver = { | 424 | .driver = { |
| 544 | .name = "ltc4245", | 425 | .name = "ltc4245", |
| 545 | }, | 426 | }, |
| 546 | .probe = ltc4245_probe, | 427 | .probe = ltc4245_probe, |
| 547 | .remove = ltc4245_remove, | 428 | .remove = ltc4245_remove, |
| 548 | .id_table = ltc4245_id, | 429 | .id_table = ltc4245_id, |
| 549 | .detect = ltc4245_detect, | ||
| 550 | .address_data = &addr_data, | ||
| 551 | }; | 430 | }; |
| 552 | 431 | ||
| 553 | static int __init ltc4245_init(void) | 432 | static int __init ltc4245_init(void) |
diff --git a/drivers/i2c/busses/i2c-amd756.c b/drivers/i2c/busses/i2c-amd756.c index f7d6fe9c49ba..8f0b90ef8c76 100644 --- a/drivers/i2c/busses/i2c-amd756.c +++ b/drivers/i2c/busses/i2c-amd756.c | |||
| @@ -364,7 +364,7 @@ static int __devinit amd756_probe(struct pci_dev *pdev, | |||
| 364 | error = acpi_check_region(amd756_ioport, SMB_IOSIZE, | 364 | error = acpi_check_region(amd756_ioport, SMB_IOSIZE, |
| 365 | amd756_driver.name); | 365 | amd756_driver.name); |
| 366 | if (error) | 366 | if (error) |
| 367 | return error; | 367 | return -ENODEV; |
| 368 | 368 | ||
| 369 | if (!request_region(amd756_ioport, SMB_IOSIZE, amd756_driver.name)) { | 369 | if (!request_region(amd756_ioport, SMB_IOSIZE, amd756_driver.name)) { |
| 370 | dev_err(&pdev->dev, "SMB region 0x%x already in use!\n", | 370 | dev_err(&pdev->dev, "SMB region 0x%x already in use!\n", |
diff --git a/drivers/i2c/busses/i2c-amd8111.c b/drivers/i2c/busses/i2c-amd8111.c index a7c59908c457..5b4ad86ca166 100644 --- a/drivers/i2c/busses/i2c-amd8111.c +++ b/drivers/i2c/busses/i2c-amd8111.c | |||
| @@ -376,8 +376,10 @@ static int __devinit amd8111_probe(struct pci_dev *dev, | |||
| 376 | smbus->size = pci_resource_len(dev, 0); | 376 | smbus->size = pci_resource_len(dev, 0); |
| 377 | 377 | ||
| 378 | error = acpi_check_resource_conflict(&dev->resource[0]); | 378 | error = acpi_check_resource_conflict(&dev->resource[0]); |
| 379 | if (error) | 379 | if (error) { |
| 380 | error = -ENODEV; | ||
| 380 | goto out_kfree; | 381 | goto out_kfree; |
| 382 | } | ||
| 381 | 383 | ||
| 382 | if (!request_region(smbus->base, smbus->size, amd8111_driver.name)) { | 384 | if (!request_region(smbus->base, smbus->size, amd8111_driver.name)) { |
| 383 | error = -EBUSY; | 385 | error = -EBUSY; |
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index 9d2c5adf5d4f..55edcfe5b851 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c | |||
| @@ -732,8 +732,10 @@ static int __devinit i801_probe(struct pci_dev *dev, const struct pci_device_id | |||
| 732 | } | 732 | } |
| 733 | 733 | ||
| 734 | err = acpi_check_resource_conflict(&dev->resource[SMBBAR]); | 734 | err = acpi_check_resource_conflict(&dev->resource[SMBBAR]); |
| 735 | if (err) | 735 | if (err) { |
| 736 | err = -ENODEV; | ||
| 736 | goto exit; | 737 | goto exit; |
| 738 | } | ||
| 737 | 739 | ||
| 738 | err = pci_request_region(dev, SMBBAR, i801_driver.name); | 740 | err = pci_request_region(dev, SMBBAR, i801_driver.name); |
| 739 | if (err) { | 741 | if (err) { |
diff --git a/drivers/i2c/busses/i2c-isch.c b/drivers/i2c/busses/i2c-isch.c index 9f6b8e0f8632..dba6eb053e2f 100644 --- a/drivers/i2c/busses/i2c-isch.c +++ b/drivers/i2c/busses/i2c-isch.c | |||
| @@ -281,7 +281,7 @@ static int __devinit sch_probe(struct pci_dev *dev, | |||
| 281 | return -ENODEV; | 281 | return -ENODEV; |
| 282 | } | 282 | } |
| 283 | if (acpi_check_region(sch_smba, SMBIOSIZE, sch_driver.name)) | 283 | if (acpi_check_region(sch_smba, SMBIOSIZE, sch_driver.name)) |
| 284 | return -EBUSY; | 284 | return -ENODEV; |
| 285 | if (!request_region(sch_smba, SMBIOSIZE, sch_driver.name)) { | 285 | if (!request_region(sch_smba, SMBIOSIZE, sch_driver.name)) { |
| 286 | dev_err(&dev->dev, "SMBus region 0x%x already in use!\n", | 286 | dev_err(&dev->dev, "SMBus region 0x%x already in use!\n", |
| 287 | sch_smba); | 287 | sch_smba); |
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c index a782c7a08f9e..d26a972aacaa 100644 --- a/drivers/i2c/busses/i2c-piix4.c +++ b/drivers/i2c/busses/i2c-piix4.c | |||
| @@ -169,7 +169,7 @@ static int __devinit piix4_setup(struct pci_dev *PIIX4_dev, | |||
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | if (acpi_check_region(piix4_smba, SMBIOSIZE, piix4_driver.name)) | 171 | if (acpi_check_region(piix4_smba, SMBIOSIZE, piix4_driver.name)) |
| 172 | return -EBUSY; | 172 | return -ENODEV; |
| 173 | 173 | ||
| 174 | if (!request_region(piix4_smba, SMBIOSIZE, piix4_driver.name)) { | 174 | if (!request_region(piix4_smba, SMBIOSIZE, piix4_driver.name)) { |
| 175 | dev_err(&PIIX4_dev->dev, "SMBus region 0x%x already in use!\n", | 175 | dev_err(&PIIX4_dev->dev, "SMBus region 0x%x already in use!\n", |
| @@ -260,7 +260,7 @@ static int __devinit piix4_setup_sb800(struct pci_dev *PIIX4_dev, | |||
| 260 | 260 | ||
| 261 | piix4_smba = ((smba_en_hi << 8) | smba_en_lo) & 0xffe0; | 261 | piix4_smba = ((smba_en_hi << 8) | smba_en_lo) & 0xffe0; |
| 262 | if (acpi_check_region(piix4_smba, SMBIOSIZE, piix4_driver.name)) | 262 | if (acpi_check_region(piix4_smba, SMBIOSIZE, piix4_driver.name)) |
| 263 | return -EBUSY; | 263 | return -ENODEV; |
| 264 | 264 | ||
| 265 | if (!request_region(piix4_smba, SMBIOSIZE, piix4_driver.name)) { | 265 | if (!request_region(piix4_smba, SMBIOSIZE, piix4_driver.name)) { |
| 266 | dev_err(&PIIX4_dev->dev, "SMBus region 0x%x already in use!\n", | 266 | dev_err(&PIIX4_dev->dev, "SMBus region 0x%x already in use!\n", |
diff --git a/drivers/i2c/busses/i2c-sis96x.c b/drivers/i2c/busses/i2c-sis96x.c index 8295885b2fdb..1649963b00dc 100644 --- a/drivers/i2c/busses/i2c-sis96x.c +++ b/drivers/i2c/busses/i2c-sis96x.c | |||
| @@ -280,7 +280,7 @@ static int __devinit sis96x_probe(struct pci_dev *dev, | |||
| 280 | 280 | ||
| 281 | retval = acpi_check_resource_conflict(&dev->resource[SIS96x_BAR]); | 281 | retval = acpi_check_resource_conflict(&dev->resource[SIS96x_BAR]); |
| 282 | if (retval) | 282 | if (retval) |
| 283 | return retval; | 283 | return -ENODEV; |
| 284 | 284 | ||
| 285 | /* Everything is happy, let's grab the memory and set things up. */ | 285 | /* Everything is happy, let's grab the memory and set things up. */ |
| 286 | if (!request_region(sis96x_smbus_base, SMB_IOSIZE, | 286 | if (!request_region(sis96x_smbus_base, SMB_IOSIZE, |
diff --git a/drivers/i2c/busses/i2c-viapro.c b/drivers/i2c/busses/i2c-viapro.c index 54d810a4d00f..e4b1543015af 100644 --- a/drivers/i2c/busses/i2c-viapro.c +++ b/drivers/i2c/busses/i2c-viapro.c | |||
| @@ -365,7 +365,7 @@ static int __devinit vt596_probe(struct pci_dev *pdev, | |||
| 365 | found: | 365 | found: |
| 366 | error = acpi_check_region(vt596_smba, 8, vt596_driver.name); | 366 | error = acpi_check_region(vt596_smba, 8, vt596_driver.name); |
| 367 | if (error) | 367 | if (error) |
| 368 | return error; | 368 | return -ENODEV; |
| 369 | 369 | ||
| 370 | if (!request_region(vt596_smba, 8, vt596_driver.name)) { | 370 | if (!request_region(vt596_smba, 8, vt596_driver.name)) { |
| 371 | dev_err(&pdev->dev, "SMBus region 0x%x already in use!\n", | 371 | dev_err(&pdev->dev, "SMBus region 0x%x already in use!\n", |
diff --git a/drivers/leds/leds-pca9532.c b/drivers/leds/leds-pca9532.c index 708a8017c21d..adc561eb59d2 100644 --- a/drivers/leds/leds-pca9532.c +++ b/drivers/leds/leds-pca9532.c | |||
| @@ -19,9 +19,6 @@ | |||
| 19 | #include <linux/workqueue.h> | 19 | #include <linux/workqueue.h> |
| 20 | #include <linux/leds-pca9532.h> | 20 | #include <linux/leds-pca9532.h> |
| 21 | 21 | ||
| 22 | static const unsigned short normal_i2c[] = { /*0x60,*/ I2C_CLIENT_END}; | ||
| 23 | I2C_CLIENT_INSMOD_1(pca9532); | ||
| 24 | |||
| 25 | #define PCA9532_REG_PSC(i) (0x2+(i)*2) | 22 | #define PCA9532_REG_PSC(i) (0x2+(i)*2) |
| 26 | #define PCA9532_REG_PWM(i) (0x3+(i)*2) | 23 | #define PCA9532_REG_PWM(i) (0x3+(i)*2) |
| 27 | #define PCA9532_REG_LS0 0x6 | 24 | #define PCA9532_REG_LS0 0x6 |
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c index fde377c60cca..556f0feaa4df 100644 --- a/drivers/macintosh/therm_adt746x.c +++ b/drivers/macintosh/therm_adt746x.c | |||
| @@ -124,6 +124,8 @@ read_reg(struct thermostat* th, int reg) | |||
| 124 | return data; | 124 | return data; |
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | static struct i2c_driver thermostat_driver; | ||
| 128 | |||
| 127 | static int | 129 | static int |
| 128 | attach_thermostat(struct i2c_adapter *adapter) | 130 | attach_thermostat(struct i2c_adapter *adapter) |
| 129 | { | 131 | { |
| @@ -148,7 +150,7 @@ attach_thermostat(struct i2c_adapter *adapter) | |||
| 148 | * Let i2c-core delete that device on driver removal. | 150 | * Let i2c-core delete that device on driver removal. |
| 149 | * This is safe because i2c-core holds the core_lock mutex for us. | 151 | * This is safe because i2c-core holds the core_lock mutex for us. |
| 150 | */ | 152 | */ |
| 151 | list_add_tail(&client->detected, &client->driver->clients); | 153 | list_add_tail(&client->detected, &thermostat_driver.clients); |
| 152 | return 0; | 154 | return 0; |
| 153 | } | 155 | } |
| 154 | 156 | ||
diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c index a028598af2d3..ea32c7e5a9af 100644 --- a/drivers/macintosh/therm_pm72.c +++ b/drivers/macintosh/therm_pm72.c | |||
| @@ -286,6 +286,8 @@ struct fcu_fan_table fcu_fans[] = { | |||
| 286 | }, | 286 | }, |
| 287 | }; | 287 | }; |
| 288 | 288 | ||
| 289 | static struct i2c_driver therm_pm72_driver; | ||
| 290 | |||
| 289 | /* | 291 | /* |
| 290 | * Utility function to create an i2c_client structure and | 292 | * Utility function to create an i2c_client structure and |
| 291 | * attach it to one of u3 adapters | 293 | * attach it to one of u3 adapters |
| @@ -318,7 +320,7 @@ static struct i2c_client *attach_i2c_chip(int id, const char *name) | |||
| 318 | * Let i2c-core delete that device on driver removal. | 320 | * Let i2c-core delete that device on driver removal. |
| 319 | * This is safe because i2c-core holds the core_lock mutex for us. | 321 | * This is safe because i2c-core holds the core_lock mutex for us. |
| 320 | */ | 322 | */ |
| 321 | list_add_tail(&clt->detected, &clt->driver->clients); | 323 | list_add_tail(&clt->detected, &therm_pm72_driver.clients); |
| 322 | return clt; | 324 | return clt; |
| 323 | } | 325 | } |
| 324 | 326 | ||
diff --git a/drivers/macintosh/windfarm_lm75_sensor.c b/drivers/macintosh/windfarm_lm75_sensor.c index 529886c7a826..ed6426a10773 100644 --- a/drivers/macintosh/windfarm_lm75_sensor.c +++ b/drivers/macintosh/windfarm_lm75_sensor.c | |||
| @@ -115,6 +115,8 @@ static int wf_lm75_probe(struct i2c_client *client, | |||
| 115 | return rc; | 115 | return rc; |
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | static struct i2c_driver wf_lm75_driver; | ||
| 119 | |||
| 118 | static struct i2c_client *wf_lm75_create(struct i2c_adapter *adapter, | 120 | static struct i2c_client *wf_lm75_create(struct i2c_adapter *adapter, |
| 119 | u8 addr, int ds1775, | 121 | u8 addr, int ds1775, |
| 120 | const char *loc) | 122 | const char *loc) |
| @@ -157,7 +159,7 @@ static struct i2c_client *wf_lm75_create(struct i2c_adapter *adapter, | |||
| 157 | * Let i2c-core delete that device on driver removal. | 159 | * Let i2c-core delete that device on driver removal. |
| 158 | * This is safe because i2c-core holds the core_lock mutex for us. | 160 | * This is safe because i2c-core holds the core_lock mutex for us. |
| 159 | */ | 161 | */ |
| 160 | list_add_tail(&client->detected, &client->driver->clients); | 162 | list_add_tail(&client->detected, &wf_lm75_driver.clients); |
| 161 | return client; | 163 | return client; |
| 162 | fail: | 164 | fail: |
| 163 | return NULL; | 165 | return NULL; |
diff --git a/drivers/macintosh/windfarm_max6690_sensor.c b/drivers/macintosh/windfarm_max6690_sensor.c index e2a55ecda2b2..a67b349319e9 100644 --- a/drivers/macintosh/windfarm_max6690_sensor.c +++ b/drivers/macintosh/windfarm_max6690_sensor.c | |||
| @@ -88,6 +88,8 @@ static int wf_max6690_probe(struct i2c_client *client, | |||
| 88 | return rc; | 88 | return rc; |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | static struct i2c_driver wf_max6690_driver; | ||
| 92 | |||
| 91 | static struct i2c_client *wf_max6690_create(struct i2c_adapter *adapter, | 93 | static struct i2c_client *wf_max6690_create(struct i2c_adapter *adapter, |
| 92 | u8 addr, const char *loc) | 94 | u8 addr, const char *loc) |
| 93 | { | 95 | { |
| @@ -119,7 +121,7 @@ static struct i2c_client *wf_max6690_create(struct i2c_adapter *adapter, | |||
| 119 | * Let i2c-core delete that device on driver removal. | 121 | * Let i2c-core delete that device on driver removal. |
| 120 | * This is safe because i2c-core holds the core_lock mutex for us. | 122 | * This is safe because i2c-core holds the core_lock mutex for us. |
| 121 | */ | 123 | */ |
| 122 | list_add_tail(&client->detected, &client->driver->clients); | 124 | list_add_tail(&client->detected, &wf_max6690_driver.clients); |
| 123 | return client; | 125 | return client; |
| 124 | 126 | ||
| 125 | fail: | 127 | fail: |
diff --git a/drivers/macintosh/windfarm_smu_sat.c b/drivers/macintosh/windfarm_smu_sat.c index 5da729e58f99..e20330a28959 100644 --- a/drivers/macintosh/windfarm_smu_sat.c +++ b/drivers/macintosh/windfarm_smu_sat.c | |||
| @@ -194,6 +194,8 @@ static struct wf_sensor_ops wf_sat_ops = { | |||
| 194 | .owner = THIS_MODULE, | 194 | .owner = THIS_MODULE, |
| 195 | }; | 195 | }; |
| 196 | 196 | ||
| 197 | static struct i2c_driver wf_sat_driver; | ||
| 198 | |||
| 197 | static void wf_sat_create(struct i2c_adapter *adapter, struct device_node *dev) | 199 | static void wf_sat_create(struct i2c_adapter *adapter, struct device_node *dev) |
| 198 | { | 200 | { |
| 199 | struct i2c_board_info info; | 201 | struct i2c_board_info info; |
| @@ -222,7 +224,7 @@ static void wf_sat_create(struct i2c_adapter *adapter, struct device_node *dev) | |||
| 222 | * Let i2c-core delete that device on driver removal. | 224 | * Let i2c-core delete that device on driver removal. |
| 223 | * This is safe because i2c-core holds the core_lock mutex for us. | 225 | * This is safe because i2c-core holds the core_lock mutex for us. |
| 224 | */ | 226 | */ |
| 225 | list_add_tail(&client->detected, &client->driver->clients); | 227 | list_add_tail(&client->detected, &wf_sat_driver.clients); |
| 226 | } | 228 | } |
| 227 | 229 | ||
| 228 | static int wf_sat_probe(struct i2c_client *client, | 230 | static int wf_sat_probe(struct i2c_client *client, |
diff --git a/drivers/mfd/ab3100-core.c b/drivers/mfd/ab3100-core.c index 5447da16a170..613481028272 100644 --- a/drivers/mfd/ab3100-core.c +++ b/drivers/mfd/ab3100-core.c | |||
| @@ -57,8 +57,6 @@ | |||
| 57 | * The AB3100 is usually assigned address 0x48 (7-bit) | 57 | * The AB3100 is usually assigned address 0x48 (7-bit) |
| 58 | * The chip is defined in the platform i2c_board_data section. | 58 | * The chip is defined in the platform i2c_board_data section. |
| 59 | */ | 59 | */ |
| 60 | static unsigned short normal_i2c[] = { 0x48, I2C_CLIENT_END }; | ||
| 61 | I2C_CLIENT_INSMOD_1(ab3100); | ||
| 62 | 60 | ||
| 63 | u8 ab3100_get_chip_type(struct ab3100 *ab3100) | 61 | u8 ab3100_get_chip_type(struct ab3100 *ab3100) |
| 64 | { | 62 | { |
| @@ -966,7 +964,7 @@ static int __exit ab3100_remove(struct i2c_client *client) | |||
| 966 | } | 964 | } |
| 967 | 965 | ||
| 968 | static const struct i2c_device_id ab3100_id[] = { | 966 | static const struct i2c_device_id ab3100_id[] = { |
| 969 | { "ab3100", ab3100 }, | 967 | { "ab3100", 0 }, |
| 970 | { } | 968 | { } |
| 971 | }; | 969 | }; |
| 972 | MODULE_DEVICE_TABLE(i2c, ab3100_id); | 970 | MODULE_DEVICE_TABLE(i2c, ab3100_id); |
diff --git a/drivers/misc/eeprom/max6875.c b/drivers/misc/eeprom/max6875.c index 3c0c58eed347..5a6b2bce8ad5 100644 --- a/drivers/misc/eeprom/max6875.c +++ b/drivers/misc/eeprom/max6875.c | |||
| @@ -33,12 +33,6 @@ | |||
| 33 | #include <linux/i2c.h> | 33 | #include <linux/i2c.h> |
| 34 | #include <linux/mutex.h> | 34 | #include <linux/mutex.h> |
| 35 | 35 | ||
| 36 | /* Do not scan - the MAX6875 access method will write to some EEPROM chips */ | ||
| 37 | static const unsigned short normal_i2c[] = { I2C_CLIENT_END }; | ||
| 38 | |||
| 39 | /* Insmod parameters */ | ||
| 40 | I2C_CLIENT_INSMOD_1(max6875); | ||
| 41 | |||
| 42 | /* The MAX6875 can only read/write 16 bytes at a time */ | 36 | /* The MAX6875 can only read/write 16 bytes at a time */ |
| 43 | #define SLICE_SIZE 16 | 37 | #define SLICE_SIZE 16 |
| 44 | #define SLICE_BITS 4 | 38 | #define SLICE_BITS 4 |
| @@ -146,31 +140,21 @@ static struct bin_attribute user_eeprom_attr = { | |||
| 146 | .read = max6875_read, | 140 | .read = max6875_read, |
| 147 | }; | 141 | }; |
| 148 | 142 | ||
| 149 | /* Return 0 if detection is successful, -ENODEV otherwise */ | 143 | static int max6875_probe(struct i2c_client *client, |
| 150 | static int max6875_detect(struct i2c_client *client, int kind, | 144 | const struct i2c_device_id *id) |
| 151 | struct i2c_board_info *info) | ||
| 152 | { | 145 | { |
| 153 | struct i2c_adapter *adapter = client->adapter; | 146 | struct i2c_adapter *adapter = client->adapter; |
| 147 | struct max6875_data *data; | ||
| 148 | int err; | ||
| 154 | 149 | ||
| 155 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WRITE_BYTE_DATA | 150 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WRITE_BYTE_DATA |
| 156 | | I2C_FUNC_SMBUS_READ_BYTE)) | 151 | | I2C_FUNC_SMBUS_READ_BYTE)) |
| 157 | return -ENODEV; | 152 | return -ENODEV; |
| 158 | 153 | ||
| 159 | /* Only check even addresses */ | 154 | /* Only bind to even addresses */ |
| 160 | if (client->addr & 1) | 155 | if (client->addr & 1) |
| 161 | return -ENODEV; | 156 | return -ENODEV; |
| 162 | 157 | ||
| 163 | strlcpy(info->type, "max6875", I2C_NAME_SIZE); | ||
| 164 | |||
| 165 | return 0; | ||
| 166 | } | ||
| 167 | |||
| 168 | static int max6875_probe(struct i2c_client *client, | ||
| 169 | const struct i2c_device_id *id) | ||
| 170 | { | ||
| 171 | struct max6875_data *data; | ||
| 172 | int err; | ||
| 173 | |||
| 174 | if (!(data = kzalloc(sizeof(struct max6875_data), GFP_KERNEL))) | 158 | if (!(data = kzalloc(sizeof(struct max6875_data), GFP_KERNEL))) |
| 175 | return -ENOMEM; | 159 | return -ENOMEM; |
| 176 | 160 | ||
| @@ -222,9 +206,6 @@ static struct i2c_driver max6875_driver = { | |||
| 222 | .probe = max6875_probe, | 206 | .probe = max6875_probe, |
| 223 | .remove = max6875_remove, | 207 | .remove = max6875_remove, |
| 224 | .id_table = max6875_id, | 208 | .id_table = max6875_id, |
| 225 | |||
| 226 | .detect = max6875_detect, | ||
| 227 | .address_data = &addr_data, | ||
| 228 | }; | 209 | }; |
| 229 | 210 | ||
| 230 | static int __init max6875_init(void) | 211 | static int __init max6875_init(void) |
diff --git a/drivers/staging/iio/light/tsl2561.c b/drivers/staging/iio/light/tsl2561.c index ea8a5efc19bc..fc2107f4c049 100644 --- a/drivers/staging/iio/light/tsl2561.c +++ b/drivers/staging/iio/light/tsl2561.c | |||
| @@ -239,10 +239,6 @@ static int __devexit tsl2561_remove(struct i2c_client *client) | |||
| 239 | return tsl2561_powerdown(client); | 239 | return tsl2561_powerdown(client); |
| 240 | } | 240 | } |
| 241 | 241 | ||
| 242 | static unsigned short normal_i2c[] = { 0x29, 0x39, 0x49, I2C_CLIENT_END }; | ||
| 243 | |||
| 244 | I2C_CLIENT_INSMOD; | ||
| 245 | |||
| 246 | static const struct i2c_device_id tsl2561_id[] = { | 242 | static const struct i2c_device_id tsl2561_id[] = { |
| 247 | { "tsl2561", 0 }, | 243 | { "tsl2561", 0 }, |
| 248 | { } | 244 | { } |
diff --git a/drivers/w1/masters/ds2482.c b/drivers/w1/masters/ds2482.c index df52cb355f7d..406caa6a71cb 100644 --- a/drivers/w1/masters/ds2482.c +++ b/drivers/w1/masters/ds2482.c | |||
| @@ -24,19 +24,6 @@ | |||
| 24 | #include "../w1_int.h" | 24 | #include "../w1_int.h" |
| 25 | 25 | ||
| 26 | /** | 26 | /** |
| 27 | * Address is selected using 2 pins, resulting in 4 possible addresses. | ||
| 28 | * 0x18, 0x19, 0x1a, 0x1b | ||
| 29 | * However, the chip cannot be detected without doing an i2c write, | ||
| 30 | * so use the force module parameter. | ||
| 31 | */ | ||
| 32 | static const unsigned short normal_i2c[] = { I2C_CLIENT_END }; | ||
| 33 | |||
| 34 | /** | ||
| 35 | * Insmod parameters | ||
| 36 | */ | ||
| 37 | I2C_CLIENT_INSMOD_1(ds2482); | ||
| 38 | |||
| 39 | /** | ||
| 40 | * The DS2482 registers - there are 3 registers that are addressed by a read | 27 | * The DS2482 registers - there are 3 registers that are addressed by a read |
| 41 | * pointer. The read pointer is set by the last command executed. | 28 | * pointer. The read pointer is set by the last command executed. |
| 42 | * | 29 | * |
| @@ -96,8 +83,6 @@ static const u8 ds2482_chan_rd[8] = | |||
| 96 | 83 | ||
| 97 | static int ds2482_probe(struct i2c_client *client, | 84 | static int ds2482_probe(struct i2c_client *client, |
| 98 | const struct i2c_device_id *id); | 85 | const struct i2c_device_id *id); |
| 99 | static int ds2482_detect(struct i2c_client *client, int kind, | ||
| 100 | struct i2c_board_info *info); | ||
| 101 | static int ds2482_remove(struct i2c_client *client); | 86 | static int ds2482_remove(struct i2c_client *client); |
| 102 | 87 | ||
| 103 | 88 | ||
| @@ -117,8 +102,6 @@ static struct i2c_driver ds2482_driver = { | |||
| 117 | .probe = ds2482_probe, | 102 | .probe = ds2482_probe, |
| 118 | .remove = ds2482_remove, | 103 | .remove = ds2482_remove, |
| 119 | .id_table = ds2482_id, | 104 | .id_table = ds2482_id, |
| 120 | .detect = ds2482_detect, | ||
| 121 | .address_data = &addr_data, | ||
| 122 | }; | 105 | }; |
| 123 | 106 | ||
| 124 | /* | 107 | /* |
| @@ -425,19 +408,6 @@ static u8 ds2482_w1_reset_bus(void *data) | |||
| 425 | } | 408 | } |
| 426 | 409 | ||
| 427 | 410 | ||
| 428 | static int ds2482_detect(struct i2c_client *client, int kind, | ||
| 429 | struct i2c_board_info *info) | ||
| 430 | { | ||
| 431 | if (!i2c_check_functionality(client->adapter, | ||
| 432 | I2C_FUNC_SMBUS_WRITE_BYTE_DATA | | ||
| 433 | I2C_FUNC_SMBUS_BYTE)) | ||
| 434 | return -ENODEV; | ||
| 435 | |||
| 436 | strlcpy(info->type, "ds2482", I2C_NAME_SIZE); | ||
| 437 | |||
| 438 | return 0; | ||
| 439 | } | ||
| 440 | |||
| 441 | static int ds2482_probe(struct i2c_client *client, | 411 | static int ds2482_probe(struct i2c_client *client, |
| 442 | const struct i2c_device_id *id) | 412 | const struct i2c_device_id *id) |
| 443 | { | 413 | { |
| @@ -446,6 +416,11 @@ static int ds2482_probe(struct i2c_client *client, | |||
| 446 | int temp1; | 416 | int temp1; |
| 447 | int idx; | 417 | int idx; |
| 448 | 418 | ||
| 419 | if (!i2c_check_functionality(client->adapter, | ||
| 420 | I2C_FUNC_SMBUS_WRITE_BYTE_DATA | | ||
| 421 | I2C_FUNC_SMBUS_BYTE)) | ||
| 422 | return -ENODEV; | ||
| 423 | |||
| 449 | if (!(data = kzalloc(sizeof(struct ds2482_data), GFP_KERNEL))) { | 424 | if (!(data = kzalloc(sizeof(struct ds2482_data), GFP_KERNEL))) { |
| 450 | err = -ENOMEM; | 425 | err = -ENOMEM; |
| 451 | goto exit; | 426 | goto exit; |
