fix following cocci warning: ./drivers/dma/dmaengine.c:825:5-12: ERROR: PTR_ERR applied after initialization to constant on line 815. Signed-off-by: Guo Zhengkui <guozhengkui@xxxxxxxx> --- drivers/dma/dmaengine.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index 2cfa8458b51b..0e6ff875c34e 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -822,10 +822,10 @@ struct dma_chan *dma_request_chan(struct device *dev, const char *name) if (has_acpi_companion(dev) && !chan) chan = acpi_dma_request_slave_chan_by_name(dev, name); - if (PTR_ERR(chan) == -EPROBE_DEFER) - return chan; - - if (!IS_ERR_OR_NULL(chan)) + if (IS_ERR_OR_NULL(chan)) { + if (PTR_ERR(chan) == -EPROBE_DEFER) + return chan; + } else goto found; /* Try to find the channel via the DMA filter map(s) */ -- 2.20.1