backlight: lm3533_bl: Use kobj_to_dev() instead
authorWang Qing <wangqing@vivo.com>
Mon, 15 Jun 2020 08:54:02 +0000 (16:54 +0800)
committerLee Jones <lee.jones@linaro.org>
Tue, 16 Jun 2020 08:03:04 +0000 (09:03 +0100)
Use kobj_to_dev() instead of container_of()

Signed-off-by: Wang Qing <wangqing@vivo.com>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/video/backlight/lm3533_bl.c

index ee09d1b..0c7830f 100644 (file)
@@ -235,7 +235,7 @@ static struct attribute *lm3533_bl_attributes[] = {
 static umode_t lm3533_bl_attr_is_visible(struct kobject *kobj,
                                             struct attribute *attr, int n)
 {
-       struct device *dev = container_of(kobj, struct device, kobj);
+       struct device *dev = kobj_to_dev(kobj);
        struct lm3533_bl *bl = dev_get_drvdata(dev);
        umode_t mode = attr->mode;