[PATCH] pwm: ab8500: Add error message if pwmchip_add() fails
Lee Jones
lee.jones at linaro.org
Wed Aug 12 04:11:39 EDT 2020
On Wed, 12 Aug 2020, Uwe Kleine-König wrote:
> pwmchip_add() doesn't emit an error message, so add one in the driver.
Maybe placing one there would be a good idea.
It would certainly cut down on a lot of superfluous strings.
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> ---
> drivers/pwm/pwm-ab8500.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pwm/pwm-ab8500.c b/drivers/pwm/pwm-ab8500.c
> index fdf3964db4a6..4b6f9e24e11d 100644
> --- a/drivers/pwm/pwm-ab8500.c
> +++ b/drivers/pwm/pwm-ab8500.c
> @@ -106,7 +106,7 @@ static int ab8500_pwm_probe(struct platform_device *pdev)
>
> err = pwmchip_add(&ab8500->chip);
> if (err < 0)
> - return err;
> + return dev_err_probe(&pdev->dev, err, "Failed to add pwm chip\n");
>
> dev_dbg(&pdev->dev, "pwm probe successful\n");
> platform_set_drvdata(pdev, ab8500);
--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
More information about the linux-arm-kernel
mailing list