Re: [PATCH] ALSA: hda: cirrus_scodec: fix an error code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 27/9/23 13:44, Dan Carpenter wrote:
The "ret" variable is zero but we should return -EINVAL.

Fixes: 2144833e7b41 ("ALSA: hda: cirrus_scodec: Add KUnit test")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
---
  sound/pci/hda/cirrus_scodec_test.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/pci/hda/cirrus_scodec_test.c b/sound/pci/hda/cirrus_scodec_test.c
index 5eb590cd4fe2..8ae373676bd1 100644
--- a/sound/pci/hda/cirrus_scodec_test.c
+++ b/sound/pci/hda/cirrus_scodec_test.c
@@ -137,8 +137,8 @@ static int cirrus_scodec_test_create_gpio(struct kunit *test)
  	priv->gpio_priv = dev_get_drvdata(&priv->gpio_pdev->dev);
  	if (!priv->gpio_priv) {
  		platform_device_put(priv->gpio_pdev);
-		KUNIT_FAIL(test, "Failed to get gpio private data: %d\n", ret);
-		return ret;
+		KUNIT_FAIL(test, "Failed to get gpio private data\n");
+		return -EINVAL;
  	}
return 0;

Reviewed-by: Richard Fitzgerald <rf@xxxxxxxxxxxxxxxxxxxxx>

Thanks.



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux