Linux-Rockchip Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/5] PCI: rockchip: fix sign issues for current limits
@ 2017-03-10  2:46 Brian Norris
       [not found] ` <20170310024617.67303-1-briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  2017-03-23 22:27 ` [PATCH v2 1/5] PCI: rockchip: fix sign issues for current limits Bjorn Helgaas
  0 siblings, 2 replies; 21+ messages in thread
From: Brian Norris @ 2017-03-10  2:46 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Jeffy Chen, linux-pci-u79uwXL29TY76Z2rM5mHXA, Shawn Lin,
	Wenrui Li, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Brian Norris,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

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-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Acked-by: Shawn Lin <shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
---
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

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2017-04-21 19:03 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-10  2:46 [PATCH v2 1/5] PCI: rockchip: fix sign issues for current limits Brian Norris
     [not found] ` <20170310024617.67303-1-briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2017-03-10  2:46   ` [PATCH v2 2/5] PCI: rockchip: make 'return 0' more obvious in probe() Brian Norris
2017-03-10  2:46   ` [PATCH v2 3/5] PCI: rockchip: add remove() support Brian Norris
2017-03-10  3:22     ` Shawn Lin
2017-03-10  4:20       ` Shawn Lin
     [not found]         ` <5cec190e-4eee-fc55-7039-2336ba5253f3-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2017-03-10 19:40           ` Brian Norris
2017-03-13  2:26             ` Shawn Lin
     [not found]               ` <e41ab95e-9f65-2822-1ec2-a02a4766d53d-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2017-03-20 22:29                 ` Brian Norris
2017-03-24 14:25     ` Bjorn Helgaas
2017-03-24 17:22       ` Brian Norris
     [not found]         ` <20170324172218.GA119093-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2017-03-30 23:28           ` Bjorn Helgaas
2017-03-31  0:26             ` Brian Norris
2017-03-31  5:17               ` Bjorn Helgaas
2017-03-31 16:40                 ` Brian Norris
2017-04-11 18:18                   ` Brian Norris
2017-03-10  2:46   ` [PATCH v2 4/5] PCI: export pci_remap_iospace() and pci_unmap_iospace() Brian Norris
2017-03-10  2:46   ` [PATCH v2 5/5] PCI: rockchip: modularize Brian Norris
2017-03-23 22:27 ` [PATCH v2 1/5] PCI: rockchip: fix sign issues for current limits Bjorn Helgaas
2017-03-23 22:33   ` Brian Norris
2017-03-24  1:24     ` Shawn Lin
2017-04-21 19:03   ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox