drm/radeon: use kobj_to_dev()
authorGeliang Tang <geliangtang@163.com>
Wed, 13 Jan 2016 14:48:43 +0000 (22:48 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 13 Jan 2016 17:15:53 +0000 (12:15 -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/radeon/radeon_pm.c

index 59abebd6b5dc42d4941131adb51b76ab677d3fd4..460c8f2989daca1ba9af3b7ba59d724c27182c1c 100644 (file)
@@ -713,7 +713,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 radeon_device *rdev = dev_get_drvdata(dev);
        umode_t effective_mode = attr->mode;