Re: [PATCH 3/3] ACPI: video: Fix apple gmux detection

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

 



On Mon, Jan 23, 2023 at 1:38 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote:
>
> Some apple laptop models have an ACPI device with a HID of APP000B
> and that device has an IO resource (so it does not describe the new
> unsupported MMIO based gmux type), but there actually is no gmux
> in the laptop at all.
>
> The gmux_probe() function of the actual apple-gmux driver has code
> to detect this, this code has been factored out into a new
> apple_gmux_detect() helper in apple-gmux.h.
>
> Use this new function to fix acpi_video_get_backlight_type() wrongly
> returning apple_gmux as type on these new laptops.

...

> -static bool apple_gmux_backlight_present(void)
> -{
> -       struct acpi_device *adev;
> -       struct device *dev;
> -
> -       adev = acpi_dev_get_first_match_dev(GMUX_ACPI_HID, NULL, -1);
> -       if (!adev)
> -               return false;
> -
> -       dev = acpi_get_first_physical_node(adev);
> -       if (!dev)
> -               return false;
> -
> -       /*
> -        * drivers/platform/x86/apple-gmux.c only supports old style
> -        * Apple GMUX with an IO-resource.
> -        */
> -       return pnp_get_resource(to_pnp_dev(dev), IORESOURCE_IO, 0) != NULL;
> -}

Oh, the leak is already somewhere... Lemme cook a patch...

-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux