* [PATCH] mtd: rawnand: lpx32xx: Fix dma_request_chan() error checks
@ 2024-07-05 9:38 Piotr Wojtaszczyk
2024-07-05 11:32 ` Miquel Raynal
2024-07-05 15:26 ` Markus Elfring
0 siblings, 2 replies; 3+ messages in thread
From: Piotr Wojtaszczyk @ 2024-07-05 9:38 UTC (permalink / raw)
To: dan.carpenter
Cc: Piotr Wojtaszczyk, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Vladimir Zapolskiy, Arnd Bergmann,
Yangtao Li, Li Zetao, linux-mtd, linux-arm-kernel, linux-kernel
The dma_request_chan() returns error pointer in case of error, while
dma_request_channel() returns NULL in case of error therefore different
error checks are needed for the two.
Fixes: 7326d3fb1ee3 ("mtd: rawnand: lpx32xx: Request DMA channels
using DT entries")
Signed-off-by: Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com>
---
drivers/mtd/nand/raw/lpc32xx_mlc.c | 2 +-
drivers/mtd/nand/raw/lpc32xx_slc.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/raw/lpc32xx_mlc.c b/drivers/mtd/nand/raw/lpc32xx_mlc.c
index 92cebe871bb4..b9c3adc54c01 100644
--- a/drivers/mtd/nand/raw/lpc32xx_mlc.c
+++ b/drivers/mtd/nand/raw/lpc32xx_mlc.c
@@ -575,7 +575,7 @@ static int lpc32xx_dma_setup(struct lpc32xx_nand_host *host)
dma_cap_mask_t mask;
host->dma_chan = dma_request_chan(mtd->dev.parent, "rx-tx");
- if (!host->dma_chan) {
+ if (IS_ERR(host->dma_chan)) {
/* fallback to request using platform data */
if (!host->pdata || !host->pdata->dma_filter) {
dev_err(mtd->dev.parent, "no DMA platform data\n");
diff --git a/drivers/mtd/nand/raw/lpc32xx_slc.c b/drivers/mtd/nand/raw/lpc32xx_slc.c
index 3b7e3d259785..ade971e4cc3b 100644
--- a/drivers/mtd/nand/raw/lpc32xx_slc.c
+++ b/drivers/mtd/nand/raw/lpc32xx_slc.c
@@ -722,7 +722,7 @@ static int lpc32xx_nand_dma_setup(struct lpc32xx_nand_host *host)
dma_cap_mask_t mask;
host->dma_chan = dma_request_chan(mtd->dev.parent, "rx-tx");
- if (!host->dma_chan) {
+ if (IS_ERR(host->dma_chan)) {
/* fallback to request using platform data */
if (!host->pdata || !host->pdata->dma_filter) {
dev_err(mtd->dev.parent, "no DMA platform data\n");
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mtd: rawnand: lpx32xx: Fix dma_request_chan() error checks
2024-07-05 9:38 [PATCH] mtd: rawnand: lpx32xx: Fix dma_request_chan() error checks Piotr Wojtaszczyk
@ 2024-07-05 11:32 ` Miquel Raynal
2024-07-05 15:26 ` Markus Elfring
1 sibling, 0 replies; 3+ messages in thread
From: Miquel Raynal @ 2024-07-05 11:32 UTC (permalink / raw)
To: Piotr Wojtaszczyk
Cc: dan.carpenter, Richard Weinberger, Vignesh Raghavendra,
Vladimir Zapolskiy, Arnd Bergmann, Yangtao Li, Li Zetao,
linux-mtd, linux-arm-kernel, linux-kernel
Hi Piotr,
piotr.wojtaszczyk@timesys.com wrote on Fri, 5 Jul 2024 11:38:47 +0200:
> The dma_request_chan() returns error pointer in case of error, while
> dma_request_channel() returns NULL in case of error therefore different
> error checks are needed for the two.
>
> Fixes: 7326d3fb1ee3 ("mtd: rawnand: lpx32xx: Request DMA channels
> using DT entries")
Pleae don't split the commit title over two lines.
Missing: Cc: stable.
> Signed-off-by: Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com>
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mtd: rawnand: lpx32xx: Fix dma_request_chan() error checks
2024-07-05 9:38 [PATCH] mtd: rawnand: lpx32xx: Fix dma_request_chan() error checks Piotr Wojtaszczyk
2024-07-05 11:32 ` Miquel Raynal
@ 2024-07-05 15:26 ` Markus Elfring
1 sibling, 0 replies; 3+ messages in thread
From: Markus Elfring @ 2024-07-05 15:26 UTC (permalink / raw)
To: Piotr Wojtaszczyk, linux-mtd, linux-arm-kernel, Arnd Bergmann,
Dan Carpenter, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Vladimir Zapolskiy
Cc: LKML, Li Zetao, Yangtao Li
…
> dma_request_channel() returns NULL in case of error …
* I find this information not relevant here because such a function
is not called at the affected source code places.
* Please improve such a change description with imperative wordings.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.10-rc6#n94
> Fixes: 7326d3fb1ee3 ("mtd: rawnand: lpx32xx: Request DMA channels
> using DT entries")
Please omit a line break from the tag summary.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.10-rc6#n145
Regards,
Markus
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-07-05 15:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-05 9:38 [PATCH] mtd: rawnand: lpx32xx: Fix dma_request_chan() error checks Piotr Wojtaszczyk
2024-07-05 11:32 ` Miquel Raynal
2024-07-05 15:26 ` Markus Elfring
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).