[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6251f4b5a886bc3276d72c5c33118cfb6ac2bf5b.camel@pengutronix.de>
Date: Tue, 07 Dec 2021 09:16:11 +0100
From: Philipp Zabel <p.zabel@...gutronix.de>
To: 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>
Cc: linux-media@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-renesas-soc@...r.kernel.org,
Prabhakar <prabhakar.csengg@...il.com>,
Biju Das <biju.das.jz@...renesas.com>
Subject: Re: [RFC PATCH 2/3] media: platform: Add CRU driver for RZ/G2L SoC
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.
> + 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");
instead, same below.
> + }
> + 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