Skip to content

Commit

Permalink
pch_phub: use kobj_to_dev()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Geliang Tang authored and Greg Kroah-Hartman committed Feb 8, 2016
1 parent 20af74e commit 85f4f39
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/misc/pch_phub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 85f4f39

Please sign in to comment.