zorro: Use kobj_to_dev()
authorGeliang Tang <geliangtang@163.com>
Wed, 6 Jan 2016 15:28:39 +0000 (23:28 +0800)
committerGeert Uytterhoeven <geert@linux-m68k.org>
Mon, 25 Jan 2016 08:42:23 +0000 (09:42 +0100)
Use kobj_to_dev() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
drivers/zorro/zorro-sysfs.c

index 36b210f9b6b29621fa9e410db063d3df53d7fb75..9282dbf5abdba6b01e059a45e7fc9895002dbd2d 100644 (file)
@@ -65,8 +65,7 @@ static ssize_t zorro_read_config(struct file *filp, struct kobject *kobj,
                                 struct bin_attribute *bin_attr,
                                 char *buf, loff_t off, size_t count)
 {
-       struct zorro_dev *z = to_zorro_dev(container_of(kobj, struct device,
-                                          kobj));
+       struct zorro_dev *z = to_zorro_dev(kobj_to_dev(kobj));
        struct ConfigDev cd;
 
        /* Construct a ConfigDev */