]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ASoC: amd: yc: Fix the wrong return value
authorVenkata Prasad Potturu <venkataprasad.potturu@amd.com>
Tue, 10 Dec 2024 09:10:25 +0000 (14:40 +0530)
committerMark Brown <broonie@kernel.org>
Tue, 10 Dec 2024 12:44:15 +0000 (12:44 +0000)
With the current implementation, when ACP driver fails to read
ACPI _WOV entry then the DMI overrides code won't invoke,
may cause regressions for some BIOS versions.

Add a condition check to jump to check the DMI entries incase of
ACP driver fail to read ACPI _WOV method.

Fixes: 4095cf872084 (ASoC: amd: yc: Fix for enabling DMIC on acp6x via _DSD entry)
Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20241210091026.996860-1-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/amd/yc/acp6x-mach.c

index e38c5885dadfbc33a41723a96a656bbc622a7c65..ecf57a6cb7c37d546ba0e4890de26d6dc1de11f6 100644 (file)
@@ -578,14 +578,19 @@ static int acp6x_probe(struct platform_device *pdev)
 
        handle = ACPI_HANDLE(pdev->dev.parent);
        ret = acpi_evaluate_integer(handle, "_WOV", NULL, &dmic_status);
-       if (!ACPI_FAILURE(ret))
+       if (!ACPI_FAILURE(ret)) {
                wov_en = dmic_status;
+               if (!wov_en)
+                       return -ENODEV;
+       } else {
+               /* Incase of ACPI method read failure then jump to check_dmi_entry */
+               goto check_dmi_entry;
+       }
 
-       if (is_dmic_enable && wov_en)
+       if (is_dmic_enable)
                platform_set_drvdata(pdev, &acp6x_card);
-       else
-               return 0;
 
+check_dmi_entry:
        /* check for any DMI overrides */
        dmi_id = dmi_first_match(yc_acp_quirk_table);
        if (dmi_id)