]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
iio: adc: xilinx: Remove dead code from xadc_zynq_setup
authorManish Narani <manish.narani@xilinx.com>
Wed, 18 Jul 2018 11:12:09 +0000 (16:42 +0530)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 23 Jul 2018 18:18:11 +0000 (19:18 +0100)
This patch removes dead code from xadc_zynq_setup. The condition
"if (tck_rate > XADC_ZYNQ_TCK_RATE_MAX)" cannot be true at any point of
time. There is also an incompatible parameter used in the code.
This patch fixes the same reported by coverity.

Signed-off-by: Manish Narani <manish.narani@xilinx.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/xilinx-xadc-core.c

index d4f21d1be6c8d107c994b60f56af661bf166dce7..0127e8513166748e6804b850921079a67cb300ff 100644 (file)
@@ -341,8 +341,6 @@ static int xadc_zynq_setup(struct platform_device *pdev,
 
        pcap_rate = clk_get_rate(xadc->clk);
 
-       if (tck_rate > XADC_ZYNQ_TCK_RATE_MAX)
-               tck_rate = XADC_ZYNQ_TCK_RATE_MAX;
        if (tck_rate > pcap_rate / 2) {
                div = 2;
        } else {
@@ -1045,7 +1043,7 @@ static int xadc_parse_dt(struct iio_dev *indio_dev, struct device_node *np,
        unsigned int num_channels;
        const char *external_mux;
        u32 ext_mux_chan;
-       int reg;
+       u32 reg;
        int ret;
 
        *conf = 0;