Guenter Roeck 1f2ff6935b eeprom: ee1004: Call i2c_new_scanned_device to instantiate thermal sensor
[ Upstream commit 249b4deaff71cfc6ac9a8e436af876be6d84052b ]

Instantiating a device by calling i2c_new_client_device() assumes that the
device is not already instantiated. If that is not the case, it will return
an error and generate a misleading kernel log message.

i2c i2c-0: Failed to register i2c client jc42 at 0x18 (-16)

This can be reproduced by unloading the ee1004 driver and loading it again.

Avoid this by calling i2c_new_scanned_device() instead, which returns
silently if a device is already instantiated or does not exist.

Fixes: 393bd1000f81 ("eeprom: ee1004: add support for temperature sensor")
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240629173716.20389-1-linux@roeck-us.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-08-03 09:00:14 +02:00
..
2023-12-08 12:02:37 +01:00
2024-05-18 12:39:20 -07:00
2024-07-04 12:21:39 +02:00
2024-01-08 16:22:47 -08:00
2024-05-08 19:21:51 +01:00
2023-11-01 20:51:41 -10:00
2023-10-27 08:51:00 +02:00
2024-04-11 15:12:13 +02:00
2024-05-22 08:31:17 -04:00
2024-01-15 12:10:41 -06:00