Skip to content

Commit d850042

Browse files
Eddie Jamesgregkh
authored andcommitted
eeprom: ee1004: Check chip before probing
[ Upstream commit d940667 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 011a62d commit d850042

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)