All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] mtd: nand: omap2: fix return value check in omap_nand_probe()
@ 2016-07-14 12:06 weiyj_lk
  2016-07-14 16:05 ` Brian Norris
  2016-07-16  0:14 ` Brian Norris
  0 siblings, 2 replies; 4+ messages in thread
From: weiyj_lk @ 2016-07-14 12:06 UTC (permalink / raw)
  To: Boris Brezillon, Richard Weinberger, David Woodhouse,
	Brian Norris, Cooper Jr.,
	Franklin
  Cc: Wei Yongjun, linux-mtd, linux-kernel

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

In case of error, the function dma_request_chan() returns ERR_PTR() and
never returns NULL. The NULL test in the return value check should be
replaced with IS_ERR().

Fixes: aa7abd312c11 ('mtd: nand: omap2: Support parsing dma channel
information from DT')
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/mtd/nand/omap2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index a36ad3d..26fbe29 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1922,9 +1922,9 @@ static int omap_nand_probe(struct platform_device *pdev)
 		dma_cap_set(DMA_SLAVE, mask);
 		info->dma = dma_request_chan(pdev->dev.parent, "rxtx");
 
-		if (!info->dma) {
+		if (IS_ERR(info->dma)) {
 			dev_err(&pdev->dev, "DMA engine request failed\n");
-			err = -ENXIO;
+			err = PTR_ERR(info->dma);
 			goto return_error;
 		} else {
 			struct dma_slave_config cfg;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] mtd: nand: omap2: fix return value check in omap_nand_probe()
  2016-07-14 12:06 [PATCH -next] mtd: nand: omap2: fix return value check in omap_nand_probe() weiyj_lk
@ 2016-07-14 16:05 ` Brian Norris
  2016-07-15  7:42   ` Boris Brezillon
  2016-07-16  0:14 ` Brian Norris
  1 sibling, 1 reply; 4+ messages in thread
From: Brian Norris @ 2016-07-14 16:05 UTC (permalink / raw)
  To: weiyj_lk
  Cc: Boris Brezillon, Richard Weinberger, David Woodhouse, Cooper Jr.,
	Franklin, Wei Yongjun, linux-mtd, linux-kernel

On Thu, Jul 14, 2016 at 12:06:45PM +0000, weiyj_lk@163.com wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> In case of error, the function dma_request_chan() returns ERR_PTR() and
> never returns NULL. The NULL test in the return value check should be
> replaced with IS_ERR().
> 
> Fixes: aa7abd312c11 ('mtd: nand: omap2: Support parsing dma channel
> information from DT')
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Acked-by: Brian Norris <computersforpeace@gmail.com>

Boris,

The affected commit is in your pull request, which I might review/pull
today. I'll just plan on applying this on top, unless you'd prefer to
fixup and resend.

Brian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] mtd: nand: omap2: fix return value check in omap_nand_probe()
  2016-07-14 16:05 ` Brian Norris
@ 2016-07-15  7:42   ` Boris Brezillon
  0 siblings, 0 replies; 4+ messages in thread
From: Boris Brezillon @ 2016-07-15  7:42 UTC (permalink / raw)
  To: Brian Norris
  Cc: weiyj_lk, Richard Weinberger, David Woodhouse, Cooper Jr.,
	Franklin, Wei Yongjun, linux-mtd, linux-kernel

On Thu, 14 Jul 2016 09:05:39 -0700
Brian Norris <computersforpeace@gmail.com> wrote:

> On Thu, Jul 14, 2016 at 12:06:45PM +0000, weiyj_lk@163.com wrote:
> > From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> > 
> > In case of error, the function dma_request_chan() returns ERR_PTR() and
> > never returns NULL. The NULL test in the return value check should be
> > replaced with IS_ERR().
> > 
> > Fixes: aa7abd312c11 ('mtd: nand: omap2: Support parsing dma channel
> > information from DT')
> > Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>  
> 
> Acked-by: Brian Norris <computersforpeace@gmail.com>
> 
> Boris,
> 
> The affected commit is in your pull request, which I might review/pull
> today. I'll just plan on applying this on top, unless you'd prefer to
> fixup and resend.

Nope, you can apply it directly on top of my pull request (unless you
find other things to fix and want me to send a v3).

Thanks,

Boris

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] mtd: nand: omap2: fix return value check in omap_nand_probe()
  2016-07-14 12:06 [PATCH -next] mtd: nand: omap2: fix return value check in omap_nand_probe() weiyj_lk
  2016-07-14 16:05 ` Brian Norris
@ 2016-07-16  0:14 ` Brian Norris
  1 sibling, 0 replies; 4+ messages in thread
From: Brian Norris @ 2016-07-16  0:14 UTC (permalink / raw)
  To: weiyj_lk
  Cc: Boris Brezillon, Richard Weinberger, David Woodhouse, Cooper Jr.,
	Franklin, Wei Yongjun, linux-mtd, linux-kernel

On Thu, Jul 14, 2016 at 12:06:45PM +0000, weiyj_lk@163.com wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> In case of error, the function dma_request_chan() returns ERR_PTR() and
> never returns NULL. The NULL test in the return value check should be
> replaced with IS_ERR().
> 
> Fixes: aa7abd312c11 ('mtd: nand: omap2: Support parsing dma channel
> information from DT')
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Applied to l2-mtd.git

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-07-16  0:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-14 12:06 [PATCH -next] mtd: nand: omap2: fix return value check in omap_nand_probe() weiyj_lk
2016-07-14 16:05 ` Brian Norris
2016-07-15  7:42   ` Boris Brezillon
2016-07-16  0:14 ` Brian Norris

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.