]> git.karo-electronics.de Git - linux-beck.git/commitdiff
regulator: Include the device name in the microamps_requested_ file
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 9 Jun 2011 15:22:21 +0000 (16:22 +0100)
committerLiam Girdwood <lrg@slimlogic.co.uk>
Thu, 9 Jun 2011 18:14:29 +0000 (19:14 +0100)
We may have multiple devices requesting a supply with the same name so
include the device name in the generated filename for microamps_requested
to avoid duplicate files.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
drivers/regulator/core.c

index 75312bd6aac4538ea425aa683a9ffee9882bb899..e3b67ee48b23ef9050fac732a8f67bcbf697be2a 100644 (file)
@@ -1053,8 +1053,9 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,
 
        if (dev) {
                /* create a 'requested_microamps_name' sysfs entry */
-               size = scnprintf(buf, REG_STR_SIZE, "microamps_requested_%s",
-                       supply_name);
+               size = scnprintf(buf, REG_STR_SIZE,
+                                "microamps_requested_%s-%s",
+                                dev_name(dev), supply_name);
                if (size >= REG_STR_SIZE)
                        goto overflow_err;