From: Steven Jackson <sj@oscode.net>
To: linux-pwm@vger.kernel.org, thierry.reding@gmail.com,
jingoohan1@gmail.com
Subject: [PATCH v2] backlight: pwm_bl: use gpiod_set_value_cansleep to fix warnings
Date: Sat, 14 May 2016 11:36:26 +0100 [thread overview]
Message-ID: <5736FFAA.9090402@oscode.net> (raw)
This is the same issue and fix as 1581b088fc91cbb974ad2b98431a8ecabb48
(backlight: corgi_lcd: use gpio_set_value_cansleep() to avoid WARN_ON).
PWM backlights which use a SPI/I2C IO expander to control power will see
warnings when disabling and enabling the backlight, we should use
_cansleep variants of gpio set/get whenever the context can sleep.
Other backlight drivers such as corgi_bl.c and gpio_backlight.c are
using _cansleep variants in the same contexts.
Signed-off-by: Steven Jackson <sj@oscode.net>
---
drivers/video/backlight/pwm_bl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/backlight/pwm_bl.c
b/drivers/video/backlight/pwm_bl.c
index b2b366b..1261400 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -55,7 +55,7 @@ static void pwm_backlight_power_on(struct pwm_bl_data
*pb, int brightness)
dev_err(pb->dev, "failed to enable power supply\n");
if (pb->enable_gpio)
- gpiod_set_value(pb->enable_gpio, 1);
+ gpiod_set_value_cansleep(pb->enable_gpio, 1);
pwm_enable(pb->pwm);
pb->enabled = true;
@@ -70,7 +70,7 @@ static void pwm_backlight_power_off(struct pwm_bl_data
*pb)
pwm_disable(pb->pwm);
if (pb->enable_gpio)
- gpiod_set_value(pb->enable_gpio, 0);
+ gpiod_set_value_cansleep(pb->enable_gpio, 0);
regulator_disable(pb->power_supply);
pb->enabled = false;
--
2.7.4
reply other threads:[~2016-05-14 10:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=5736FFAA.9090402@oscode.net \
--to=sj@oscode.net \
--cc=jingoohan1@gmail.com \
--cc=linux-pwm@vger.kernel.org \
--cc=thierry.reding@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.