drivers/acpi/acpi_video.c | 11 ++++------- drivers/acpi/video_detect.c | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-)
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
In acpi_video_bus_check() and find_video(), simply replace
acpi_get_pci_dev() with acpi_dev_get_pci_dev() that can be used
in both places because the ACPI device needed to do the lookup is
available.
In acpi_video_dev_register_backlight(), instead of doing a parent ACPI
handle lookup based on the handle of an ACPI device that is already
available, pass that ACPI device to acpi_dev_parent() which is much
more straightforward and pass the return value of the latter directly
to acpi_dev_get_pci_dev() to get the PCI device associated with it.
That allows local variable acpi_parent to be eliminated.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/acpi/acpi_video.c | 11 ++++-------
drivers/acpi/video_detect.c | 2 +-
2 files changed, 5 insertions(+), 8 deletions(-)
--- a/drivers/acpi/acpi_video.c
+++ b/drivers/acpi/acpi_video.c
@@ -1048,7 +1048,7 @@ static int acpi_video_bus_check(struct a
if (!video)
return -EINVAL;
- dev = acpi_get_pci_dev(video->device->handle);
+ dev = acpi_dev_get_pci_dev(video->device);
if (!dev)
return -ENODEV;
pci_dev_put(dev);
@@ -1702,7 +1702,6 @@ static void acpi_video_dev_register_back
{
struct backlight_properties props;
struct pci_dev *pdev;
- acpi_handle acpi_parent;
struct device *parent = NULL;
int result;
static int count;
@@ -1717,11 +1716,9 @@ static void acpi_video_dev_register_back
return;
count++;
- if (ACPI_SUCCESS(acpi_get_parent(device->dev->handle, &acpi_parent))) {
- pdev = acpi_get_pci_dev(acpi_parent);
- if (pdev)
- parent = &pdev->dev;
- }
+ pdev = acpi_dev_get_pci_dev(acpi_dev_parent(device->dev));
+ if (pdev)
+ parent = &pdev->dev;
memset(&props, 0, sizeof(struct backlight_properties));
props.type = BACKLIGHT_FIRMWARE;
--- a/drivers/acpi/video_detect.c
+++ b/drivers/acpi/video_detect.c
@@ -73,7 +73,7 @@ find_video(acpi_handle handle, u32 lvl,
};
if (acpi_dev && !acpi_match_device_ids(acpi_dev, video_ids)) {
- dev = acpi_get_pci_dev(handle);
+ dev = acpi_dev_get_pci_dev(acpi_dev);
if (!dev)
return AE_OK;
pci_dev_put(dev);
On Wed, Jul 15, 2026 at 05:21:23PM +0200, Rafael J. Wysocki wrote:
> In acpi_video_bus_check() and find_video(), simply replace
> acpi_get_pci_dev() with acpi_dev_get_pci_dev() that can be used
> in both places because the ACPI device needed to do the lookup is
> available.
>
> In acpi_video_dev_register_backlight(), instead of doing a parent ACPI
> handle lookup based on the handle of an ACPI device that is already
> available, pass that ACPI device to acpi_dev_parent() which is much
> more straightforward and pass the return value of the latter directly
> to acpi_dev_get_pci_dev() to get the PCI device associated with it.
> That allows local variable acpi_parent to be eliminated.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
...
> +++ b/drivers/acpi/video_detect.c
> if (acpi_dev && !acpi_match_device_ids(acpi_dev, video_ids)) {
> - dev = acpi_get_pci_dev(handle);
> + dev = acpi_dev_get_pci_dev(acpi_dev);
This likely needs to be rebased on top of the series I sent?
--
With Best Regards,
Andy Shevchenko
On Wed, Jul 15, 2026 at 5:59 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Wed, Jul 15, 2026 at 05:21:23PM +0200, Rafael J. Wysocki wrote:
>
> > In acpi_video_bus_check() and find_video(), simply replace
> > acpi_get_pci_dev() with acpi_dev_get_pci_dev() that can be used
> > in both places because the ACPI device needed to do the lookup is
> > available.
> >
> > In acpi_video_dev_register_backlight(), instead of doing a parent ACPI
> > handle lookup based on the handle of an ACPI device that is already
> > available, pass that ACPI device to acpi_dev_parent() which is much
> > more straightforward and pass the return value of the latter directly
> > to acpi_dev_get_pci_dev() to get the PCI device associated with it.
> > That allows local variable acpi_parent to be eliminated.
>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Thanks!
> ...
>
> > +++ b/drivers/acpi/video_detect.c
>
> > if (acpi_dev && !acpi_match_device_ids(acpi_dev, video_ids)) {
> > - dev = acpi_get_pci_dev(handle);
> > + dev = acpi_dev_get_pci_dev(acpi_dev);
>
> This likely needs to be rebased on top of the series I sent?
Probably.
© 2016 - 2026 Red Hat, Inc.