GenWQE: use kobj_to_dev()
authorGeliang Tang <geliangtang@163.com>
Wed, 13 Jan 2016 15:30:12 +0000 (23:30 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Feb 2016 22:57:30 +0000 (14:57 -0800)
Use kobj_to_dev() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/genwqe/card_sysfs.c

index 6ab31eff0536a2a2572bb6e39a952931959c958d..c24c9b7c1dd374eed51254d647dce21fd2587ec8 100644 (file)
@@ -278,7 +278,7 @@ static umode_t genwqe_is_visible(struct kobject *kobj,
                                 struct attribute *attr, int n)
 {
        unsigned int j;
-       struct device *dev = container_of(kobj, struct device, kobj);
+       struct device *dev = kobj_to_dev(kobj);
        struct genwqe_dev *cd = dev_get_drvdata(dev);
        umode_t mode = attr->mode;