From: Vladimir Oltean <olteanv@gmail.com>
To: Minjie Du <duminjie@vivo.com>
Cc: Mark Brown <broonie@kernel.org>,
Richard Cochran <richardcochran@gmail.com>,
"open list:FREESCALE DSPI DRIVER" <linux-spi@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>,
"open list:PTP HARDWARE CLOCK SUPPORT" <netdev@vger.kernel.org>,
opensource.kernel@vivo.com
Subject: Re: [PATCH v2] spi: fsl-dspi: Use dev_err_probe() in dspi_request_dma()
Date: Tue, 25 Jul 2023 20:05:35 +0300 [thread overview]
Message-ID: <20230725170535.7eh7gciw4j33ds3p@skbuf> (raw)
In-Reply-To: <20230725035038.1702-1-duminjie@vivo.com>
On Tue, Jul 25, 2023 at 11:50:37AM +0800, Minjie Du wrote:
> It is possible for dma_request_chan() to return EPROBE_DEFER, which means
> dev is not ready yet.
> At this point dev_err() will have no output.
>
> Signed-off-by: Minjie Du <duminjie@vivo.com>
> ---
> drivers/spi/spi-fsl-dspi.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
> index ca41c8a8b..6aaa529b7 100644
> --- a/drivers/spi/spi-fsl-dspi.c
> +++ b/drivers/spi/spi-fsl-dspi.c
> @@ -503,15 +503,14 @@ static int dspi_request_dma(struct fsl_dspi *dspi, phys_addr_t phy_addr)
>
> dma->chan_rx = dma_request_chan(dev, "rx");
> if (IS_ERR(dma->chan_rx)) {
> - dev_err(dev, "rx dma channel not available\n");
> - ret = PTR_ERR(dma->chan_rx);
> - return ret;
> + return dev_err_probe(dev, PTR_ERR(dma->chan_rx),
> + "rx dma channel not available\n");
This does not have correct alignment either. Tabs are supposed to be
rendered using 8 spaces.
> }
>
> dma->chan_tx = dma_request_chan(dev, "tx");
> if (IS_ERR(dma->chan_tx)) {
> - dev_err(dev, "tx dma channel not available\n");
> ret = PTR_ERR(dma->chan_tx);
> + dev_err_probe(dev, ret, "tx dma channel not available\n");
> goto err_tx_channel;
> }
>
> --
> 2.39.0
>
next prev parent reply other threads:[~2023-07-25 17:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-25 3:50 [PATCH v2] spi: fsl-dspi: Use dev_err_probe() in dspi_request_dma() Minjie Du
2023-07-25 16:49 ` Mark Brown
2023-07-25 17:05 ` Vladimir Oltean [this message]
2023-07-27 21:07 ` andy.shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230725170535.7eh7gciw4j33ds3p@skbuf \
--to=olteanv@gmail.com \
--cc=broonie@kernel.org \
--cc=duminjie@vivo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=opensource.kernel@vivo.com \
--cc=richardcochran@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).