mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
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>
This commit is contained in:
parent
78c0a5056c
commit
d940667742
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user