Commit 85f4f39c authored by Geliang Tang's avatar Geliang Tang Committed by Greg Kroah-Hartman

pch_phub: use kobj_to_dev()

Use kobj_to_dev() instead of open-coding it.
Signed-off-by: default avatarGeliang Tang <geliangtang@163.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 20af74ef
...@@ -503,8 +503,7 @@ static ssize_t pch_phub_bin_read(struct file *filp, struct kobject *kobj, ...@@ -503,8 +503,7 @@ static ssize_t pch_phub_bin_read(struct file *filp, struct kobject *kobj,
int err; int err;
ssize_t rom_size; ssize_t rom_size;
struct pch_phub_reg *chip = struct pch_phub_reg *chip = dev_get_drvdata(kobj_to_dev(kobj));
dev_get_drvdata(container_of(kobj, struct device, kobj));
ret = mutex_lock_interruptible(&pch_phub_mutex); ret = mutex_lock_interruptible(&pch_phub_mutex);
if (ret) { if (ret) {
...@@ -567,8 +566,7 @@ static ssize_t pch_phub_bin_write(struct file *filp, struct kobject *kobj, ...@@ -567,8 +566,7 @@ static ssize_t pch_phub_bin_write(struct file *filp, struct kobject *kobj,
unsigned int addr_offset; unsigned int addr_offset;
int ret; int ret;
ssize_t rom_size; ssize_t rom_size;
struct pch_phub_reg *chip = struct pch_phub_reg *chip = dev_get_drvdata(kobj_to_dev(kobj));
dev_get_drvdata(container_of(kobj, struct device, kobj));
ret = mutex_lock_interruptible(&pch_phub_mutex); ret = mutex_lock_interruptible(&pch_phub_mutex);
if (ret) if (ret)
......
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