* [PATCH] rapidio: use kobj_to_dev()
@ 2016-01-06 15:15 Geliang Tang
2016-01-07 12:40 ` Bounine, Alexandre
0 siblings, 1 reply; 2+ messages in thread
From: Geliang Tang @ 2016-01-06 15:15 UTC (permalink / raw)
To: Matt Porter, Alexandre Bounine; +Cc: Geliang Tang, linux-kernel
Use kobj_to_dev() instead of open-coding it.
Signed-off-by: Geliang Tang <geliangtang@163.com>
---
drivers/rapidio/rio-sysfs.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/rapidio/rio-sysfs.c b/drivers/rapidio/rio-sysfs.c
index cdb005c..eda4156 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;
--
2.5.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [PATCH] rapidio: use kobj_to_dev()
2016-01-06 15:15 [PATCH] rapidio: use kobj_to_dev() Geliang Tang
@ 2016-01-07 12:40 ` Bounine, Alexandre
0 siblings, 0 replies; 2+ messages in thread
From: Bounine, Alexandre @ 2016-01-07 12:40 UTC (permalink / raw)
To: Andrew Morton, Geliang Tang, Matt Porter; +Cc: linux-kernel
Ack-ed.
Andrew, please apply this patch.
Thank you,
Alex.
-----Original Message-----
From: Geliang Tang [mailto:geliangtang@163.com]
Sent: Wednesday, January 06, 2016 10:16 AM
To: Matt Porter; Bounine, Alexandre
Cc: Geliang Tang; linux-kernel@vger.kernel.org
Subject: [PATCH] rapidio: use kobj_to_dev()
Use kobj_to_dev() instead of open-coding it.
Signed-off-by: Geliang Tang <geliangtang@163.com>
---
drivers/rapidio/rio-sysfs.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/rapidio/rio-sysfs.c b/drivers/rapidio/rio-sysfs.c
index cdb005c..eda4156 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;
--
2.5.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-01-07 12:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-06 15:15 [PATCH] rapidio: use kobj_to_dev() Geliang Tang
2016-01-07 12:40 ` Bounine, Alexandre
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.