Message ID | 20240304-backlight-probe-v1-5-e5f57d0df6e6@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | backlight: Simplify probe in few drivers | expand |
On Mon, Mar 04, 2024 at 11:11:42AM +0100, Krzysztof Kozlowski wrote: > Don't pollute dmesg on deferred probe and simplify the code with > dev_err_probe(). > > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Daniel.
diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c index a3412c936ca2..93fd6dbccc28 100644 --- a/drivers/video/backlight/lm3630a_bl.c +++ b/drivers/video/backlight/lm3630a_bl.c @@ -563,10 +563,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); }
Don't pollute dmesg on deferred probe and simplify the code with dev_err_probe(). Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> --- drivers/video/backlight/lm3630a_bl.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)