[PATCH v1 3/4] ACPI: video: Drop backlight parent device reference later

From: Rafael J. Wysocki

Date: Wed Jul 15 2026 - 11:39:10 EST


From: "Rafael J. Wysocki" <rafael.j.wysocki@xxxxxxxxx>

Update acpi_video_dev_register_backlight() to put the parent device after
registering the backlight class device under it instead of attempting to
register the backlight class device under a parent that (theoretically)
may be gone at that point.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
---
drivers/acpi/acpi_video.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

--- a/drivers/acpi/acpi_video.c
+++ b/drivers/acpi/acpi_video.c
@@ -1719,10 +1719,8 @@ static void acpi_video_dev_register_back

if (ACPI_SUCCESS(acpi_get_parent(device->dev->handle, &acpi_parent))) {
pdev = acpi_get_pci_dev(acpi_parent);
- if (pdev) {
+ if (pdev)
parent = &pdev->dev;
- pci_dev_put(pdev);
- }
}

memset(&props, 0, sizeof(struct backlight_properties));
@@ -1734,6 +1732,7 @@ static void acpi_video_dev_register_back
device,
&acpi_backlight_ops,
&props);
+ put_device(parent);
kfree(name);
if (IS_ERR(device->backlight)) {
device->backlight = NULL;