aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-10-07 17:12:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-07 17:12:21 -0400
commit87840a2b7e048018d18d60bdac5c09224de85370 (patch)
tree87e9f8a2317e39358f5ea189d79ef2158de5faf8 /drivers/misc
parent2ab704a47e0f27df758840a589aec3298dbb98dd (diff)
parent662786a5429c3a992c6f884a647ee32424822358 (diff)
Merge branch 'i2c/for-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c updates from Wolfram Sang: "Here is the 4.9 pull request from I2C including: - centralized error messages when registering to the core - improved lockdep annotations to prevent false positives - DT support for muxes, gates, and arbitrators - bus speeds can now be obtained from ACPI - i2c-octeon got refactored and now supports ThunderX SoCs, too - i2c-tegra and i2c-designware got a bigger bunch of updates - a couple of standard driver fixes and improvements" * 'i2c/for-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (71 commits) i2c: axxia: disable clks in case of failure in probe i2c: octeon: thunderx: Limit register access retries i2c: uniphier-f: fix misdetection of incomplete STOP condition gpio: pca953x: variable 'id' was used twice i2c: i801: Add support for Kaby Lake PCH-H gpio: pca953x: fix an incorrect lockdep warning i2c: add a warning to i2c_adapter_depth() lockdep: make MAX_LOCKDEP_SUBCLASSES unconditionally visible i2c: export i2c_adapter_depth() i2c: rk3x: Fix variable 'min_total_ns' unused warning i2c: rk3x: Fix sparse warning i2c / ACPI: Do not touch an I2C device if it belongs to another adapter i2c: octeon: Fix high-level controller status check i2c: octeon: Avoid sending STOP during recovery i2c: octeon: Fix set SCL recovery function i2c: rcar: add support for r8a7796 (R-Car M3-W) i2c: imx: make bus recovery through pinctrl optional i2c: meson: add gxbb compatible string i2c: uniphier-f: set the adapter to master mode when probing i2c: uniphier-f: avoid WARN_ON() of clk_disable() in failure path ...
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/eeprom/at24.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index 3cdf8e1ca0ad..051b14766ef9 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -593,6 +593,7 @@ static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
593 struct at24_data *at24; 593 struct at24_data *at24;
594 int err; 594 int err;
595 unsigned i, num_addresses; 595 unsigned i, num_addresses;
596 u8 test_byte;
596 597
597 if (client->dev.platform_data) { 598 if (client->dev.platform_data) {
598 chip = *(struct at24_platform_data *)client->dev.platform_data; 599 chip = *(struct at24_platform_data *)client->dev.platform_data;
@@ -743,6 +744,18 @@ static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
743 } 744 }
744 } 745 }
745 746
747 i2c_set_clientdata(client, at24);
748
749 /*
750 * Perform a one-byte test read to verify that the
751 * chip is functional.
752 */
753 err = at24_read(at24, 0, &test_byte, 1);
754 if (err) {
755 err = -ENODEV;
756 goto err_clients;
757 }
758
746 at24->nvmem_config.name = dev_name(&client->dev); 759 at24->nvmem_config.name = dev_name(&client->dev);
747 at24->nvmem_config.dev = &client->dev; 760 at24->nvmem_config.dev = &client->dev;
748 at24->nvmem_config.read_only = !writable; 761 at24->nvmem_config.read_only = !writable;
@@ -764,8 +777,6 @@ static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
764 goto err_clients; 777 goto err_clients;
765 } 778 }
766 779
767 i2c_set_clientdata(client, at24);
768
769 dev_info(&client->dev, "%u byte %s EEPROM, %s, %u bytes/write\n", 780 dev_info(&client->dev, "%u byte %s EEPROM, %s, %u bytes/write\n",
770 chip.byte_len, client->name, 781 chip.byte_len, client->name,
771 writable ? "writable" : "read-only", at24->write_max); 782 writable ? "writable" : "read-only", at24->write_max);