dm: gpio: Rename get_dir_flags() method to get_flags()
It is more useful to be able to read all the flags, not just the direction
ones. In fact this is what the STM32 driver does. Update the method name
to reflect this.
Tweak the docs a little and use 'flagsp' as the return argument, as is
common in driver model, to indicate it returns a value.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
diff --git a/drivers/gpio/stm32_gpio.c b/drivers/gpio/stm32_gpio.c
index 6d1bef6..c2d7046 100644
--- a/drivers/gpio/stm32_gpio.c
+++ b/drivers/gpio/stm32_gpio.c
@@ -223,8 +223,8 @@
return 0;
}
-static int stm32_gpio_get_dir_flags(struct udevice *dev, unsigned int offset,
- ulong *flags)
+static int stm32_gpio_get_flags(struct udevice *dev, unsigned int offset,
+ ulong *flagsp)
{
struct stm32_gpio_priv *priv = dev_get_priv(dev);
struct stm32_gpio_regs *regs = priv->regs;
@@ -259,7 +259,7 @@
default:
break;
}
- *flags = dir_flags;
+ *flagsp = dir_flags;
return 0;
}
@@ -271,7 +271,7 @@
.set_value = stm32_gpio_set_value,
.get_function = stm32_gpio_get_function,
.set_flags = stm32_gpio_set_flags,
- .get_dir_flags = stm32_gpio_get_dir_flags,
+ .get_flags = stm32_gpio_get_flags,
};
static int gpio_stm32_probe(struct udevice *dev)