public inbox for linux-pwm@vger.kernel.org
 help / color / mirror / Atom feed
From: ryang <hachyang@gmail.com>
To: thierry.reding@gmail.com, jg1.han@samsung.com, lee.jones@linaro.org
Cc: linux-pwm@vger.kernel.org, ryang <ryang@hach.com>
Subject: [PATCH 1/1] PWM Backlight: Fix a bug which could cause the PWM backlight driver use the wrong PWM chip and fail the driver probing if multiple PWM chips exist. This defect could also cause the unintended PWM chip  used and unaccessable by other drivers. The patch will check the error state first and allow a deferral PWM backlight probing if the intended PWM driver is not loaded at the probing moment.
Date: Wed,  3 Sep 2014 13:00:37 -0700	[thread overview]
Message-ID: <1409774437-39530-1-git-send-email-ryang@hach.com> (raw)

Signed-off-by: ryang <ryang@hach.com>
---
 drivers/video/backlight/pwm_bl.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index b85983e..e0014a5 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -273,6 +273,9 @@ static int pwm_backlight_probe(struct platform_device *pdev)
 
 	pb->pwm = devm_pwm_get(&pdev->dev, NULL);
 	if (IS_ERR(pb->pwm)) {
+		ret = PTR_ERR(pb->pwm);
+		if (ret == -EPROBE_DEFER)
+			goto err_alloc;
 		dev_err(&pdev->dev, "unable to request PWM, trying legacy API\n");
 
 		pb->pwm = pwm_request(data->pwm_id, "pwm-backlight");
-- 
1.9.1


             reply	other threads:[~2014-09-03 20:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-03 20:00 ryang [this message]
2014-09-04  8:38 ` [PATCH 1/1] PWM Backlight: Fix a bug which could cause the PWM backlight driver use the wrong PWM chip and fail the driver probing if multiple PWM chips exist. This defect could also cause the unintended PWM chip used and unaccessable by other drivers. The patch will check the error state first and allow a deferral PWM backlight probing if the intended PWM driver is not loaded at the probing moment Lee Jones
2014-09-04  8:39   ` Lee Jones
2014-09-04 15:33     ` [PATCH 1/1] PWM Backlight: Fix a bug which could cause the PWM backlight driver use the wrong PWM chip and fail the driver probing if multiple PWM chips exist. This defect could also cause the unintended PWM chip used and unaccessable by other dri Yang, Robert

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=1409774437-39530-1-git-send-email-ryang@hach.com \
    --to=hachyang@gmail.com \
    --cc=jg1.han@samsung.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=ryang@hach.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox