Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

w1: Use kobj_to_dev()[RESEND]

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>

authored by

dongjian and committed by
Greg Kroah-Hartman
b0ebbaee 199c4d0e

+2 -2
+1 -1
drivers/w1/slaves/w1_ds2780.c
··· 90 90 struct bin_attribute *bin_attr, char *buf, 91 91 loff_t off, size_t count) 92 92 { 93 - struct device *dev = container_of(kobj, struct device, kobj); 93 + struct device *dev = kobj_to_dev(kobj); 94 94 return w1_ds2780_io(dev, buf, off, count, 0); 95 95 } 96 96
+1 -1
drivers/w1/slaves/w1_ds2781.c
··· 87 87 struct bin_attribute *bin_attr, char *buf, 88 88 loff_t off, size_t count) 89 89 { 90 - struct device *dev = container_of(kobj, struct device, kobj); 90 + struct device *dev = kobj_to_dev(kobj); 91 91 return w1_ds2781_io(dev, buf, off, count, 0); 92 92 } 93 93