aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorSergio Paracuellos <sergio.paracuellos@gmail.com>2018-06-01 11:30:54 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-06-01 13:16:24 +0200
commit1e2735fe1b49cfa5dd668f61778aaaa46c6fe1c8 (patch)
tree2acf618358afd4cde6eefd6b44739588d01817ec /drivers/staging
parentstaging: mt7621-gpio: change 'to_mediatek_gpio' to make just a one line return (diff)
downloadlinux-dev-1e2735fe1b49cfa5dd668f61778aaaa46c6fe1c8.tar.xz
linux-dev-1e2735fe1b49cfa5dd668f61778aaaa46c6fe1c8.zip
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: Sergio Paracuellos <sergio.paracuellos@gmail.com> Reviewed-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/mt7621-gpio/gpio-mt7621.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c b/drivers/staging/mt7621-gpio/gpio-mt7621.c
index a8adee3b59b3..390cc56b3ac4 100644
--- a/drivers/staging/mt7621-gpio/gpio-mt7621.c
+++ b/drivers/staging/mt7621-gpio/gpio-mt7621.c
@@ -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