Skip to content

Commit a503f91

Browse files
pwojtaszczyk-tsmiquelraynal
authored andcommitted
mtd: rawnand: lpx32xx: Fix dma_request_chan() error checks
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: 7326d3f ("mtd: rawnand: lpx32xx: Request DMA channels using DT entries") Signed-off-by: Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com> Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20240705115139.126522-1-piotr.wojtaszczyk@timesys.com
1 parent d29e8e2 commit a503f91

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/mtd/nand/raw/lpc32xx_mlc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ static int lpc32xx_dma_setup(struct lpc32xx_nand_host *host)
575575
dma_cap_mask_t mask;
576576

577577
host->dma_chan = dma_request_chan(mtd->dev.parent, "rx-tx");
578-
if (!host->dma_chan) {
578+
if (IS_ERR(host->dma_chan)) {
579579
/* fallback to request using platform data */
580580
if (!host->pdata || !host->pdata->dma_filter) {
581581
dev_err(mtd->dev.parent, "no DMA platform data\n");

drivers/mtd/nand/raw/lpc32xx_slc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ static int lpc32xx_nand_dma_setup(struct lpc32xx_nand_host *host)
722722
dma_cap_mask_t mask;
723723

724724
host->dma_chan = dma_request_chan(mtd->dev.parent, "rx-tx");
725-
if (!host->dma_chan) {
725+
if (IS_ERR(host->dma_chan)) {
726726
/* fallback to request using platform data */
727727
if (!host->pdata || !host->pdata->dma_filter) {
728728
dev_err(mtd->dev.parent, "no DMA platform data\n");

0 commit comments

Comments
 (0)