UPSTREAM: PCI: rockchip: fix wrong negotiated lanes calculation
[firefly-linux-kernel-4.4.55.git] / drivers / pci / host / pcie-rockchip.c
index f204f8b60b00f9c63d50821a143dd09b9dd2f3e9..fd8620f92cae9586d3f28b96bcce19826188665b 100644 (file)
@@ -595,8 +595,8 @@ static int rockchip_pcie_init_port(struct rockchip_pcie *rockchip)
 
        /* Check the final link width from negotiated lane counter from MGMT */
        status = rockchip_pcie_read(rockchip, PCIE_CORE_CTRL);
-       status =  0x1 << ((status & PCIE_CORE_PL_CONF_LANE_MASK) >>
-                         PCIE_CORE_PL_CONF_LANE_MASK);
+       status = 0x1 << ((status & PCIE_CORE_PL_CONF_LANE_MASK) >>
+                         PCIE_CORE_PL_CONF_LANE_SHIFT);
        dev_dbg(dev, "current link width is x%d\n", status);
 
        rockchip_pcie_write(rockchip, ROCKCHIP_VENDOR_ID,