mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
backlight: add more information output to pwm_backlight
Make the error paths in the pwm_backlight driver more informative in the probe path, especially for the times that it finds an error. Cc: Russell King <[email protected]> Signed-off-by: Ben Dooks <[email protected]> Cc: Richard Purdie <[email protected]> Acked-by: Krzysztof Helt <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
26cb8bb21b
commit
14563a4ec4
1 changed files with 6 additions and 2 deletions
|
|
@ -68,8 +68,10 @@ static int pwm_backlight_probe(struct platform_device *pdev)
|
|||
struct pwm_bl_data *pb;
|
||||
int ret;
|
||||
|
||||
if (!data)
|
||||
if (!data) {
|
||||
dev_err(&pdev->dev, "failed to find platform data\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (data->init) {
|
||||
ret = data->init(&pdev->dev);
|
||||
|
|
@ -79,6 +81,7 @@ static int pwm_backlight_probe(struct platform_device *pdev)
|
|||
|
||||
pb = kzalloc(sizeof(*pb), GFP_KERNEL);
|
||||
if (!pb) {
|
||||
dev_err(&pdev->dev, "no memory for state\n");
|
||||
ret = -ENOMEM;
|
||||
goto err_alloc;
|
||||
}
|
||||
|
|
@ -91,7 +94,8 @@ static int pwm_backlight_probe(struct platform_device *pdev)
|
|||
dev_err(&pdev->dev, "unable to request PWM for backlight\n");
|
||||
ret = PTR_ERR(pb->pwm);
|
||||
goto err_pwm;
|
||||
}
|
||||
} else
|
||||
dev_dbg(&pdev->dev, "got pwm for backlight\n");
|
||||
|
||||
bl = backlight_device_register(pdev->name, &pdev->dev,
|
||||
pb, &pwm_backlight_ops);
|
||||
|
|
|
|||
Loading…
Reference in a new issue