[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+V-a8tUkm3wDHrsGvD_L3zuV6WzuoEDoO3+Mv9emLN=CaejCQ@mail.gmail.com>
Date: Wed, 8 Dec 2021 00:32:46 +0000
From: "Lad, Prabhakar" <prabhakar.csengg@...il.com>
To: Philipp Zabel <p.zabel@...gutronix.de>
Cc: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Hans Verkuil <hverkuil-cisco@...all.nl>,
Niklas Söderlund
<niklas.soderlund+renesas@...natech.se>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
linux-media <linux-media@...r.kernel.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>,
Linux-Renesas <linux-renesas-soc@...r.kernel.org>,
Biju Das <biju.das.jz@...renesas.com>
Subject: Re: [RFC PATCH 2/3] media: platform: Add CRU driver for RZ/G2L SoC
Hi Philipp,
Thank you for the review.
On Tue, Dec 7, 2021 at 8:16 AM Philipp Zabel <p.zabel@...gutronix.de> wrote:
>
> On Tue, 2021-12-07 at 01:23 +0000, Lad Prabhakar wrote:
> [...]
> > +static int rzg2l_cru_probe(struct platform_device *pdev)
> > +{
> > + struct rzg2l_cru_dev *cru;
> > + struct v4l2_ctrl *ctrl;
> > + int irq, ret;
> > +
> > + cru = devm_kzalloc(&pdev->dev, sizeof(*cru), GFP_KERNEL);
> > + if (!cru)
> > + return -ENOMEM;
> > +
> > + cru->dev = &pdev->dev;
> > + cru->info = of_device_get_match_data(&pdev->dev);
> > +
> > + cru->base = devm_platform_ioremap_resource(pdev, 0);
> > + if (IS_ERR(cru->base))
> > + return PTR_ERR(cru->base);
> > +
> > + irq = platform_get_irq(pdev, 1);
> > + if (irq < 0)
> > + return irq;
> > +
> > + cru->vclk = clk_get(&pdev->dev, "vclk");
> > + if (IS_ERR(cru->vclk))
> > + return PTR_ERR(cru->vclk);
>
> devm_clk_get()?
> Don't mix devm and non-devm functions like this, all devm functions
> should be placed first.
>
Agreed, I will use devm_clk_get().
> > + cru->cmn_restb = devm_reset_control_get_by_index(&pdev->dev, 0);
>
> Your binding has reset-names defined, please request reset controls by
> name. Use devm_reset_control_get_explicit() instead, same below.
>
> > + if (IS_ERR(cru->cmn_restb)) {
> > + dev_err(&pdev->dev, "failed to get cpg cmn_restb\n");
> > + return PTR_ERR(cru->cmn_restb);
>
> These could return -EPROBE_DEFER, I suggest to
>
> return dev_err_probe(&pdev->dev, PTR_ERR(cru->cmn_restb),
> "failed to get cpg cmn_restb\n");
>
OK will do.
> instead, same below.
>
ditto.
Cheers,
Prabhakar
> > + }
> > + cru->presetn = devm_reset_control_get_by_index(&pdev->dev, 1);
> > + if (IS_ERR(cru->presetn)) {
> > + dev_err(&pdev->dev, "failed to get cpg presetn\n");
> > + return PTR_ERR(cru->presetn);
> > + }
> > + cru->aresetn = devm_reset_control_get_by_index(&pdev->dev, 2);
> > + if (IS_ERR(cru->aresetn)) {
> > + dev_err(&pdev->dev, "failed to get cpg aresetn\n");
> > + return PTR_ERR(cru->aresetn);
> > + }
>
> regards
> Philipp
Powered by blists - more mailing lists