From patchwork Mon Jan 6 07:57:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lokesh Vutla X-Patchwork-Id: 239127 List-Id: U-Boot discussion From: lokeshvutla at ti.com (Lokesh Vutla) Date: Mon, 6 Jan 2020 13:27:01 +0530 Subject: [PATCH 1/5] ti: common: board_detect: Handle EEPROM probe more gracefully In-Reply-To: <20200106075705.3717-1-lokeshvutla@ti.com> References: <20200106075705.3717-1-lokeshvutla@ti.com> Message-ID: <20200106075705.3717-2-lokeshvutla@ti.com> From: Andreas Dannenberg 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 Signed-off-by: Lokesh Vutla --- board/ti/common/board_detect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/ti/common/board_detect.c b/board/ti/common/board_detect.c index 564d2f7046..cf6bd02698 100644 --- a/board/ti/common/board_detect.c +++ b/board/ti/common/board_detect.c @@ -91,7 +91,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;