Skip to content

Commit

Permalink
backlight: lm3630a_bl: Handle deferred probe
Browse files Browse the repository at this point in the history
Don't pollute dmesg on deferred probe and simplify the code with
dev_err_probe().

Reviewed-by: Daniel Thompson <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Lee Jones <[email protected]>
  • Loading branch information
krzk authored and lag-linaro committed Mar 7, 2024
1 parent 41f1b3e commit b4c385b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/video/backlight/lm3630a_bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,10 +560,9 @@ static int lm3630a_probe(struct i2c_client *client)
/* pwm */
if (pdata->pwm_ctrl != LM3630A_PWM_DISABLE) {
pchip->pwmd = devm_pwm_get(pchip->dev, "lm3630a-pwm");
if (IS_ERR(pchip->pwmd)) {
dev_err(&client->dev, "fail : get pwm device\n");
return PTR_ERR(pchip->pwmd);
}
if (IS_ERR(pchip->pwmd))
return dev_err_probe(&client->dev, PTR_ERR(pchip->pwmd),
"fail : get pwm device\n");

pwm_init_state(pchip->pwmd, &pchip->pwmd_state);
}
Expand Down

0 comments on commit b4c385b

Please sign in to comment.