2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-27 06:34:11 +08:00

nouveau: ACPI: Use the ACPI_COMPANION() macro directly

The ACPI_HANDLE() macro is a wrapper arond the ACPI_COMPANION()
macro and the ACPI handle produced by the former comes from the
ACPI device object produced by the latter, so it is way more
straightforward to evaluate the latter directly instead of passing
the handle produced by the former to acpi_bus_get_device().

Modify nouveau_acpi_edid() accordingly (no intentional functional
impact).

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
Rafael J. Wysocki 2021-10-13 18:08:06 +02:00
parent 3906fe9bb7
commit ae364fd917

View File

@ -364,7 +364,6 @@ void *
nouveau_acpi_edid(struct drm_device *dev, struct drm_connector *connector)
{
struct acpi_device *acpidev;
acpi_handle handle;
int type, ret;
void *edid;
@ -377,12 +376,8 @@ nouveau_acpi_edid(struct drm_device *dev, struct drm_connector *connector)
return NULL;
}
handle = ACPI_HANDLE(dev->dev);
if (!handle)
return NULL;
ret = acpi_bus_get_device(handle, &acpidev);
if (ret)
acpidev = ACPI_COMPANION(dev->dev);
if (!acpidev)
return NULL;
ret = acpi_video_get_edid(acpidev, type, -1, &edid);