Skip to content

Commit d940667

Browse files
Eddie Jamesgregkh
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 78c0a50 commit d940667

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/misc/eeprom/ee1004.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,10 @@ static int ee1004_probe(struct i2c_client *client)
304304
I2C_FUNC_SMBUS_BYTE | I2C_FUNC_SMBUS_READ_BYTE_DATA))
305305
return -EPFNOSUPPORT;
306306

307+
err = i2c_smbus_read_byte(client);
308+
if (err < 0)
309+
return -ENODEV;
310+
307311
mutex_lock(&ee1004_bus_lock);
308312

309313
err = ee1004_init_bus_data(client);

0 commit comments

Comments
 (0)