[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>
This commit is contained in:
Evgeniy Polyakov
2005-08-11 17:27:49 +04:00
committed by Greg Kroah-Hartman
parent 5e8eb85012
commit db2d0008de
4 changed files with 29 additions and 20 deletions

View File

@@ -46,15 +46,13 @@ static struct w1_family_ops w1_smem_fops = {
static ssize_t w1_smem_read_name(struct device *dev, struct device_attribute *attr, char *buf)
{
struct w1_slave *sl = container_of(dev, struct w1_slave, dev);
struct w1_slave *sl = dev_to_w1_slave(dev);
return sprintf(buf, "%s\n", sl->name);
}
static ssize_t w1_smem_read_bin(struct kobject *kobj, char *buf, loff_t off, size_t count)
{
struct w1_slave *sl = container_of(container_of(kobj, struct device, kobj),
struct w1_slave, dev);
struct w1_slave *sl = kobj_to_w1_slave(kobj);
int i;
atomic_inc(&sl->refcnt);