Skip to content

Commit

Permalink
w1: Use kobj_to_dev()[RESEND]
Browse files Browse the repository at this point in the history
Use kobj_to_dev() instead of open-coding it

Signed-off-by: dongjian <dongjian@yulong.com>
Link: https://lore.kernel.org/r/1615877987-32163-1-git-send-email-dj0227@163.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
dongjian authored and Greg Kroah-Hartman committed Mar 24, 2021
1 parent 199c4d0 commit b0ebbae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/w1/slaves/w1_ds2780.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static ssize_t w1_slave_read(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr, char *buf,
loff_t off, size_t count)
{
struct device *dev = container_of(kobj, struct device, kobj);
struct device *dev = kobj_to_dev(kobj);
return w1_ds2780_io(dev, buf, off, count, 0);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/w1/slaves/w1_ds2781.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static ssize_t w1_slave_read(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr, char *buf,
loff_t off, size_t count)
{
struct device *dev = container_of(kobj, struct device, kobj);
struct device *dev = kobj_to_dev(kobj);
return w1_ds2781_io(dev, buf, off, count, 0);
}

Expand Down

0 comments on commit b0ebbae

Please sign in to comment.