* Re: [PATCHv3] regulator: pwm-regulator: Make use of the helper function dev_err_probe()
@ 2021-09-25 17:12 ` Martin Blumenstingl
0 siblings, 0 replies; 9+ messages in thread
From: Martin Blumenstingl @ 2021-09-25 17:12 UTC (permalink / raw)
To: Anand Moon
Cc: linux-arm-kernel, linux-amlogic, linux-kernel, Liam Girdwood,
Mark Brown
Hi Anand,
On Tue, Sep 21, 2021 at 11:27 PM Anand Moon <linux.amoon@gmail.com> wrote:
[...]
> @@ -353,13 +353,8 @@ static int pwm_regulator_probe(struct platform_device *pdev)
>
> drvdata->pwm = devm_pwm_get(&pdev->dev, NULL);
> if (IS_ERR(drvdata->pwm)) {
> - ret = PTR_ERR(drvdata->pwm);
> - if (ret == -EPROBE_DEFER)
> - dev_dbg(&pdev->dev,
> - "Failed to get PWM, deferring probe\n");
> - else
> - dev_err(&pdev->dev, "Failed to get PWM: %d\n", ret);
> - return ret;
> + return dev_err_probe(&pdev->dev, PTR_ERR(drvdata->pwm),
> + "Failed to get PWM\n");
> }
From functional perspective you're patch is looking good now.
I just noticed that the coding-style in the pwm-regulator driver is
not not use any curly brackets for the if block when there's only one
statement
with the curly brackets removed (and if there are no other changes to
this patch) then you can add my:
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Best regards,
Martin
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCHv3] regulator: pwm-regulator: Make use of the helper function dev_err_probe()
@ 2021-09-25 17:12 ` Martin Blumenstingl
0 siblings, 0 replies; 9+ messages in thread
From: Martin Blumenstingl @ 2021-09-25 17:12 UTC (permalink / raw)
To: Anand Moon
Cc: linux-arm-kernel, linux-amlogic, linux-kernel, Liam Girdwood,
Mark Brown
Hi Anand,
On Tue, Sep 21, 2021 at 11:27 PM Anand Moon <linux.amoon@gmail.com> wrote:
[...]
> @@ -353,13 +353,8 @@ static int pwm_regulator_probe(struct platform_device *pdev)
>
> drvdata->pwm = devm_pwm_get(&pdev->dev, NULL);
> if (IS_ERR(drvdata->pwm)) {
> - ret = PTR_ERR(drvdata->pwm);
> - if (ret == -EPROBE_DEFER)
> - dev_dbg(&pdev->dev,
> - "Failed to get PWM, deferring probe\n");
> - else
> - dev_err(&pdev->dev, "Failed to get PWM: %d\n", ret);
> - return ret;
> + return dev_err_probe(&pdev->dev, PTR_ERR(drvdata->pwm),
> + "Failed to get PWM\n");
> }
From functional perspective you're patch is looking good now.
I just noticed that the coding-style in the pwm-regulator driver is
not not use any curly brackets for the if block when there's only one
statement
with the curly brackets removed (and if there are no other changes to
this patch) then you can add my:
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Best regards,
Martin
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCHv3] regulator: pwm-regulator: Make use of the helper function dev_err_probe()
2021-09-25 17:12 ` Martin Blumenstingl
(?)
@ 2021-09-25 17:33 ` Anand Moon
-1 siblings, 0 replies; 9+ messages in thread
From: Anand Moon @ 2021-09-25 17:33 UTC (permalink / raw)
To: Martin Blumenstingl
Cc: linux-arm-kernel, linux-amlogic, Linux Kernel, Liam Girdwood,
Mark Brown
Hi Martin,
On Sat, 25 Sept 2021 at 22:42, Martin Blumenstingl
<martin.blumenstingl@googlemail.com> wrote:
>
> Hi Anand,
>
> On Tue, Sep 21, 2021 at 11:27 PM Anand Moon <linux.amoon@gmail.com> wrote:
> [...]
> > @@ -353,13 +353,8 @@ static int pwm_regulator_probe(struct platform_device *pdev)
> >
> > drvdata->pwm = devm_pwm_get(&pdev->dev, NULL);
> > if (IS_ERR(drvdata->pwm)) {
> > - ret = PTR_ERR(drvdata->pwm);
> > - if (ret == -EPROBE_DEFER)
> > - dev_dbg(&pdev->dev,
> > - "Failed to get PWM, deferring probe\n");
> > - else
> > - dev_err(&pdev->dev, "Failed to get PWM: %d\n", ret);
> > - return ret;
> > + return dev_err_probe(&pdev->dev, PTR_ERR(drvdata->pwm),
> > + "Failed to get PWM\n");
> > }
> From functional perspective you're patch is looking good now.
> I just noticed that the coding-style in the pwm-regulator driver is
> not not use any curly brackets for the if block when there's only one
> statement
>
> with the curly brackets removed (and if there are no other changes to
> this patch) then you can add my:
> Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
>
Thanks, I will update the patch in the next version.
>
> Best regards,
> Martin
Thanks
-Anand
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCHv3] regulator: pwm-regulator: Make use of the helper function dev_err_probe()
@ 2021-09-25 17:33 ` Anand Moon
0 siblings, 0 replies; 9+ messages in thread
From: Anand Moon @ 2021-09-25 17:33 UTC (permalink / raw)
To: Martin Blumenstingl
Cc: linux-arm-kernel, linux-amlogic, Linux Kernel, Liam Girdwood,
Mark Brown
Hi Martin,
On Sat, 25 Sept 2021 at 22:42, Martin Blumenstingl
<martin.blumenstingl@googlemail.com> wrote:
>
> Hi Anand,
>
> On Tue, Sep 21, 2021 at 11:27 PM Anand Moon <linux.amoon@gmail.com> wrote:
> [...]
> > @@ -353,13 +353,8 @@ static int pwm_regulator_probe(struct platform_device *pdev)
> >
> > drvdata->pwm = devm_pwm_get(&pdev->dev, NULL);
> > if (IS_ERR(drvdata->pwm)) {
> > - ret = PTR_ERR(drvdata->pwm);
> > - if (ret == -EPROBE_DEFER)
> > - dev_dbg(&pdev->dev,
> > - "Failed to get PWM, deferring probe\n");
> > - else
> > - dev_err(&pdev->dev, "Failed to get PWM: %d\n", ret);
> > - return ret;
> > + return dev_err_probe(&pdev->dev, PTR_ERR(drvdata->pwm),
> > + "Failed to get PWM\n");
> > }
> From functional perspective you're patch is looking good now.
> I just noticed that the coding-style in the pwm-regulator driver is
> not not use any curly brackets for the if block when there's only one
> statement
>
> with the curly brackets removed (and if there are no other changes to
> this patch) then you can add my:
> Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
>
Thanks, I will update the patch in the next version.
>
> Best regards,
> Martin
Thanks
-Anand
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCHv3] regulator: pwm-regulator: Make use of the helper function dev_err_probe()
@ 2021-09-25 17:33 ` Anand Moon
0 siblings, 0 replies; 9+ messages in thread
From: Anand Moon @ 2021-09-25 17:33 UTC (permalink / raw)
To: Martin Blumenstingl
Cc: linux-arm-kernel, linux-amlogic, Linux Kernel, Liam Girdwood,
Mark Brown
Hi Martin,
On Sat, 25 Sept 2021 at 22:42, Martin Blumenstingl
<martin.blumenstingl@googlemail.com> wrote:
>
> Hi Anand,
>
> On Tue, Sep 21, 2021 at 11:27 PM Anand Moon <linux.amoon@gmail.com> wrote:
> [...]
> > @@ -353,13 +353,8 @@ static int pwm_regulator_probe(struct platform_device *pdev)
> >
> > drvdata->pwm = devm_pwm_get(&pdev->dev, NULL);
> > if (IS_ERR(drvdata->pwm)) {
> > - ret = PTR_ERR(drvdata->pwm);
> > - if (ret == -EPROBE_DEFER)
> > - dev_dbg(&pdev->dev,
> > - "Failed to get PWM, deferring probe\n");
> > - else
> > - dev_err(&pdev->dev, "Failed to get PWM: %d\n", ret);
> > - return ret;
> > + return dev_err_probe(&pdev->dev, PTR_ERR(drvdata->pwm),
> > + "Failed to get PWM\n");
> > }
> From functional perspective you're patch is looking good now.
> I just noticed that the coding-style in the pwm-regulator driver is
> not not use any curly brackets for the if block when there's only one
> statement
>
> with the curly brackets removed (and if there are no other changes to
> this patch) then you can add my:
> Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
>
Thanks, I will update the patch in the next version.
>
> Best regards,
> Martin
Thanks
-Anand
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 9+ messages in thread