Commit 1e2735fe authored by Sergio Paracuellos's avatar Sergio Paracuellos Committed by Greg Kroah-Hartman

staging: mt7621-gpio: use GPIOF_DIR_OUT and GPIOF_DIR_IN macros instead of custom values

There are macros in gpio kernel's headers to define direction
of a gpio. Use them instead of return custom '0' and '1' values.
Signed-off-by: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
Reviewed-by: default avatarNeilBrown <neil@brown.name>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 64379af8
......@@ -6,6 +6,7 @@
#include <linux/io.h>
#include <linux/err.h>
#include <linux/gpio.h>
#include <linux/gpio/driver.h>
#include <linux/module.h>
#include <linux/of_irq.h>
......@@ -127,7 +128,7 @@ mediatek_gpio_get_direction(struct gpio_chip *chip, unsigned int offset)
struct mtk_gc *rg = to_mediatek_gpio(chip);
u32 t = mtk_gpio_r32(rg, GPIO_REG_CTRL);
return (t & BIT(offset)) ? 0 : 1;
return (t & BIT(offset)) ? GPIOF_DIR_OUT : GPIOF_DIR_IN;
}
static int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment