diff mbox series

media: rockchip: rga: Fix probe rga_parse_dt bugs

Message ID 20220814040806.7523-1-kernel@undef.tools (mailing list archive)
State New, archived
Headers show
Series media: rockchip: rga: Fix probe rga_parse_dt bugs | expand

Commit Message

Jarrah Aug. 14, 2022, 4:08 a.m. UTC
From: Ondrej Jirman <megi@xff.cz>

rga_parse_dt is missing a error return, so if some of the resources
return DEFER_PROBE, probe will succeed without these resources.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
Signed-off-by: Jarrah Gosbell <kernel@undef.tools>
---
 drivers/media/platform/rockchip/rga/rga.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Peter Geis Aug. 14, 2022, 1:12 p.m. UTC | #1
On Sun, Aug 14, 2022 at 6:10 AM Jarrah Gosbell <kernel@undef.tools> wrote:
>
> From: Ondrej Jirman <megi@xff.cz>
>
> rga_parse_dt is missing a error return, so if some of the resources
> return DEFER_PROBE, probe will succeed without these resources.
>
> Signed-off-by: Ondrej Jirman <megi@xff.cz>
> Signed-off-by: Jarrah Gosbell <kernel@undef.tools>
> ---
>  drivers/media/platform/rockchip/rga/rga.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/rockchip/rga/rga.c b/drivers/media/platform/rockchip/rga/rga.c
> index 2f8df74ad0fd..b88dd7ed2036 100644
> --- a/drivers/media/platform/rockchip/rga/rga.c
> +++ b/drivers/media/platform/rockchip/rga/rga.c
> @@ -815,8 +815,10 @@ static int rga_probe(struct platform_device *pdev)
>         mutex_init(&rga->mutex);
>
>         ret = rga_parse_dt(rga);
> -       if (ret)
> +       if (ret) {
>                 dev_err(&pdev->dev, "Unable to parse OF data\n");

If this can return EPROBE_DEFER, shouldn't this be dev_err_probe
instead of dev_err?

> +               return ret;
> +       }
>
>         pm_runtime_enable(rga->dev);
>
> --
> 2.35.1
>
>
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip
Jarrah Aug. 14, 2022, 10:01 p.m. UTC | #2
On 8/14/22 23:12, Peter Geis wrote:
>>          ret = rga_parse_dt(rga);
>> -       if (ret)
>> +       if (ret) {
>>                  dev_err(&pdev->dev, "Unable to parse OF data\n");
> If this can return EPROBE_DEFER, shouldn't this be dev_err_probe
> instead of dev_err?


Looking into it that does make more sense. I suspect it wasn't done this 
way originally because dev_err_probe isn't used elsewhere in rga.c. I'll 
send a v2 with that change shortly.


Thanks for the review.
diff mbox series

Patch

diff --git a/drivers/media/platform/rockchip/rga/rga.c b/drivers/media/platform/rockchip/rga/rga.c
index 2f8df74ad0fd..b88dd7ed2036 100644
--- a/drivers/media/platform/rockchip/rga/rga.c
+++ b/drivers/media/platform/rockchip/rga/rga.c
@@ -815,8 +815,10 @@  static int rga_probe(struct platform_device *pdev)
 	mutex_init(&rga->mutex);
 
 	ret = rga_parse_dt(rga);
-	if (ret)
+	if (ret) {
 		dev_err(&pdev->dev, "Unable to parse OF data\n");
+		return ret;
+	}
 
 	pm_runtime_enable(rga->dev);