public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] misc: c2port: use kobj_to_dev()
@ 2016-01-13 15:30 Geliang Tang
  2016-01-13 15:30 ` [PATCH 2/5] misc: cxl: " Geliang Tang
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Geliang Tang @ 2016-01-13 15:30 UTC (permalink / raw)
  To: Viresh Kumar, Jiri Kosina, Arnd Bergmann, Greg Kroah-Hartman
  Cc: Geliang Tang, linux-kernel

Use kobj_to_dev() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/misc/c2port/core.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/misc/c2port/core.c b/drivers/misc/c2port/core.c
index cc8645b..1922cb8 100644
--- a/drivers/misc/c2port/core.c
+++ b/drivers/misc/c2port/core.c
@@ -721,9 +721,7 @@ static ssize_t c2port_read_flash_data(struct file *filp, struct kobject *kobj,
 				struct bin_attribute *attr,
 				char *buffer, loff_t offset, size_t count)
 {
-	struct c2port_device *c2dev =
-			dev_get_drvdata(container_of(kobj,
-						struct device, kobj));
+	struct c2port_device *c2dev = dev_get_drvdata(kobj_to_dev(kobj));
 	ssize_t ret;
 
 	/* Check the device and flash access status */
@@ -838,9 +836,7 @@ static ssize_t c2port_write_flash_data(struct file *filp, struct kobject *kobj,
 				struct bin_attribute *attr,
 				char *buffer, loff_t offset, size_t count)
 {
-	struct c2port_device *c2dev =
-			dev_get_drvdata(container_of(kobj,
-						struct device, kobj));
+	struct c2port_device *c2dev = dev_get_drvdata(kobj_to_dev(kobj));
 	int ret;
 
 	/* Check the device access status */
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-01-14  9:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-13 15:30 [PATCH 1/5] misc: c2port: use kobj_to_dev() Geliang Tang
2016-01-13 15:30 ` [PATCH 2/5] misc: cxl: " Geliang Tang
2016-01-13 21:19   ` Michael Ellerman
2016-01-13 23:00   ` Andrew Donnellan
2016-01-13 15:30 ` [PATCH 3/5] pch_phub: " Geliang Tang
2016-01-13 15:30 ` [PATCH 4/5] misc: eeprom: " Geliang Tang
2016-01-13 15:30 ` [PATCH 5/5] GenWQE: " Geliang Tang
2016-01-14  9:43 ` [PATCH 1/5] misc: c2port: " Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox