Skip to content

Commit a253f1e

Browse files
geliangtangtorvalds
authored andcommitted
rapidio: use kobj_to_dev()
Use kobj_to_dev() instead of open-coding it. Signed-off-by: Geliang Tang <geliangtang@163.com> Acked-by: "Bounine, Alexandre" <Alexandre.Bounine@idt.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 978e30c commit a253f1e

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎drivers/rapidio/rio-sysfs.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@ rio_read_config(struct file *filp, struct kobject *kobj,
125125
struct bin_attribute *bin_attr,
126126
char *buf, loff_t off, size_t count)
127127
{
128-
struct rio_dev *dev =
129-
to_rio_dev(container_of(kobj, struct device, kobj));
128+
struct rio_dev *dev = to_rio_dev(kobj_to_dev(kobj));
130129
unsigned int size = 0x100;
131130
loff_t init_off = off;
132131
u8 *data = (u8 *) buf;
@@ -197,8 +196,7 @@ rio_write_config(struct file *filp, struct kobject *kobj,
197196
struct bin_attribute *bin_attr,
198197
char *buf, loff_t off, size_t count)
199198
{
200-
struct rio_dev *dev =
201-
to_rio_dev(container_of(kobj, struct device, kobj));
199+
struct rio_dev *dev = to_rio_dev(kobj_to_dev(kobj));
202200
unsigned int size = count;
203201
loff_t init_off = off;
204202
u8 *data = (u8 *) buf;

0 commit comments

Comments
 (0)