diff options
| -rw-r--r-- | drivers/video/backlight/pwm_bl.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index eff379b234cc..ae3c6b6fd5db 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c | |||
| @@ -271,19 +271,18 @@ static int pwm_backlight_probe(struct platform_device *pdev) | |||
| 271 | } | 271 | } |
| 272 | 272 | ||
| 273 | pb->pwm = devm_pwm_get(&pdev->dev, NULL); | 273 | pb->pwm = devm_pwm_get(&pdev->dev, NULL); |
| 274 | if (IS_ERR(pb->pwm)) { | 274 | if (IS_ERR(pb->pwm) && PTR_ERR(pb->pwm) != -EPROBE_DEFER |
| 275 | ret = PTR_ERR(pb->pwm); | 275 | && !pdev->dev.of_node) { |
| 276 | if (ret == -EPROBE_DEFER) | ||
| 277 | goto err_alloc; | ||
| 278 | |||
| 279 | dev_err(&pdev->dev, "unable to request PWM, trying legacy API\n"); | 276 | dev_err(&pdev->dev, "unable to request PWM, trying legacy API\n"); |
| 280 | pb->legacy = true; | 277 | pb->legacy = true; |
| 281 | pb->pwm = pwm_request(data->pwm_id, "pwm-backlight"); | 278 | pb->pwm = pwm_request(data->pwm_id, "pwm-backlight"); |
| 282 | if (IS_ERR(pb->pwm)) { | 279 | } |
| 283 | dev_err(&pdev->dev, "unable to request legacy PWM\n"); | 280 | |
| 284 | ret = PTR_ERR(pb->pwm); | 281 | if (IS_ERR(pb->pwm)) { |
| 285 | goto err_alloc; | 282 | ret = PTR_ERR(pb->pwm); |
| 286 | } | 283 | if (ret != -EPROBE_DEFER) |
| 284 | dev_err(&pdev->dev, "unable to request PWM\n"); | ||
| 285 | goto err_alloc; | ||
| 287 | } | 286 | } |
| 288 | 287 | ||
| 289 | dev_dbg(&pdev->dev, "got pwm for backlight\n"); | 288 | dev_dbg(&pdev->dev, "got pwm for backlight\n"); |
