diff mbox series

[18/32] x86: sound: Correct error handling

Message ID 20200928042611.1696178-17-sjg@chromium.org
State New
Delegated to: Bin Meng
Headers show
Series x86: Allow Coral to boot into Chrome OS | expand

Commit Message

Simon Glass Sept. 28, 2020, 4:25 a.m. UTC
A few functions have changed to return pin numbers or I2C addresses. The
error checking for some of the callers is therefore wrong. Fix them.

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

 drivers/sound/da7219.c    | 4 ++--
 drivers/sound/max98357a.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Bin Meng Oct. 16, 2020, 1:35 p.m. UTC | #1
On Mon, Sep 28, 2020 at 12:26 PM Simon Glass <sjg@chromium.org> wrote:
>
> A few functions have changed to return pin numbers or I2C addresses. The
> error checking for some of the callers is therefore wrong. Fix them.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  drivers/sound/da7219.c    | 4 ++--
>  drivers/sound/max98357a.c | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
>

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

Patch

diff --git a/drivers/sound/da7219.c b/drivers/sound/da7219.c
index 6bc1ad0036e..8d674bcb4fa 100644
--- a/drivers/sound/da7219.c
+++ b/drivers/sound/da7219.c
@@ -54,13 +54,13 @@  static int da7219_acpi_fill_ssdt(const struct udevice *dev,
 	acpigen_write_name(ctx, "_CRS");
 	acpigen_write_resourcetemplate_header(ctx);
 	ret = acpi_device_write_i2c_dev(ctx, dev);
-	if (ret)
+	if (ret < 0)
 		return log_msg_ret("i2c", ret);
 
 	/* Use either Interrupt() or GpioInt() */
 	ret = acpi_device_write_interrupt_or_gpio(ctx, (struct udevice *)dev,
 						  "req-gpios");
-	if (ret)
+	if (ret < 0)
 		return log_msg_ret("irq_gpio", ret);
 	acpigen_write_resourcetemplate_footer(ctx);
 
diff --git a/drivers/sound/max98357a.c b/drivers/sound/max98357a.c
index 827262d235c..b3d27a3616e 100644
--- a/drivers/sound/max98357a.c
+++ b/drivers/sound/max98357a.c
@@ -69,7 +69,7 @@  static int max98357a_acpi_fill_ssdt(const struct udevice *dev,
 	acpigen_write_name(ctx, "_CRS");
 	acpigen_write_resourcetemplate_header(ctx);
 	ret = acpi_device_write_gpio_desc(ctx, &priv->sdmode_gpio);
-	if (ret)
+	if (ret < 0)
 		return log_msg_ret("gpio", ret);
 	acpigen_write_resourcetemplate_footer(ctx);