]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
x86: sound: Correct error handling
authorSimon Glass <sjg@chromium.org>
Wed, 4 Nov 2020 16:57:29 +0000 (09:57 -0700)
committerBin Meng <bmeng.cn@gmail.com>
Fri, 6 Nov 2020 01:51:29 +0000 (09:51 +0800)
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>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
drivers/sound/da7219.c
drivers/sound/max98357a.c

index 6bc1ad0036e07b497ef2e5026e07f3790525c75d..8d674bcb4fa32788e237a50176b00407ce832d27 100644 (file)
@@ -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);
 
index 827262d235c7d491857d23c1d8e9f0b34aa83ded..b3d27a3616e83d74d888757644c456b6c228892c 100644 (file)
@@ -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);