aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1/w1_therm.c
diff options
context:
space:
mode:
authorEvgeniy Polyakov <johnpol@2ka.mipt.ru>2005-08-11 09:27:49 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-09-08 17:41:26 -0400
commitdb2d0008de519c5db6baec45f7831e08790301cf (patch)
treef100b05ab42f54740b967a24ba07d79518337f8e /drivers/w1/w1_therm.c
parent5e8eb8501212eb92826ccf191f9ca8c186f531c3 (diff)
[PATCH] w1: Added inline functions on top of container_of().
Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/w1/w1_therm.c')
-rw-r--r--drivers/w1/w1_therm.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/w1/w1_therm.c b/drivers/w1/w1_therm.c
index 165526c9360a..2259f3d851ff 100644
--- a/drivers/w1/w1_therm.c
+++ b/drivers/w1/w1_therm.c
@@ -92,8 +92,7 @@ static struct w1_therm_family_converter w1_therm_families[] = {
92 92
93static ssize_t w1_therm_read_name(struct device *dev, struct device_attribute *attr, char *buf) 93static ssize_t w1_therm_read_name(struct device *dev, struct device_attribute *attr, char *buf)
94{ 94{
95 struct w1_slave *sl = container_of(dev, struct w1_slave, dev); 95 struct w1_slave *sl = dev_to_w1_slave(dev);
96
97 return sprintf(buf, "%s\n", sl->name); 96 return sprintf(buf, "%s\n", sl->name);
98} 97}
99 98
@@ -148,8 +147,7 @@ static int w1_therm_check_rom(u8 rom[9])
148 147
149static ssize_t w1_therm_read_bin(struct kobject *kobj, char *buf, loff_t off, size_t count) 148static ssize_t w1_therm_read_bin(struct kobject *kobj, char *buf, loff_t off, size_t count)
150{ 149{
151 struct w1_slave *sl = container_of(container_of(kobj, struct device, kobj), 150 struct w1_slave *sl = kobj_to_w1_slave(kobj);
152 struct w1_slave, dev);
153 struct w1_master *dev = sl->master; 151 struct w1_master *dev = sl->master;
154 u8 rom[9], crc, verdict; 152 u8 rom[9], crc, verdict;
155 int i, max_trying = 10; 153 int i, max_trying = 10;