regulator: Get rid of lockdep warning
authorAmeya Palande <[email protected]>
Fri, 12 Mar 2010 18:09:01 +0000 (20:09 +0200)
committerLiam Girdwood <[email protected]>
Mon, 22 Mar 2010 19:44:44 +0000 (19:44 +0000)
WARNING: at kernel/lockdep.c:2706 sysfs_add_file_mode+0x4c/0xa8()

Difference between v1 and v2:
Moved sysfs_attr_init() call as first one to access the structure.

Signed-off-by: Ameya Palande <[email protected]>
CC: Liam Girdwood <[email protected]>
CC: Mark Brown <[email protected]>
CC: David Brownell <[email protected]>
Acked-by: Mark Brown <[email protected]>
Signed-off-by: Liam Girdwood <[email protected]>
drivers/regulator/core.c

index c7bbe30010f70b3dc69542eb99fe14488cd31f45..5af16c2bb54043d090b93185c3f019a40257fcf2 100644 (file)
@@ -1038,6 +1038,7 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,
                        goto overflow_err;
 
                regulator->dev = dev;
+               sysfs_attr_init(&regulator->dev_attr.attr);
                regulator->dev_attr.attr.name = kstrdup(buf, GFP_KERNEL);
                if (regulator->dev_attr.attr.name == NULL)
                        goto attr_name_err;