[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <gfjir4qyyptxjizkc2k5r2elwn74fndia644evv6acwyuj3fr5@3pl3xt7rqntw>
Date: Tue, 24 Dec 2024 00:13:52 +0100
From: Andi Shyti <andi.shyti@...nel.org>
To: Carlos Song <carlos.song@....com>
Cc: o.rempel@...gutronix.de, kernel@...gutronix.de, shawnguo@...nel.org,
s.hauer@...gutronix.de, festevam@...il.com, linux-i2c@...r.kernel.org,
imx@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, Clark Wang <xiaoning.wang@....com>,
Ahmad Fatoum <a.fatoum@...gutronix.de>
Subject: Re: [PATCH v6] i2c: imx: support DMA defer probing
Hi Carlos,
...
> @@ -1802,6 +1803,18 @@ static int i2c_imx_probe(struct platform_device *pdev)
> if (ret == -EPROBE_DEFER)
> goto clk_notifier_unregister;
>
> + /* As we can always fall back to PIO, let's ignore the error setting up DMA. */
> + ret = i2c_imx_dma_request(i2c_imx, phy_addr);
> + if (ret) {
> + if (ret == -EPROBE_DEFER)
> + goto clk_notifier_unregister;
> + else if (ret == -ENODEV)
> + dev_dbg(&pdev->dev, "Only use PIO mode\n");
> + else
> + dev_err(&pdev->dev, "Failed to setup DMA (%pe), only use PIO mode\n",
> + ERR_PTR(ret));
My question here is not just about the use of dev_err vs
dev_err_probe, but why don't we exit the probe if we get an
error.
We should use PIO only in case of ENODEV, in all the other cases
I think we should just leave. E.g. why don't we exit if we meet
ret == -ENOMEM?
Andi
Powered by blists - more mailing lists