diff mbox series

[U-Boot,v2,4/5] gpio: sandbox: Rename GPIOF_(OUTPUT|HIGH|ODR) to SDBX_GPIO_(OUTPUT|HIGH|ODR)

Message ID 1533308471-14098-5-git-send-email-patrice.chotard@st.com
State Superseded
Delegated to: Tom Rini
Headers show
Series Add get_alternate_function ops | expand

Commit Message

Patrice CHOTARD Aug. 3, 2018, 3:01 p.m. UTC
To avoid confusion with enum gpio_func_t GPIOF_OUTPUT defined in
asm-generic/gpio.h, rename all sandbox flags GPIOF_(OUTPUT|HIGH|ODR)
to SDBX_GPIO_(OUTPUT|HIGH|ODR)

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
---

Changes in v2: None

 drivers/gpio/sandbox.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

Comments

Simon Glass Aug. 8, 2018, 9:55 a.m. UTC | #1
On 3 August 2018 at 09:01, Patrice Chotard <patrice.chotard@st.com> wrote:
> To avoid confusion with enum gpio_func_t GPIOF_OUTPUT defined in
> asm-generic/gpio.h, rename all sandbox flags GPIOF_(OUTPUT|HIGH|ODR)
> to SDBX_GPIO_(OUTPUT|HIGH|ODR)
>
> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
> ---
>
> Changes in v2: None
>
>  drivers/gpio/sandbox.c | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
>

Please use a SANDBOX_ prefix instead of SDBX_

But otherwise:

Reviewed-by: Simon Glass <sjg@chromium.org>
Patrice CHOTARD Aug. 9, 2018, 8:03 a.m. UTC | #2
Hi Simon

On 08/08/2018 11:55 AM, Simon Glass wrote:
> On 3 August 2018 at 09:01, Patrice Chotard <patrice.chotard@st.com> wrote:
>> To avoid confusion with enum gpio_func_t GPIOF_OUTPUT defined in
>> asm-generic/gpio.h, rename all sandbox flags GPIOF_(OUTPUT|HIGH|ODR)
>> to SDBX_GPIO_(OUTPUT|HIGH|ODR)
>>
>> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
>> ---
>>
>> Changes in v2: None
>>
>>   drivers/gpio/sandbox.c | 22 +++++++++++-----------
>>   1 file changed, 11 insertions(+), 11 deletions(-)
>>
> 
> Please use a SANDBOX_ prefix instead of SDBX_

I will update this

Thanks
Patrice

> 
> But otherwise:
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> _______________________________________________
> Uboot-stm32 mailing list
> Uboot-stm32@st-md-mailman.stormreply.com
> https://st-md-mailman.stormreply.com/mailman/listinfo/uboot-stm32
>
diff mbox series

Patch

diff --git a/drivers/gpio/sandbox.c b/drivers/gpio/sandbox.c
index 2ef5c67ad593..50afa697d01c 100644
--- a/drivers/gpio/sandbox.c
+++ b/drivers/gpio/sandbox.c
@@ -12,9 +12,9 @@ 
 #include <dt-bindings/gpio/gpio.h>
 
 /* Flags for each GPIO */
-#define GPIOF_OUTPUT	(1 << 0)	/* Currently set as an output */
-#define GPIOF_HIGH	(1 << 1)	/* Currently set high */
-#define GPIOF_ODR	(1 << 2)	/* Currently set to open drain mode */
+#define SDBX_GPIO_OUTPUT	BIT(0)	/* Currently set as an output */
+#define SDBX_GPIO_HIGH		BIT(1)	/* Currently set high */
+#define SDBX_GPIO_ODR		BIT(2)	/* Currently set to open drain mode */
 
 struct gpio_state {
 	const char *label;	/* label given by requester */
@@ -60,34 +60,34 @@  static int set_gpio_flag(struct udevice *dev, unsigned offset, int flag,
 
 int sandbox_gpio_get_value(struct udevice *dev, unsigned offset)
 {
-	if (get_gpio_flag(dev, offset, GPIOF_OUTPUT))
+	if (get_gpio_flag(dev, offset, SDBX_GPIO_OUTPUT))
 		debug("sandbox_gpio: get_value on output gpio %u\n", offset);
-	return get_gpio_flag(dev, offset, GPIOF_HIGH);
+	return get_gpio_flag(dev, offset, SDBX_GPIO_HIGH);
 }
 
 int sandbox_gpio_set_value(struct udevice *dev, unsigned offset, int value)
 {
-	return set_gpio_flag(dev, offset, GPIOF_HIGH, value);
+	return set_gpio_flag(dev, offset, SDBX_GPIO_HIGH, value);
 }
 
 int sandbox_gpio_get_open_drain(struct udevice *dev, unsigned offset)
 {
-	return get_gpio_flag(dev, offset, GPIOF_ODR);
+	return get_gpio_flag(dev, offset, SDBX_GPIO_ODR);
 }
 
 int sandbox_gpio_set_open_drain(struct udevice *dev, unsigned offset, int value)
 {
-	return set_gpio_flag(dev, offset, GPIOF_ODR, value);
+	return set_gpio_flag(dev, offset, SDBX_GPIO_ODR, value);
 }
 
 int sandbox_gpio_get_direction(struct udevice *dev, unsigned offset)
 {
-	return get_gpio_flag(dev, offset, GPIOF_OUTPUT);
+	return get_gpio_flag(dev, offset, SDBX_GPIO_OUTPUT);
 }
 
 int sandbox_gpio_set_direction(struct udevice *dev, unsigned offset, int output)
 {
-	return set_gpio_flag(dev, offset, GPIOF_OUTPUT, output);
+	return set_gpio_flag(dev, offset, SDBX_GPIO_OUTPUT, output);
 }
 
 /*
@@ -158,7 +158,7 @@  static int sb_gpio_set_open_drain(struct udevice *dev, unsigned offset, int valu
 
 static int sb_gpio_get_function(struct udevice *dev, unsigned offset)
 {
-	if (get_gpio_flag(dev, offset, GPIOF_OUTPUT))
+	if (get_gpio_flag(dev, offset, SDBX_GPIO_OUTPUT))
 		return GPIOF_OUTPUT;
 	return GPIOF_INPUT;
 }