ALSA: hda/hdmi - fix atpx_present when CLASS is not VGA
PATCH 1/1 ALSA: hda/hdmi - fix atpx_present when CLASS is not VGA
You can't use PCI_BASE_CLASS with pci_get_class(). This happens to work by luck on devices with PCI_CLASS_DISPLAY_VGA, but misses PCI_CLASS_DISPLAY_OTHER. Add a check for those as well.
Signed-off-by Alex Deucher <[email protected]>
--- sound/pci/hda/hda_intel.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
sound/pci/hda/hda_intel.c +11 -1
@@ -1410,7 +1410,17 @@ static bool atpx_present(void)acpi_handle dhandle, atpx_handle;acpi_status status; -while ((pdev =pci_get_class (PCI_BASE_CLASS_DISPLAY <<16 , pdev)) !=NULL ) { +while ((pdev =pci_get_class (PCI_CLASS_DISPLAY_VGA <<8 , pdev)) !=NULL ) { + dhandle =ACPI_HANDLE (&pdev->dev); +if (dhandle) { + status =acpi_get_handle (dhandle,"ATPX" , &atpx_handle); +if (!ACPI_FAILURE (status)) { +pci_dev_put (pdev); +return true; + } + } + } +while ((pdev =pci_get_class (PCI_CLASS_DISPLAY_OTHER <<8 , pdev)) !=NULL ) { dhandle =ACPI_HANDLE (&pdev->dev);if (dhandle) { status =acpi_get_handle (dhandle,"ATPX" , &atpx_handle);
Signature · 6 lines
2.24.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Takashi Iwai
AppliedQuoted 6 lines · Alex Deucher
You can't use
PCI_BASE_CLASSwithpci_get_class(). This happens to work by luck on devices withPCI_CLASS_DISPLAY_VGA, but missesPCI_CLASS_DISPLAY_OTHER. Add a check for those as well.Signed-off-by Alex Deucher <[email protected]>
Applied, thanks.
Takashi
_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel