diff options
author | 2025-02-18 16:09:59 -0600 | |
---|---|---|
committer | 2025-02-20 15:25:18 +0100 | |
commit | d9406677428e9234ea62bb2d2f5e996d1b777760 (patch) | |
tree | 72b4cf9024fb169077282d7594bec92f0845897b | |
parent | binder: remove unneeded <linux/export.h> inclusion from binder_internal.h (diff) | |
download | wireguard-linux-d9406677428e9234ea62bb2d2f5e996d1b777760.tar.xz wireguard-linux-d9406677428e9234ea62bb2d2f5e996d1b777760.zip |
eeprom: ee1004: Check chip before probing
Like other eeprom drivers, check if the device is really there and
functional before probing.
Signed-off-by: Eddie James <eajames@linux.ibm.com>
Link: https://lore.kernel.org/r/20250218220959.721698-1-eajames@linux.ibm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/misc/eeprom/ee1004.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/misc/eeprom/ee1004.c b/drivers/misc/eeprom/ee1004.c index 89224d4af4a2..e13f9fdd9d7b 100644 --- a/drivers/misc/eeprom/ee1004.c +++ b/drivers/misc/eeprom/ee1004.c @@ -304,6 +304,10 @@ static int ee1004_probe(struct i2c_client *client) I2C_FUNC_SMBUS_BYTE | I2C_FUNC_SMBUS_READ_BYTE_DATA)) return -EPFNOSUPPORT; + err = i2c_smbus_read_byte(client); + if (err < 0) + return -ENODEV; + mutex_lock(&ee1004_bus_lock); err = ee1004_init_bus_data(client); |