aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_pm.c
diff options
context:
space:
mode:
authorMartin Peres <martin.peres@ensi-bourges.fr>2011-12-17 06:24:59 -0500
committerBen Skeggs <bskeggs@redhat.com>2012-03-13 03:06:04 -0400
commitddb2005516949dc50d117cb8381d7a3f8f0614b0 (patch)
tree1388f36a7ae6b7067ccd3040c36b1bd544c15d51 /drivers/gpu/drm/nouveau/nouveau_pm.c
parent668b6c097dbaf190f5d3974798fef37aee025385 (diff)
drm/nouveau/pm: style fixes
Signed-off-by: Martin Peres <martin.peres@labri.fr> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_pm.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_pm.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_pm.c b/drivers/gpu/drm/nouveau/nouveau_pm.c
index 9064d7f19794..1770f1569c90 100644
--- a/drivers/gpu/drm/nouveau/nouveau_pm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_pm.c
@@ -162,6 +162,7 @@ nouveau_pm_profile_set(struct drm_device *dev, const char *profile)
162 struct drm_nouveau_private *dev_priv = dev->dev_private; 162 struct drm_nouveau_private *dev_priv = dev->dev_private;
163 struct nouveau_pm_engine *pm = &dev_priv->engine.pm; 163 struct nouveau_pm_engine *pm = &dev_priv->engine.pm;
164 struct nouveau_pm_level *perflvl = NULL; 164 struct nouveau_pm_level *perflvl = NULL;
165 long pl;
165 166
166 /* safety precaution, for now */ 167 /* safety precaution, for now */
167 if (nouveau_perflvl_wr != 7777) 168 if (nouveau_perflvl_wr != 7777)
@@ -170,8 +171,9 @@ nouveau_pm_profile_set(struct drm_device *dev, const char *profile)
170 if (!strncmp(profile, "boot", 4)) 171 if (!strncmp(profile, "boot", 4))
171 perflvl = &pm->boot; 172 perflvl = &pm->boot;
172 else { 173 else {
173 int pl = simple_strtol(profile, NULL, 10);
174 int i; 174 int i;
175 if (kstrtol(profile, 10, &pl) == -EINVAL)
176 return -EINVAL;
175 177
176 for (i = 0; i < pm->nr_perflvl; i++) { 178 for (i = 0; i < pm->nr_perflvl; i++) {
177 if (pm->perflvl[i].id == pl) { 179 if (pm->perflvl[i].id == pl) {
@@ -397,7 +399,7 @@ nouveau_hwmon_set_max_temp(struct device *d, struct device_attribute *a,
397 struct nouveau_pm_threshold_temp *temp = &pm->threshold_temp; 399 struct nouveau_pm_threshold_temp *temp = &pm->threshold_temp;
398 long value; 400 long value;
399 401
400 if (strict_strtol(buf, 10, &value) == -EINVAL) 402 if (kstrtol(buf, 10, &value) == -EINVAL)
401 return count; 403 return count;
402 404
403 temp->down_clock = value/1000; 405 temp->down_clock = value/1000;
@@ -432,7 +434,7 @@ nouveau_hwmon_set_critical_temp(struct device *d, struct device_attribute *a,
432 struct nouveau_pm_threshold_temp *temp = &pm->threshold_temp; 434 struct nouveau_pm_threshold_temp *temp = &pm->threshold_temp;
433 long value; 435 long value;
434 436
435 if (strict_strtol(buf, 10, &value) == -EINVAL) 437 if (kstrtol(buf, 10, &value) == -EINVAL)
436 return count; 438 return count;
437 439
438 temp->critical = value/1000; 440 temp->critical = value/1000;
@@ -529,7 +531,7 @@ nouveau_hwmon_set_pwm0(struct device *d, struct device_attribute *a,
529 if (nouveau_perflvl_wr != 7777) 531 if (nouveau_perflvl_wr != 7777)
530 return -EPERM; 532 return -EPERM;
531 533
532 if (strict_strtol(buf, 10, &value) == -EINVAL) 534 if (kstrtol(buf, 10, &value) == -EINVAL)
533 return -EINVAL; 535 return -EINVAL;
534 536
535 if (value < pm->fan.min_duty) 537 if (value < pm->fan.min_duty)
@@ -568,7 +570,7 @@ nouveau_hwmon_set_pwm0_min(struct device *d, struct device_attribute *a,
568 struct nouveau_pm_engine *pm = &dev_priv->engine.pm; 570 struct nouveau_pm_engine *pm = &dev_priv->engine.pm;
569 long value; 571 long value;
570 572
571 if (strict_strtol(buf, 10, &value) == -EINVAL) 573 if (kstrtol(buf, 10, &value) == -EINVAL)
572 return -EINVAL; 574 return -EINVAL;
573 575
574 if (value < 0) 576 if (value < 0)
@@ -609,7 +611,7 @@ nouveau_hwmon_set_pwm0_max(struct device *d, struct device_attribute *a,
609 struct nouveau_pm_engine *pm = &dev_priv->engine.pm; 611 struct nouveau_pm_engine *pm = &dev_priv->engine.pm;
610 long value; 612 long value;
611 613
612 if (strict_strtol(buf, 10, &value) == -EINVAL) 614 if (kstrtol(buf, 10, &value) == -EINVAL)
613 return -EINVAL; 615 return -EINVAL;
614 616
615 if (value < 0) 617 if (value < 0)
@@ -731,8 +733,10 @@ nouveau_hwmon_fini(struct drm_device *dev)
731 733
732 if (pm->hwmon) { 734 if (pm->hwmon) {
733 sysfs_remove_group(&dev->pdev->dev.kobj, &hwmon_attrgroup); 735 sysfs_remove_group(&dev->pdev->dev.kobj, &hwmon_attrgroup);
734 sysfs_remove_group(&dev->pdev->dev.kobj, &hwmon_pwm_fan_attrgroup); 736 sysfs_remove_group(&dev->pdev->dev.kobj,
735 sysfs_remove_group(&dev->pdev->dev.kobj, &hwmon_fan_rpm_attrgroup); 737 &hwmon_pwm_fan_attrgroup);
738 sysfs_remove_group(&dev->pdev->dev.kobj,
739 &hwmon_fan_rpm_attrgroup);
736 740
737 hwmon_device_unregister(pm->hwmon); 741 hwmon_device_unregister(pm->hwmon);
738 } 742 }