[U-Boot] [PATCH 2/4] gpio: xilinx: Swap xilinx_gpio_get_function with xilinx_gpio_get_value

Michal Simek michal.simek at xilinx.com
Mon Jul 23 11:43:35 UTC 2018


Exchange two functions to avoid function declaration for next patch.

Signed-off-by: Michal Simek <michal.simek at xilinx.com>
---

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

diff --git a/drivers/gpio/xilinx_gpio.c b/drivers/gpio/xilinx_gpio.c
index 8ce08d80f491..4da9ae114d87 100644
--- a/drivers/gpio/xilinx_gpio.c
+++ b/drivers/gpio/xilinx_gpio.c
@@ -410,25 +410,6 @@ static int xilinx_gpio_set_value(struct udevice *dev, unsigned offset,
 	return val;
 };
 
-static int xilinx_gpio_get_value(struct udevice *dev, unsigned offset)
-{
-	struct xilinx_gpio_platdata *platdata = dev_get_platdata(dev);
-	int val, ret;
-	u32 bank, pin;
-
-	ret = xilinx_gpio_get_bank_pin(offset, &bank, &pin, dev);
-	if (ret)
-		return ret;
-
-	debug("%s: regs: %lx, gpio: %x, bank %x, pin %x\n", __func__,
-	      (ulong)platdata->regs, offset, bank, pin);
-
-	val = readl(&platdata->regs->gpiodata + bank * 2);
-	val = !!(val & (1 << pin));
-
-	return val;
-};
-
 static int xilinx_gpio_get_function(struct udevice *dev, unsigned offset)
 {
 	struct xilinx_gpio_platdata *platdata = dev_get_platdata(dev);
@@ -457,6 +438,25 @@ static int xilinx_gpio_get_function(struct udevice *dev, unsigned offset)
 	return val;
 }
 
+static int xilinx_gpio_get_value(struct udevice *dev, unsigned offset)
+{
+	struct xilinx_gpio_platdata *platdata = dev_get_platdata(dev);
+	int val, ret;
+	u32 bank, pin;
+
+	ret = xilinx_gpio_get_bank_pin(offset, &bank, &pin, dev);
+	if (ret)
+		return ret;
+
+	debug("%s: regs: %lx, gpio: %x, bank %x, pin %x\n", __func__,
+	      (ulong)platdata->regs, offset, bank, pin);
+
+	val = readl(&platdata->regs->gpiodata + bank * 2);
+	val = !!(val & (1 << pin));
+
+	return val;
+};
+
 static int xilinx_gpio_direction_output(struct udevice *dev, unsigned offset,
 					int value)
 {
-- 
1.9.1



More information about the U-Boot mailing list