[PATCH 2/2] ALSA: hda: tas2781-spi: Fix error code in tas2781_read_acpi()

From: Dan Carpenter
Date: Wed Jan 22 2025 - 02:18:58 EST


Propagate the error code from devm_gpiod_get_index_optional(). The
current code returns success.

Fixes: bb5f86ea50ff ("ALSA: hda/tas2781: Add tas2781 hda SPI driver")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
---
sound/pci/hda/tas2781_hda_spi.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/sound/pci/hda/tas2781_hda_spi.c b/sound/pci/hda/tas2781_hda_spi.c
index 02794fd6003d..eba9c3a3b944 100644
--- a/sound/pci/hda/tas2781_hda_spi.c
+++ b/sound/pci/hda/tas2781_hda_spi.c
@@ -447,6 +447,7 @@ static int tas2781_read_acpi(struct tas2781_hda *tas_hda,
p->reset = devm_gpiod_get_index_optional(physdev, "reset",
p->index, GPIOD_OUT_LOW);
if (IS_ERR(p->reset)) {
+ ret = PTR_ERR(p->reset);
dev_err_probe(p->dev, ret, "Failed on reset GPIO\n");
goto err;
}
--
2.45.2