]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
clk: zynqmp: Fixed the same if/else part error reported by coverity
authorVipul Kumar <vipul.kumar@xilinx.com>
Wed, 27 Jun 2018 05:14:45 +0000 (10:44 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 27 Jun 2018 07:11:58 +0000 (09:11 +0200)
This patch fixed the same if/else part error by adding the required
source select on the basis of is_pre_src check.

Signed-off-by: Vipul Kumar <vipul.kumar@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/clk/clk_zynqmp.c

index d0d6c898bc58c34a92a8ad569a18208e08c49df0..4c4f0fe2310ce9a08e2253030b74c05d1b15fae7 100644 (file)
@@ -106,6 +106,8 @@ static const resource_size_t zynqmp_crl_apb_clkc_base = 0xff5e0020;
 #define PLLCTRL_BYPASS_SHFT    3
 #define PLLCTRL_POST_SRC_SHFT  24
 #define PLLCTRL_POST_SRC_MASK  (0x7 << PLLCTRL_POST_SRC_SHFT)
+#define PLLCTRL_PRE_SRC_SHFT   20
+#define PLLCTRL_PRE_SRC_MASK   (0x7 << PLLCTRL_PRE_SRC_SHFT)
 
 
 #define NUM_MIO_PINS   77
@@ -313,8 +315,8 @@ static ulong zynqmp_clk_get_pll_src(ulong clk_ctrl,
        u32 src_sel;
 
        if (is_pre_src)
-               src_sel = (clk_ctrl & PLLCTRL_POST_SRC_MASK) >>
-                          PLLCTRL_POST_SRC_SHFT;
+               src_sel = (clk_ctrl & PLLCTRL_PRE_SRC_MASK) >>
+                          PLLCTRL_PRE_SRC_SHFT;
        else
                src_sel = (clk_ctrl & PLLCTRL_POST_SRC_MASK) >>
                           PLLCTRL_POST_SRC_SHFT;