diff mbox series

[v1,27/43] i2c: Add log_ret() on error

Message ID 20200615035738.248710-16-sjg@chromium.org
State Accepted
Commit c61c8efd477c075b75b22ebd7b0e845a39a7d105
Headers show
Series x86: Programmatic generation of ACPI tables (Part C) | expand

Commit Message

Simon Glass June 15, 2020, 3:57 a.m. UTC
Add a few of these calls to make it easier to see where an error occurs,
if CONFIG_LOG_ERROR_RETURN is enabled.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 drivers/i2c/i2c-uclass.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Wolfgang Wallner June 25, 2020, 12:45 p.m. UTC | #1
Hi Simon,

-----"Simon Glass" <sjg at chromium.org> schrieb: -----
> Betreff: [PATCH v1 27/43] i2c: Add log_ret() on error
> 
> Add a few of these calls to make it easier to see where an error occurs,
> if CONFIG_LOG_ERROR_RETURN is enabled.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
> 
>  drivers/i2c/i2c-uclass.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Wolfgang Wallner <wolfgang.wallner at br-automation.com>
Bin Meng June 30, 2020, 7:54 a.m. UTC | #2
On Mon, Jun 15, 2020 at 11:58 AM Simon Glass <sjg at chromium.org> wrote:
>
> Add a few of these calls to make it easier to see where an error occurs,
> if CONFIG_LOG_ERROR_RETURN is enabled.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
>  drivers/i2c/i2c-uclass.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
diff mbox series

Patch

diff --git a/drivers/i2c/i2c-uclass.c b/drivers/i2c/i2c-uclass.c
index 8bc69e870f..2373aa2ea4 100644
--- a/drivers/i2c/i2c-uclass.c
+++ b/drivers/i2c/i2c-uclass.c
@@ -458,7 +458,7 @@  int i2c_set_chip_offset_len(struct udevice *dev, uint offset_len)
 	struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
 
 	if (offset_len > I2C_MAX_OFFSET_LEN)
-		return -EINVAL;
+		return log_ret(-EINVAL);
 	chip->offset_len = offset_len;
 
 	return 0;
@@ -625,7 +625,7 @@  int i2c_chip_ofdata_to_platdata(struct udevice *dev, struct dm_i2c_chip *chip)
 	if (addr == -1) {
 		debug("%s: I2C Node '%s' has no 'reg' property %s\n", __func__,
 		      dev_read_name(dev), dev->name);
-		return -EINVAL;
+		return log_ret(-EINVAL);
 	}
 	chip->chip_addr = addr;