Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1596580

[PATCH v2 1/5] PCI: rockchip: fix sign issues for current limits

From Brian Norris <briannorris@chromium.org>
Newsgroups linux.kernel
Subject [PATCH v2 1/5] PCI: rockchip: fix sign issues for current limits
Date 2017-03-10 03:50 +0100
Message-ID <tjiMV-5zt-3@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


The regulator framework can return negative error codes via
regulator_get_current_limit() for regulators that don't provide current
information. The subsequent check for postive values isn't very useful,
if the variable is unsigned.

Let's just match the signedness of the return value.

Prevents error messages like this, seen on Samsung Chromebook Plus:

[    1.069372] rockchip-pcie f8000000.pcie: invalid power supply

Fixes: 4816c4c7b82b ("PCI: rockchip: Provide captured slot power limit and scale")
Signed-off-by: Brian Norris <briannorris@chromium.org>
Acked-by: Shawn Lin <shawn.lin@rock-chips.com>
---
v2: add Shawn's ack
---
 drivers/pci/host/pcie-rockchip.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c
index 26ddd3535272..d785f64ec03b 100644
--- a/drivers/pci/host/pcie-rockchip.c
+++ b/drivers/pci/host/pcie-rockchip.c
@@ -425,7 +425,8 @@ static struct pci_ops rockchip_pcie_ops = {
 
 static void rockchip_pcie_set_power_limit(struct rockchip_pcie *rockchip)
 {
-	u32 status, curr, scale, power;
+	int curr;
+	u32 status, scale, power;
 
 	if (IS_ERR(rockchip->vpcie3v3))
 		return;
-- 
2.12.0.246.ga2ecc84866-goog

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 1/5] PCI: rockchip: fix sign issues for current limits Brian Norris <briannorris@chromium.org> - 2017-03-10 03:50 +0100
  [PATCH v2 3/5] PCI: rockchip: add remove() support Brian Norris <briannorris@chromium.org> - 2017-03-10 03:50 +0100
    Re: [PATCH v2 3/5] PCI: rockchip: add remove() support Shawn Lin <shawn.lin@rock-chips.com> - 2017-03-10 04:30 +0100
      Re: [PATCH v2 3/5] PCI: rockchip: add remove() support Shawn Lin <shawn.lin@rock-chips.com> - 2017-03-10 05:30 +0100
        Re: [PATCH v2 3/5] PCI: rockchip: add remove() support Brian Norris <briannorris@chromium.org> - 2017-03-10 20:50 +0100
          Re: [PATCH v2 3/5] PCI: rockchip: add remove() support Shawn Lin <shawn.lin@rock-chips.com> - 2017-03-13 03:30 +0100
  [PATCH v2 5/5] PCI: rockchip: modularize Brian Norris <briannorris@chromium.org> - 2017-03-10 03:50 +0100

csiph-web