提交 73edd2b1 编写于 作者: B Bjorn Helgaas

PCI: rockchip: Unindent rockchip_pcie_set_power_limit()

If regulator_get_current_limit() returns 0 or error, return early so the
body of the function doesn't have to be indented as the body of an "if"
statement.  No functional change intended.
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
上级 5fcaa005
...@@ -438,7 +438,9 @@ static void rockchip_pcie_set_power_limit(struct rockchip_pcie *rockchip) ...@@ -438,7 +438,9 @@ static void rockchip_pcie_set_power_limit(struct rockchip_pcie *rockchip)
* to the actual power supply. * to the actual power supply.
*/ */
curr = regulator_get_current_limit(rockchip->vpcie3v3); curr = regulator_get_current_limit(rockchip->vpcie3v3);
if (curr > 0) { if (curr <= 0)
return;
scale = 3; /* 0.001x */ scale = 3; /* 0.001x */
curr = curr / 1000; /* convert to mA */ curr = curr / 1000; /* convert to mA */
power = (curr * 3300) / 1000; /* milliwatt */ power = (curr * 3300) / 1000; /* milliwatt */
...@@ -455,7 +457,6 @@ static void rockchip_pcie_set_power_limit(struct rockchip_pcie *rockchip) ...@@ -455,7 +457,6 @@ static void rockchip_pcie_set_power_limit(struct rockchip_pcie *rockchip)
status |= (power << PCIE_RC_CONFIG_DCR_CSPL_SHIFT) | status |= (power << PCIE_RC_CONFIG_DCR_CSPL_SHIFT) |
(scale << PCIE_RC_CONFIG_DCR_CPLS_SHIFT); (scale << PCIE_RC_CONFIG_DCR_CPLS_SHIFT);
rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_DCR); rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_DCR);
}
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册