Message ID | 20200812075214.499-1-u.kleine-koenig@pengutronix.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | pwm: ab8500: Add error message if pwmchip_add() fails | expand |
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@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);
On Wed, Aug 12, 2020 at 09:11:39AM +0100, Lee Jones wrote: > 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. Hmm, I'm not convinced. Do you want to work on that? If not I suggest to still apply the patch as currently it is justified. Best regards Uwe
On Thu, 22 Oct 2020, Uwe Kleine-König wrote: > On Wed, Aug 12, 2020 at 09:11:39AM +0100, Lee Jones wrote: > > 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. > > Hmm, I'm not convinced. Do you want to work on that? If not I suggest to > still apply the patch as currently it is justified. I haven't looked at implementing it. Does it look difficult/
On Mon, Oct 26, 2020 at 09:33:00AM +0000, Lee Jones wrote: > On Thu, 22 Oct 2020, Uwe Kleine-König wrote: > > > On Wed, Aug 12, 2020 at 09:11:39AM +0100, Lee Jones wrote: > > > 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. > > > > Hmm, I'm not convinced. Do you want to work on that? If not I suggest to > > still apply the patch as currently it is justified. > > I haven't looked at implementing it. Does it look difficult/ Probably it isn't, needs just some endurance to actually do it. (And I won't invest that in the near future, also because I'm not convinced that the result is beneficial.) Best regards Uwe
On Tue, 03 Nov 2020, Uwe Kleine-König wrote: > On Mon, Oct 26, 2020 at 09:33:00AM +0000, Lee Jones wrote: > > On Thu, 22 Oct 2020, Uwe Kleine-König wrote: > > > > > On Wed, Aug 12, 2020 at 09:11:39AM +0100, Lee Jones wrote: > > > > 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. > > > > > > Hmm, I'm not convinced. Do you want to work on that? If not I suggest to > > > still apply the patch as currently it is justified. > > > > I haven't looked at implementing it. Does it look difficult/ > > Probably it isn't, needs just some endurance to actually do it. (And I > won't invest that in the near future, also because I'm not convinced > that the result is beneficial.) I'll add it to my TODO list. In the mean time, don't let this halt the patch.
On Wed, Aug 12, 2020 at 9:52 AM Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote: > pwmchip_add() doesn't emit an error message, so add one in the driver. > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Yours, Linus Walleij
On Wed, Aug 12, 2020 at 09:52:14AM +0200, Uwe Kleine-König wrote: > pwmchip_add() doesn't emit an error message, so add one in the driver. > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> > --- > drivers/pwm/pwm-ab8500.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied, thanks. Thierry
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);
pwmchip_add() doesn't emit an error message, so add one in the driver. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> --- drivers/pwm/pwm-ab8500.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)