drm/amdgpu: use kobj_to_dev()
authorGeliang Tang <geliangtang@163.com>
Wed, 13 Jan 2016 14:48:42 +0000 (22:48 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 13 Jan 2016 17:14:59 +0000 (12:14 -0500)
Use kobj_to_dev() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c

index 4386cbac7f976b8f64c5b211ad3130f8413d99e7..7d8d84eaea4a5ab258eb5dac4a383f6aff81850d 100644 (file)
@@ -326,7 +326,7 @@ static struct attribute *hwmon_attributes[] = {
 static umode_t hwmon_attributes_visible(struct kobject *kobj,
                                        struct attribute *attr, int index)
 {
-       struct device *dev = container_of(kobj, struct device, kobj);
+       struct device *dev = kobj_to_dev(kobj);
        struct amdgpu_device *adev = dev_get_drvdata(dev);
        umode_t effective_mode = attr->mode;