summaryrefslogtreecommitdiff
path: root/drivers/dma
diff options
context:
space:
mode:
authorKedareswara rao Appana <appana.durga.rao@xilinx.com>2016-07-14 13:30:55 (GMT)
committerVinod Koul <vinod.koul@intel.com>2016-07-24 05:49:22 (GMT)
commitcaf5ee94be697f8df6d0292e19f3afa4d74745ce (patch)
tree0b86f9e59408fe83aa9870b6b3c095d8f10a5d25 /drivers/dma
parentad52465b6c37a6a3c24b2455404f6f524a1ce14d (diff)
downloadlinux-caf5ee94be697f8df6d0292e19f3afa4d74745ce.tar.xz
dmaengine: zynqmp_dma: Fix static checker warning
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>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/xilinx/zynqmp_dma.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
index f777a5b..b18d51f 100644
--- a/drivers/dma/xilinx/zynqmp_dma.c
+++ b/drivers/dma/xilinx/zynqmp_dma.c
@@ -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);