From: Pavel Machek <pavel@ucw.cz>
To: Tony Lindgren <tony@atomide.com>
Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com>,
Dan Murphy <dmurphy@ti.com>,
linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] leds: lm3532: Avoid potentially unpaired regulator calls
Date: Wed, 28 Aug 2019 10:42:36 +0200 [thread overview]
Message-ID: <20190828084235.GA2923@amd> (raw)
In-Reply-To: <20190827215205.59677-1-tony@atomide.com>
[-- Attachment #1: Type: text/plain, Size: 1150 bytes --]
Hi!
> We may currently get unpaired regulator calls when configuring the LED
> brightness via sysfs in case of regulator calls producing errors. Let's
> fix this by maintaining local state for enabled.
>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
> +++ b/drivers/leds/leds-lm3532.c
> @@ -127,6 +127,7 @@ struct lm3532_als_data {
> * @num_leds - Number of LED strings are supported in this array
> * @full_scale_current - The full-scale current setting for the current sink.
> * @led_strings - The LED strings supported in this array
> + * @enabled - Enabled status
> * @label - LED label
> */
> struct lm3532_led {
> @@ -138,6 +139,7 @@ struct lm3532_led {
> int ctrl_brt_pointer;
> int num_leds;
> int full_scale_current;
> + int enabled:1;
> u32 led_strings[LM3532_MAX_CONTROL_BANKS];
> char label[LED_MAX_NAME_SIZE];
> };
I'd do bool enabled, but this version is good, too.
Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
next prev parent reply other threads:[~2019-08-28 8:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-27 21:52 [PATCH] leds: lm3532: Avoid potentially unpaired regulator calls Tony Lindgren
2019-08-28 8:42 ` Pavel Machek [this message]
2019-08-28 8:53 ` [FYI] lm3532: right registration to work with LED-backlight Pavel Machek
2019-08-28 20:32 ` Jacek Anaszewski
2019-09-08 8:03 ` Pavel Machek
2019-09-08 16:17 ` Jacek Anaszewski
2019-09-17 12:40 ` [PATCH] " Pavel Machek
2019-09-17 15:10 ` kbuild test robot
2019-09-17 12:42 ` [FYI] " Pavel Machek
2019-09-17 17:23 ` Jacek Anaszewski
2019-08-28 20:09 ` [PATCH] leds: lm3532: Avoid potentially unpaired regulator calls Jacek Anaszewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190828084235.GA2923@amd \
--to=pavel@ucw.cz \
--cc=dmurphy@ti.com \
--cc=jacek.anaszewski@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox