summaryrefslogtreecommitdiff
path: root/drivers/misc/pch_phub.c
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2016-01-13 18:30:10 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-09 01:57:30 +0300
commit85f4f39c80e9350da8a351e6ea36367fa9fb87a5 (patch)
tree45e3c86fb93b25e5034f0b2dc832974a6dae94b8 /drivers/misc/pch_phub.c
parent20af74ef140f0fbc477f90817c58241107782e10 (diff)
downloadlinux-85f4f39c80e9350da8a351e6ea36367fa9fb87a5.tar.xz
pch_phub: use kobj_to_dev()
Use kobj_to_dev() instead of open-coding it. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/pch_phub.c')
-rw-r--r--drivers/misc/pch_phub.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/misc/pch_phub.c b/drivers/misc/pch_phub.c
index 9a17a9bab8d6..15bb0c8cdda3 100644
--- a/drivers/misc/pch_phub.c
+++ b/drivers/misc/pch_phub.c
@@ -503,8 +503,7 @@ static ssize_t pch_phub_bin_read(struct file *filp, struct kobject *kobj,
int err;
ssize_t rom_size;
- struct pch_phub_reg *chip =
- dev_get_drvdata(container_of(kobj, struct device, kobj));
+ struct pch_phub_reg *chip = dev_get_drvdata(kobj_to_dev(kobj));
ret = mutex_lock_interruptible(&pch_phub_mutex);
if (ret) {
@@ -567,8 +566,7 @@ static ssize_t pch_phub_bin_write(struct file *filp, struct kobject *kobj,
unsigned int addr_offset;
int ret;
ssize_t rom_size;
- struct pch_phub_reg *chip =
- dev_get_drvdata(container_of(kobj, struct device, kobj));
+ struct pch_phub_reg *chip = dev_get_drvdata(kobj_to_dev(kobj));
ret = mutex_lock_interruptible(&pch_phub_mutex);
if (ret)