Skip to contentSkip to conversation

eeprom: ee1004: Check chip before probing

PATCH New Eddie James 1 participant 1 message Feb 18, 2025 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eeprom: ee1004: Check chip before probing

Like other eeprom drivers, check if the device is really there and functional before probing.

---
 drivers/misc/eeprom/ee1004.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/misc/eeprom/ee1004.c +4 -0
index 89224d4af4a20..e13f9fdd9d7b1 100644
@@ -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);
Signature · 1 line
2.43.5