|
@@ -68,8 +68,10 @@ static int pwm_backlight_probe(struct platform_device *pdev)
|
|
struct pwm_bl_data *pb;
|
|
struct pwm_bl_data *pb;
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
- if (!data)
|
|
|
|
|
|
+ if (!data) {
|
|
|
|
+ dev_err(&pdev->dev, "failed to find platform data\n");
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
+ }
|
|
|
|
|
|
if (data->init) {
|
|
if (data->init) {
|
|
ret = data->init(&pdev->dev);
|
|
ret = data->init(&pdev->dev);
|
|
@@ -79,6 +81,7 @@ static int pwm_backlight_probe(struct platform_device *pdev)
|
|
|
|
|
|
pb = kzalloc(sizeof(*pb), GFP_KERNEL);
|
|
pb = kzalloc(sizeof(*pb), GFP_KERNEL);
|
|
if (!pb) {
|
|
if (!pb) {
|
|
|
|
+ dev_err(&pdev->dev, "no memory for state\n");
|
|
ret = -ENOMEM;
|
|
ret = -ENOMEM;
|
|
goto err_alloc;
|
|
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");
|
|
dev_err(&pdev->dev, "unable to request PWM for backlight\n");
|
|
ret = PTR_ERR(pb->pwm);
|
|
ret = PTR_ERR(pb->pwm);
|
|
goto err_pwm;
|
|
goto err_pwm;
|
|
- }
|
|
|
|
|
|
+ } else
|
|
|
|
+ dev_dbg(&pdev->dev, "got pwm for backlight\n");
|
|
|
|
|
|
bl = backlight_device_register(pdev->name, &pdev->dev,
|
|
bl = backlight_device_register(pdev->name, &pdev->dev,
|
|
pb, &pwm_backlight_ops);
|
|
pb, &pwm_backlight_ops);
|