Commit a253f1ee authored by Geliang Tang's avatar Geliang Tang Committed by Linus Torvalds

rapidio: use kobj_to_dev()

Use kobj_to_dev() instead of open-coding it.
Signed-off-by: default avatarGeliang Tang <geliangtang@163.com>
Acked-by: default avatar"Bounine, Alexandre" <Alexandre.Bounine@idt.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 978e30c9
...@@ -125,8 +125,7 @@ rio_read_config(struct file *filp, struct kobject *kobj, ...@@ -125,8 +125,7 @@ rio_read_config(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr, struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t count) char *buf, loff_t off, size_t count)
{ {
struct rio_dev *dev = struct rio_dev *dev = to_rio_dev(kobj_to_dev(kobj));
to_rio_dev(container_of(kobj, struct device, kobj));
unsigned int size = 0x100; unsigned int size = 0x100;
loff_t init_off = off; loff_t init_off = off;
u8 *data = (u8 *) buf; u8 *data = (u8 *) buf;
...@@ -197,8 +196,7 @@ rio_write_config(struct file *filp, struct kobject *kobj, ...@@ -197,8 +196,7 @@ rio_write_config(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr, struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t count) char *buf, loff_t off, size_t count)
{ {
struct rio_dev *dev = struct rio_dev *dev = to_rio_dev(kobj_to_dev(kobj));
to_rio_dev(container_of(kobj, struct device, kobj));
unsigned int size = count; unsigned int size = count;
loff_t init_off = off; loff_t init_off = off;
u8 *data = (u8 *) buf; u8 *data = (u8 *) buf;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment