Skip to content

Commit

Permalink
drm/radeon/pm: fix device_create_file return value checks.
Browse files Browse the repository at this point in the history
print an error if these fail.

Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Dave Airlie committed May 18, 2010
1 parent 4bff517 commit 26481fb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/gpu/drm/radeon/radeon_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 26481fb

Please sign in to comment.