dmaengine: zynqmp_dma: Fix static checker warning
authorKedareswara rao Appana <appana.durga.rao@xilinx.com>
Thu, 14 Jul 2016 13:30:55 +0000 (19:00 +0530)
committerVinod Koul <vinod.koul@intel.com>
Sun, 24 Jul 2016 05:49:22 +0000 (11:19 +0530)
This patch fixes the below static checker warning
drivers/dma/xilinx/zynqmp_dma.c:973 zynqmp_dma_chan_probe()
        warn: was && intended here instead of ||?

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/xilinx/zynqmp_dma.c

index f777a5bc0db8bacc1ba4b25884e7178cd5fe1535..b18d51f7f38ceec7f5cb79ed89d666189c4bb6d8 100644 (file)
@@ -970,12 +970,17 @@ static int zynqmp_dma_chan_probe(struct zynqmp_dma_device *zdev,
        chan->dst_burst_len = ZYNQMP_DMA_AWLEN_RST_VAL;
        chan->src_burst_len = ZYNQMP_DMA_ARLEN_RST_VAL;
        err = of_property_read_u32(node, "xlnx,bus-width", &chan->bus_width);
-       if ((err < 0) && ((chan->bus_width != ZYNQMP_DMA_BUS_WIDTH_64) ||
-                         (chan->bus_width != ZYNQMP_DMA_BUS_WIDTH_128))) {
-               dev_err(zdev->dev, "invalid bus-width value");
+       if (err < 0) {
+               dev_err(&pdev->dev, "missing xlnx,bus-width property\n");
                return err;
        }
 
+       if (chan->bus_width != ZYNQMP_DMA_BUS_WIDTH_64 &&
+           chan->bus_width != ZYNQMP_DMA_BUS_WIDTH_128) {
+               dev_err(zdev->dev, "invalid bus-width value");
+               return -EINVAL;
+       }
+
        chan->is_dmacoherent =  of_property_read_bool(node, "dma-coherent");
        zdev->chan = chan;
        tasklet_init(&chan->tasklet, zynqmp_dma_do_tasklet, (ulong)chan);