From: andy.shevchenko@gmail.com
To: Mark Brown <broonie@kernel.org>,
linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Vladimir Oltean <olteanv@gmail.com>,
Minjie Du <duminjie@vivo.com>,
Andy Shevchenko <andy.shevchenko@gmail.com>
Subject: [PATCH v2 2/2] spi: fsl-dspi: Unify error messaging in dspi_request_dma()
Date: Sun, 4 Feb 2024 22:29:19 +0200 [thread overview]
Message-ID: <20240204203127.1186621-3-andy.shevchenko@gmail.com> (raw)
In-Reply-To: <20240204203127.1186621-1-andy.shevchenko@gmail.com>
Use dev_err_probe() for all messages in dspi_request_dma() for the sake of
making them uniform. While at it, fix indentation issue reported by Vladimir
Oltean.
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
drivers/spi/spi-fsl-dspi.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
index 0b5ea7a7da71..38defdcf9370 100644
--- a/drivers/spi/spi-fsl-dspi.c
+++ b/drivers/spi/spi-fsl-dspi.c
@@ -502,15 +502,12 @@ static int dspi_request_dma(struct fsl_dspi *dspi, phys_addr_t phy_addr)
return -ENOMEM;
dma->chan_rx = dma_request_chan(dev, "rx");
- if (IS_ERR(dma->chan_rx)) {
- return dev_err_probe(dev, PTR_ERR(dma->chan_rx),
- "rx dma channel not available\n");
- }
+ if (IS_ERR(dma->chan_rx))
+ return dev_err_probe(dev, PTR_ERR(dma->chan_rx), "rx dma channel not available\n");
dma->chan_tx = dma_request_chan(dev, "tx");
if (IS_ERR(dma->chan_tx)) {
- ret = PTR_ERR(dma->chan_tx);
- dev_err_probe(dev, ret, "tx dma channel not available\n");
+ ret = dev_err_probe(dev, PTR_ERR(dma->chan_tx), "tx dma channel not available\n");
goto err_tx_channel;
}
@@ -541,14 +538,14 @@ static int dspi_request_dma(struct fsl_dspi *dspi, phys_addr_t phy_addr)
cfg.direction = DMA_DEV_TO_MEM;
ret = dmaengine_slave_config(dma->chan_rx, &cfg);
if (ret) {
- dev_err(dev, "can't configure rx dma channel\n");
+ dev_err_probe(dev, ret, "can't configure rx dma channel\n");
goto err_slave_config;
}
cfg.direction = DMA_MEM_TO_DEV;
ret = dmaengine_slave_config(dma->chan_tx, &cfg);
if (ret) {
- dev_err(dev, "can't configure tx dma channel\n");
+ dev_err_probe(dev, ret, "can't configure tx dma channel\n");
goto err_slave_config;
}
--
2.43.0
next prev parent reply other threads:[~2024-02-04 20:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-04 20:29 [PATCH v2 0/2] spi: fsl-dspi: A couple of error handling improvements andy.shevchenko
2024-02-04 20:29 ` [PATCH v2 1/2] spi: fsl-dspi: Preserve error code returned by dmaengine_slave_config() andy.shevchenko
2024-02-05 11:11 ` Vladimir Oltean
2024-02-04 20:29 ` andy.shevchenko [this message]
2024-02-05 11:12 ` [PATCH v2 2/2] spi: fsl-dspi: Unify error messaging in dspi_request_dma() Vladimir Oltean
2024-02-06 12:09 ` [PATCH v2 0/2] spi: fsl-dspi: A couple of error handling improvements Mark Brown
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=20240204203127.1186621-3-andy.shevchenko@gmail.com \
--to=andy.shevchenko@gmail.com \
--cc=broonie@kernel.org \
--cc=duminjie@vivo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=olteanv@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