diff options
author | Ingo Molnar <mingo@kernel.org> | 2013-04-21 10:57:33 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-04-21 10:57:33 +0200 |
commit | 73e21ce28d8d2b75140b742b01373c3a085ecc52 (patch) | |
tree | add380154271f9a68be4099590f912b4ab4bed9f /arch/m68k/include/asm/gpio.h | |
parent | b5210b2a34bae35fc00675462333af45676d727c (diff) | |
parent | f1923820c447e986a9da0fc6bf60c1dccdf0408e (diff) |
Merge branch 'perf/urgent' into perf/core
Conflicts:
arch/x86/kernel/cpu/perf_event_intel.c
Merge in the latest fixes before applying new patches, resolve the conflict.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/m68k/include/asm/gpio.h')
-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 4395ffc51fdb..8cc83431805b 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 |