diff options
author | Jean Delvare <jdelvare@suse.de> | 2013-09-10 04:30:44 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2013-09-11 11:44:36 -0400 |
commit | 3e4e21292d0089d4c87b933ab05c67824e940b9e (patch) | |
tree | 16f687e9d9646e43c47c0f1bb1b7ed9a931a446e | |
parent | 91f3a6aaf280294b07c05dfe606e6c27b7ba3c72 (diff) |
drm/radeon: simplify driver data retrieval
You can get the driver data from struct device directly, there's no
need to get the PCI device first.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: David Airlie <airlied@linux.ie>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_pm.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index d7555369a3e5..dea7dcbb3507 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c | |||
@@ -333,7 +333,7 @@ static ssize_t radeon_get_pm_profile(struct device *dev, | |||
333 | struct device_attribute *attr, | 333 | struct device_attribute *attr, |
334 | char *buf) | 334 | char *buf) |
335 | { | 335 | { |
336 | struct drm_device *ddev = pci_get_drvdata(to_pci_dev(dev)); | 336 | struct drm_device *ddev = dev_get_drvdata(dev); |
337 | struct radeon_device *rdev = ddev->dev_private; | 337 | struct radeon_device *rdev = ddev->dev_private; |
338 | int cp = rdev->pm.profile; | 338 | int cp = rdev->pm.profile; |
339 | 339 | ||
@@ -349,7 +349,7 @@ static ssize_t radeon_set_pm_profile(struct device *dev, | |||
349 | const char *buf, | 349 | const char *buf, |
350 | size_t count) | 350 | size_t count) |
351 | { | 351 | { |
352 | struct drm_device *ddev = pci_get_drvdata(to_pci_dev(dev)); | 352 | struct drm_device *ddev = dev_get_drvdata(dev); |
353 | struct radeon_device *rdev = ddev->dev_private; | 353 | struct radeon_device *rdev = ddev->dev_private; |
354 | 354 | ||
355 | mutex_lock(&rdev->pm.mutex); | 355 | mutex_lock(&rdev->pm.mutex); |
@@ -383,7 +383,7 @@ static ssize_t radeon_get_pm_method(struct device *dev, | |||
383 | struct device_attribute *attr, | 383 | struct device_attribute *attr, |
384 | char *buf) | 384 | char *buf) |
385 | { | 385 | { |
386 | struct drm_device *ddev = pci_get_drvdata(to_pci_dev(dev)); | 386 | struct drm_device *ddev = dev_get_drvdata(dev); |
387 | struct radeon_device *rdev = ddev->dev_private; | 387 | struct radeon_device *rdev = ddev->dev_private; |
388 | int pm = rdev->pm.pm_method; | 388 | int pm = rdev->pm.pm_method; |
389 | 389 | ||
@@ -397,7 +397,7 @@ static ssize_t radeon_set_pm_method(struct device *dev, | |||
397 | const char *buf, | 397 | const char *buf, |
398 | size_t count) | 398 | size_t count) |
399 | { | 399 | { |
400 | struct drm_device *ddev = pci_get_drvdata(to_pci_dev(dev)); | 400 | struct drm_device *ddev = dev_get_drvdata(dev); |
401 | struct radeon_device *rdev = ddev->dev_private; | 401 | struct radeon_device *rdev = ddev->dev_private; |
402 | 402 | ||
403 | /* we don't support the legacy modes with dpm */ | 403 | /* we don't support the legacy modes with dpm */ |
@@ -433,7 +433,7 @@ static ssize_t radeon_get_dpm_state(struct device *dev, | |||
433 | struct device_attribute *attr, | 433 | struct device_attribute *attr, |
434 | char *buf) | 434 | char *buf) |
435 | { | 435 | { |
436 | struct drm_device *ddev = pci_get_drvdata(to_pci_dev(dev)); | 436 | struct drm_device *ddev = dev_get_drvdata(dev); |
437 | struct radeon_device *rdev = ddev->dev_private; | 437 | struct radeon_device *rdev = ddev->dev_private; |
438 | enum radeon_pm_state_type pm = rdev->pm.dpm.user_state; | 438 | enum radeon_pm_state_type pm = rdev->pm.dpm.user_state; |
439 | 439 | ||
@@ -447,7 +447,7 @@ static ssize_t radeon_set_dpm_state(struct device *dev, | |||
447 | const char *buf, | 447 | const char *buf, |
448 | size_t count) | 448 | size_t count) |
449 | { | 449 | { |
450 | struct drm_device *ddev = pci_get_drvdata(to_pci_dev(dev)); | 450 | struct drm_device *ddev = dev_get_drvdata(dev); |
451 | struct radeon_device *rdev = ddev->dev_private; | 451 | struct radeon_device *rdev = ddev->dev_private; |
452 | 452 | ||
453 | mutex_lock(&rdev->pm.mutex); | 453 | mutex_lock(&rdev->pm.mutex); |
@@ -472,7 +472,7 @@ static ssize_t radeon_get_dpm_forced_performance_level(struct device *dev, | |||
472 | struct device_attribute *attr, | 472 | struct device_attribute *attr, |
473 | char *buf) | 473 | char *buf) |
474 | { | 474 | { |
475 | struct drm_device *ddev = pci_get_drvdata(to_pci_dev(dev)); | 475 | struct drm_device *ddev = dev_get_drvdata(dev); |
476 | struct radeon_device *rdev = ddev->dev_private; | 476 | struct radeon_device *rdev = ddev->dev_private; |
477 | enum radeon_dpm_forced_level level = rdev->pm.dpm.forced_level; | 477 | enum radeon_dpm_forced_level level = rdev->pm.dpm.forced_level; |
478 | 478 | ||
@@ -486,7 +486,7 @@ static ssize_t radeon_set_dpm_forced_performance_level(struct device *dev, | |||
486 | const char *buf, | 486 | const char *buf, |
487 | size_t count) | 487 | size_t count) |
488 | { | 488 | { |
489 | struct drm_device *ddev = pci_get_drvdata(to_pci_dev(dev)); | 489 | struct drm_device *ddev = dev_get_drvdata(dev); |
490 | struct radeon_device *rdev = ddev->dev_private; | 490 | struct radeon_device *rdev = ddev->dev_private; |
491 | enum radeon_dpm_forced_level level; | 491 | enum radeon_dpm_forced_level level; |
492 | int ret = 0; | 492 | int ret = 0; |
@@ -524,7 +524,7 @@ static ssize_t radeon_hwmon_show_temp(struct device *dev, | |||
524 | struct device_attribute *attr, | 524 | struct device_attribute *attr, |
525 | char *buf) | 525 | char *buf) |
526 | { | 526 | { |
527 | struct drm_device *ddev = pci_get_drvdata(to_pci_dev(dev)); | 527 | struct drm_device *ddev = dev_get_drvdata(dev); |
528 | struct radeon_device *rdev = ddev->dev_private; | 528 | struct radeon_device *rdev = ddev->dev_private; |
529 | int temp; | 529 | int temp; |
530 | 530 | ||