ti: common: board_detect: Handle EEPROM probe more gracefully

Use dm_i2c_probe() rather than i2c_get_chip() when trying to access
board-detection EEPROM devices. This has the advantage of more gracefully
handling the case when the EEPROM is not present by allowing to exit the
function early rather than failing and outputting an error message on the
I2C transactions that follow.

Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
This commit is contained in:
Andreas Dannenberg 2020-01-07 13:15:53 +05:30 committed by Lokesh Vutla
parent 019d123705
commit 499681e15e

View File

@ -94,7 +94,7 @@ static int __maybe_unused ti_i2c_eeprom_get(int bus_addr, int dev_addr,
rc = uclass_get_device_by_seq(UCLASS_I2C, bus_addr, &bus);
if (rc)
return rc;
rc = i2c_get_chip(bus, dev_addr, 1, &dev);
rc = dm_i2c_probe(bus, dev_addr, 0, &dev);
if (rc)
return rc;