Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4f26a2ab authored by Ameya Palande's avatar Ameya Palande Committed by Liam Girdwood
Browse files

regulator: Get rid of lockdep warning



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: default avatarAmeya Palande <ameya.palande@nokia.com>
CC: Liam Girdwood <lrg@slimlogic.co.uk>
CC: Mark Brown <broonie@opensource.wolfsonmicro.com>
CC: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 67e46f34
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;