summaryrefslogtreecommitdiffstats
path: root/drivers/rapidio
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2016-01-21 00:00:39 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-21 02:09:18 +0100
commita253f1eee6c471d5418983ca9aa9c756e7db5db9 (patch)
tree21919694570251eb02c6eb0589d794561384132f /drivers/rapidio
parentkexec: move some memembers and definitions within the scope of CONFIG_KEXEC_FILE (diff)
downloadlinux-a253f1eee6c471d5418983ca9aa9c756e7db5db9.tar.xz
linux-a253f1eee6c471d5418983ca9aa9c756e7db5db9.zip
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>
Diffstat (limited to 'drivers/rapidio')
-rw-r--r--drivers/rapidio/rio-sysfs.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/rapidio/rio-sysfs.c b/drivers/rapidio/rio-sysfs.c
index cdb005c0094d..eda41563d06d 100644
--- a/drivers/rapidio/rio-sysfs.c
+++ b/drivers/rapidio/rio-sysfs.c
@@ -125,8 +125,7 @@ rio_read_config(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t count)
{
- struct rio_dev *dev =
- to_rio_dev(container_of(kobj, struct device, kobj));
+ struct rio_dev *dev = to_rio_dev(kobj_to_dev(kobj));
unsigned int size = 0x100;
loff_t init_off = off;
u8 *data = (u8 *) buf;
@@ -197,8 +196,7 @@ rio_write_config(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t count)
{
- struct rio_dev *dev =
- to_rio_dev(container_of(kobj, struct device, kobj));
+ struct rio_dev *dev = to_rio_dev(kobj_to_dev(kobj));
unsigned int size = count;
loff_t init_off = off;
u8 *data = (u8 *) buf;