diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-14 18:44:38 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-14 18:44:38 -0700 |
commit | 2bb590b80b2f057d9277adc86a0858843d15fca6 (patch) | |
tree | 5938e2c0bc92c575a458f3118cf3a6b6e65d3d6c /arch/m68k/include/asm | |
parent | c0e03084000a54d75d1440cce5b71aa9db5a5836 (diff) | |
parent | 41ef2d5678d83af030125550329b6ae8b74618fa (diff) |
Merge 3.9-rc7 into staging-next
We want these fixes here.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/m68k/include/asm')
-rw-r--r-- | arch/m68k/include/asm/gpio.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/m68k/include/asm/gpio.h b/arch/m68k/include/asm/gpio.h index 4395ffc51fd..8cc83431805 100644 --- a/arch/m68k/include/asm/gpio.h +++ b/arch/m68k/include/asm/gpio.h @@ -86,4 +86,24 @@ static inline int gpio_cansleep(unsigned gpio) return gpio < MCFGPIO_PIN_MAX ? 0 : __gpio_cansleep(gpio); } +static inline int gpio_request_one(unsigned gpio, unsigned long flags, const char *label) +{ + int err; + + err = gpio_request(gpio, label); + if (err) + return err; + + if (flags & GPIOF_DIR_IN) + err = gpio_direction_input(gpio); + else + err = gpio_direction_output(gpio, + (flags & GPIOF_INIT_HIGH) ? 1 : 0); + + if (err) + gpio_free(gpio); + + return err; +} + #endif |