drm/radeon/kms: Skip ACPI call to ATIF when possible
authorJean Delvare <jdelvare@suse.de>
Wed, 30 Nov 2011 16:36:39 +0000 (17:36 +0100)
committerDave Airlie <airlied@redhat.com>
Thu, 1 Dec 2011 09:57:34 +0000 (09:57 +0000)
I am under the impression that it only makes sense to call the ATIF
method if the graphics device has an ACPI handle attached. So we could
skip the call altogether if there is no such handle.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/radeon_acpi.c

index c039e5a6bf134e2cdb85f18548474f8dac49bda1..3516a6081dcfcc3acb35d4d64286ea0f321da01e 100644 (file)
@@ -51,13 +51,13 @@ int radeon_acpi_init(struct radeon_device *rdev)
        acpi_handle handle;
        int ret;
 
-       /* No need to proceed if we're sure that ATIF is not supported */
-       if (!ASIC_IS_AVIVO(rdev) || !rdev->bios)
-               return 0;
-
        /* Get the device handle */
        handle = DEVICE_ACPI_HANDLE(&rdev->pdev->dev);
 
+       /* No need to proceed if we're sure that ATIF is not supported */
+       if (!ASIC_IS_AVIVO(rdev) || !rdev->bios || !handle)
+               return 0;
+
        /* Call the ATIF method */
        ret = radeon_atif_call(handle);
        if (ret)