[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <474f02b3-33e9-5df5-7344-91fdb84507b0@st.com>
Date: Wed, 24 Apr 2019 15:58:42 +0000
From: Hugues FRUCHET <hugues.fruchet@...com>
To: Fabien DESSENNE <fabien.dessenne@...com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
"Alexandre TORGUE" <alexandre.torgue@...com>,
"linux-media@...r.kernel.org" <linux-media@...r.kernel.org>,
"linux-stm32@...md-mailman.stormreply.com"
<linux-stm32@...md-mailman.stormreply.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] media: stm32-dcmi: return appropriate error codes during
probe
Acked-by: Hugues Fruchet <hugues.fruchet@...com>
On 4/24/19 3:25 PM, Fabien Dessenne wrote:
> During probe, return the provided errors value instead of -ENODEV.
> This allows the driver to be deferred probed if needed.
>
> Signed-off-by: Fabien Dessenne <fabien.dessenne@...com>
> ---
> drivers/media/platform/stm32/stm32-dcmi.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c
> index 906e71b..b9dad0a 100644
> --- a/drivers/media/platform/stm32/stm32-dcmi.c
> +++ b/drivers/media/platform/stm32/stm32-dcmi.c
> @@ -1672,7 +1672,7 @@ static int dcmi_probe(struct platform_device *pdev)
> dcmi->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
> if (IS_ERR(dcmi->rstc)) {
> dev_err(&pdev->dev, "Could not get reset control\n");
> - return -ENODEV;
> + return PTR_ERR(dcmi->rstc);
> }
>
> /* Get bus characteristics from devicetree */
> @@ -1687,7 +1687,7 @@ static int dcmi_probe(struct platform_device *pdev)
> of_node_put(np);
> if (ret) {
> dev_err(&pdev->dev, "Could not parse the endpoint\n");
> - return -ENODEV;
> + return ret;
> }
>
> if (ep.bus_type == V4L2_MBUS_CSI2_DPHY) {
> @@ -1700,8 +1700,9 @@ static int dcmi_probe(struct platform_device *pdev)
>
> irq = platform_get_irq(pdev, 0);
> if (irq <= 0) {
> - dev_err(&pdev->dev, "Could not get irq\n");
> - return -ENODEV;
> + if (irq != -EPROBE_DEFER)
> + dev_err(&pdev->dev, "Could not get irq\n");
> + return irq;
> }
>
> dcmi->res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> @@ -1721,12 +1722,13 @@ static int dcmi_probe(struct platform_device *pdev)
> dev_name(&pdev->dev), dcmi);
> if (ret) {
> dev_err(&pdev->dev, "Unable to request irq %d\n", irq);
> - return -ENODEV;
> + return ret;
> }
>
> mclk = devm_clk_get(&pdev->dev, "mclk");
> if (IS_ERR(mclk)) {
> - dev_err(&pdev->dev, "Unable to get mclk\n");
> + if (PTR_ERR(mclk) != -EPROBE_DEFER)
> + dev_err(&pdev->dev, "Unable to get mclk\n");
> return PTR_ERR(mclk);
> }
>
>
Powered by blists - more mailing lists