public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] eeprom: ee1004: Check chip before probing
@ 2025-02-18 22:09 Eddie James
  0 siblings, 0 replies; only message in thread
From: Eddie James @ 2025-02-18 22:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: arnd, gregkh, eajames

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

Signed-off-by: Eddie James <eajames@linux.ibm.com>
---
 drivers/misc/eeprom/ee1004.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/misc/eeprom/ee1004.c b/drivers/misc/eeprom/ee1004.c
index 89224d4af4a20..e13f9fdd9d7b1 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);
-- 
2.43.5


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-02-18 22:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-18 22:09 [PATCH] eeprom: ee1004: Check chip before probing Eddie James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox