Commit 47679cde authored by Geliang Tang's avatar Geliang Tang Committed by Greg Kroah-Hartman

misc: c2port: use kobj_to_dev()

Use kobj_to_dev() instead of open-coding it.
Signed-off-by: default avatarGeliang Tang <geliangtang@163.com>
Reviewed-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 85016ff3
...@@ -721,9 +721,7 @@ static ssize_t c2port_read_flash_data(struct file *filp, struct kobject *kobj, ...@@ -721,9 +721,7 @@ static ssize_t c2port_read_flash_data(struct file *filp, struct kobject *kobj,
struct bin_attribute *attr, struct bin_attribute *attr,
char *buffer, loff_t offset, size_t count) char *buffer, loff_t offset, size_t count)
{ {
struct c2port_device *c2dev = struct c2port_device *c2dev = dev_get_drvdata(kobj_to_dev(kobj));
dev_get_drvdata(container_of(kobj,
struct device, kobj));
ssize_t ret; ssize_t ret;
/* Check the device and flash access status */ /* Check the device and flash access status */
...@@ -838,9 +836,7 @@ static ssize_t c2port_write_flash_data(struct file *filp, struct kobject *kobj, ...@@ -838,9 +836,7 @@ static ssize_t c2port_write_flash_data(struct file *filp, struct kobject *kobj,
struct bin_attribute *attr, struct bin_attribute *attr,
char *buffer, loff_t offset, size_t count) char *buffer, loff_t offset, size_t count)
{ {
struct c2port_device *c2dev = struct c2port_device *c2dev = dev_get_drvdata(kobj_to_dev(kobj));
dev_get_drvdata(container_of(kobj,
struct device, kobj));
int ret; int ret;
/* Check the device access status */ /* Check the device access status */
......
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