All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/4] gpio: xilinx: Find out bank before use in xilinx_gpio_get_function()
@ 2018-07-23 11:43 Michal Simek
  2018-07-23 11:43 ` [U-Boot] [PATCH 2/4] gpio: xilinx: Swap xilinx_gpio_get_function with xilinx_gpio_get_value Michal Simek
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Michal Simek @ 2018-07-23 11:43 UTC (permalink / raw)
  To: u-boot

Call xilinx_gpio_get_bank_pin() before use.

Reported-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 drivers/gpio/xilinx_gpio.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpio/xilinx_gpio.c b/drivers/gpio/xilinx_gpio.c
index 48b52c985a55..8ce08d80f491 100644
--- a/drivers/gpio/xilinx_gpio.c
+++ b/drivers/gpio/xilinx_gpio.c
@@ -435,6 +435,10 @@ static int xilinx_gpio_get_function(struct udevice *dev, unsigned offset)
 	int val, ret;
 	u32 bank, pin;
 
+	ret = xilinx_gpio_get_bank_pin(offset, &bank, &pin, dev);
+	if (ret)
+		return ret;
+
 	/* Check if all pins are inputs */
 	if (platdata->bank_input[bank])
 		return GPIOF_INPUT;
@@ -443,10 +447,6 @@ static int xilinx_gpio_get_function(struct udevice *dev, unsigned offset)
 	if (platdata->bank_output[bank])
 		return GPIOF_OUTPUT;
 
-	ret = xilinx_gpio_get_bank_pin(offset, &bank, &pin, dev);
-	if (ret)
-		return ret;
-
 	/* FIXME test on dual */
 	val = readl(&platdata->regs->gpiodir + bank * 2);
 	val = !(val & (1 << pin));
-- 
1.9.1

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

end of thread, other threads:[~2018-08-02 12:56 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-23 11:43 [U-Boot] [PATCH 1/4] gpio: xilinx: Find out bank before use in xilinx_gpio_get_function() Michal Simek
2018-07-23 11:43 ` [U-Boot] [PATCH 2/4] gpio: xilinx: Swap xilinx_gpio_get_function with xilinx_gpio_get_value Michal Simek
2018-07-23 11:43 ` [U-Boot] [PATCH 3/4] gpio: xilinx: Not read output values via regs Michal Simek
2018-07-23 18:42   ` Stefan Herbrechtsmeier
2018-07-24 10:31     ` Michal Simek
2018-07-24 19:56       ` Stefan Herbrechtsmeier
2018-07-25  6:39         ` Michal Simek
2018-07-25 18:21           ` Stefan Herbrechtsmeier
2018-07-26  8:41             ` Michal Simek
2018-07-26 19:46               ` Stefan Herbrechtsmeier
2018-07-27  7:05                 ` Michal Simek
2018-07-27  8:41                   ` Stefan Herbrechtsmeier
2018-07-30 12:40                     ` Michal Simek
2018-07-30 13:32                       ` Stefan Herbrechtsmeier
2018-07-30 14:10                         ` Michal Simek
2018-07-30 19:34                           ` Stefan Herbrechtsmeier
2018-08-01 18:36                             ` Stefan Herbrechtsmeier
2018-08-02 12:56                               ` Michal Simek
2018-07-23 11:43 ` [U-Boot] [PATCH 4/4] gpio: xilinx: Remove !DM driver Michal Simek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.