aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_pm.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2012-12-06 00:17:12 -0500
committerBen Skeggs <bskeggs@redhat.com>2013-02-20 01:00:26 -0500
commit5e90a88cb37b665cc0609f1236d6099421139449 (patch)
tree8d4893c9e035e5d1f3d0ecf8018b3eb3cf9eb7f1 /drivers/gpu/drm/nouveau/nouveau_pm.c
parentb2c36312c9532491ca38275c3862e5c5dfac6033 (diff)
drm/nouveau/hwmon: create hwmon attributes under hwmon device in sysfs
From browsing my /sys, a few other things seem to do this, and it looks cleaner this way too :) 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.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_pm.c b/drivers/gpu/drm/nouveau/nouveau_pm.c
index 3a6ee7e48753..bb54098c6d97 100644
--- a/drivers/gpu/drm/nouveau/nouveau_pm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_pm.c
@@ -932,7 +932,7 @@ nouveau_hwmon_init(struct drm_device *dev)
932 dev_set_drvdata(hwmon_dev, dev); 932 dev_set_drvdata(hwmon_dev, dev);
933 933
934 /* default sysfs entries */ 934 /* default sysfs entries */
935 ret = sysfs_create_group(&dev->pdev->dev.kobj, &hwmon_attrgroup); 935 ret = sysfs_create_group(&hwmon_dev->kobj, &hwmon_attrgroup);
936 if (ret) { 936 if (ret) {
937 if (ret) 937 if (ret)
938 goto error; 938 goto error;
@@ -943,7 +943,7 @@ nouveau_hwmon_init(struct drm_device *dev)
943 * the gpio entries for pwm fan control even when there's no 943 * the gpio entries for pwm fan control even when there's no
944 * actual fan connected to it... therm table? */ 944 * actual fan connected to it... therm table? */
945 if (therm->fan_get && therm->fan_get(therm) >= 0) { 945 if (therm->fan_get && therm->fan_get(therm) >= 0) {
946 ret = sysfs_create_group(&dev->pdev->dev.kobj, 946 ret = sysfs_create_group(&hwmon_dev->kobj,
947 &hwmon_pwm_fan_attrgroup); 947 &hwmon_pwm_fan_attrgroup);
948 if (ret) 948 if (ret)
949 goto error; 949 goto error;
@@ -951,7 +951,7 @@ nouveau_hwmon_init(struct drm_device *dev)
951 951
952 /* if the card can read the fan rpm */ 952 /* if the card can read the fan rpm */
953 if (therm->fan_sense(therm) >= 0) { 953 if (therm->fan_sense(therm) >= 0) {
954 ret = sysfs_create_group(&dev->pdev->dev.kobj, 954 ret = sysfs_create_group(&hwmon_dev->kobj,
955 &hwmon_fan_rpm_attrgroup); 955 &hwmon_fan_rpm_attrgroup);
956 if (ret) 956 if (ret)
957 goto error; 957 goto error;
@@ -979,10 +979,10 @@ nouveau_hwmon_fini(struct drm_device *dev)
979 struct nouveau_pm *pm = nouveau_pm(dev); 979 struct nouveau_pm *pm = nouveau_pm(dev);
980 980
981 if (pm->hwmon) { 981 if (pm->hwmon) {
982 sysfs_remove_group(&dev->pdev->dev.kobj, &hwmon_attrgroup); 982 sysfs_remove_group(&pm->hwmon->kobj, &hwmon_attrgroup);
983 sysfs_remove_group(&dev->pdev->dev.kobj, 983 sysfs_remove_group(&pm->hwmon->kobj,
984 &hwmon_pwm_fan_attrgroup); 984 &hwmon_pwm_fan_attrgroup);
985 sysfs_remove_group(&dev->pdev->dev.kobj, 985 sysfs_remove_group(&pm->hwmon->kobj,
986 &hwmon_fan_rpm_attrgroup); 986 &hwmon_fan_rpm_attrgroup);
987 987
988 hwmon_device_unregister(pm->hwmon); 988 hwmon_device_unregister(pm->hwmon);