aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1/w1_smem.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_smem.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_smem.c')
-rw-r--r--drivers/w1/w1_smem.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/w1/w1_smem.c b/drivers/w1/w1_smem.c
index 70d2d469963c..2b6580c7e953 100644
--- a/drivers/w1/w1_smem.c
+++ b/drivers/w1/w1_smem.c
@@ -46,15 +46,13 @@ static struct w1_family_ops w1_smem_fops = {
46 46
47static ssize_t w1_smem_read_name(struct device *dev, struct device_attribute *attr, char *buf) 47static ssize_t w1_smem_read_name(struct device *dev, struct device_attribute *attr, char *buf)
48{ 48{
49 struct w1_slave *sl = container_of(dev, struct w1_slave, dev); 49 struct w1_slave *sl = dev_to_w1_slave(dev);
50
51 return sprintf(buf, "%s\n", sl->name); 50 return sprintf(buf, "%s\n", sl->name);
52} 51}
53 52
54static ssize_t w1_smem_read_bin(struct kobject *kobj, char *buf, loff_t off, size_t count) 53static ssize_t w1_smem_read_bin(struct kobject *kobj, char *buf, loff_t off, size_t count)
55{ 54{
56 struct w1_slave *sl = container_of(container_of(kobj, struct device, kobj), 55 struct w1_slave *sl = kobj_to_w1_slave(kobj);
57 struct w1_slave, dev);
58 int i; 56 int i;
59 57
60 atomic_inc(&sl->refcnt); 58 atomic_inc(&sl->refcnt);