drm/radeon/pm: fix device_create_file return value checks.
authorDave Airlie <airlied@redhat.com>
Tue, 18 May 2010 09:00:14 +0000 (19:00 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 18 May 2010 08:58:56 +0000 (18:58 +1000)
print an error if these fail.

Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/radeon_pm.c

index c88edae33deb09d4cb8ac516358ec62ae8a5921f..a8d162c6f82966e83b482e41187af4a37e2b4957 100644 (file)
@@ -398,6 +398,7 @@ void radeon_pm_resume(struct radeon_device *rdev)
 
 int radeon_pm_init(struct radeon_device *rdev)
 {
+       int ret;
        /* default to profile method */
        rdev->pm.pm_method = PM_METHOD_PROFILE;
        rdev->pm.dynpm_state = DYNPM_STATE_DISABLED;
@@ -427,8 +428,12 @@ int radeon_pm_init(struct radeon_device *rdev)
                }
 
                /* where's the best place to put these? */
-               device_create_file(rdev->dev, &dev_attr_power_profile);
-               device_create_file(rdev->dev, &dev_attr_power_method);
+               ret = device_create_file(rdev->dev, &dev_attr_power_profile);
+               if (ret)
+                       DRM_ERROR("failed to create device file for power profile\n");
+               ret = device_create_file(rdev->dev, &dev_attr_power_method);
+               if (ret)
+                       DRM_ERROR("failed to create device file for power method\n");
 
 #ifdef CONFIG_ACPI
                rdev->acpi_nb.notifier_call = radeon_acpi_event;