mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
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>
This commit is contained in:
parent
20af74ef14
commit
85f4f39c80
1 changed files with 2 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue