The patch titled leds/leds-regulator.c: fix handling of already enabled regulators has been added to the -mm tree. Its filename is leds-leds-regulatorc-fix-handling-of-already-enabled-regulators.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: leds/leds-regulator.c: fix handling of already enabled regulators From: Antonio Ospite <ospite@xxxxxxxxxxxxxxxxx> Make the driver aware of the initial status of the regulator. The leds-regulator driver was ignoring the initial status of the regulator; this resulted in rdev->use_count being incremented to 2 after calling regulator_led_set_value() in the .probe method when a regulator was already enabled at insmod time, which made it impossible to ever disable the regulator. Signed-off-by: Antonio Ospite <ospite@xxxxxxxxxxxxxxxxx> Cc: Richard Purdie <rpurdie@xxxxxxxxx> Cc: Antonio Ospite <ospite@xxxxxxxxxxxxxxxxx> Acked-by: Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx> Cc: Liam Girdwood <lrg@xxxxxxxxxxxxxxx> Cc: Daniel Ribeiro <drwyrm@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/leds/leds-regulator.c | 4 ++++ 1 file changed, 4 insertions(+) diff -puN drivers/leds/leds-regulator.c~leds-leds-regulatorc-fix-handling-of-already-enabled-regulators drivers/leds/leds-regulator.c --- a/drivers/leds/leds-regulator.c~leds-leds-regulatorc-fix-handling-of-already-enabled-regulators +++ a/drivers/leds/leds-regulator.c @@ -178,6 +178,10 @@ static int __devinit regulator_led_probe led->cdev.flags |= LED_CORE_SUSPENDRESUME; led->vcc = vcc; + /* to handle correctly an already enabled regulator */ + if (regulator_is_enabled(led->vcc)) + led->enabled = 1; + mutex_init(&led->mutex); INIT_WORK(&led->work, led_work); _ Patches currently in -mm which might be from ospite@xxxxxxxxxxxxxxxxx are leds-leds-regulatorc-fix-handling-of-already-enabled-regulators.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html