From 90c9e4afd7e7b61b1619b9ed6b612ea9864aaffd Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Wed, 4 Jan 2017 17:55:26 +0100 Subject: [PATCH] core: rename direction defines Signed-off-by: Bartosz Golaszewski --- core.c | 10 +++++----- gpiod.h | 4 ++-- gpioinfo.c | 2 +- gpioset.c | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core.c b/core.c index 1994fdd..96949dc 100644 --- a/core.c +++ b/core.c @@ -157,8 +157,8 @@ const char * gpiod_line_consumer(struct gpiod_line *line) int gpiod_line_direction(struct gpiod_line *line) { - return line->info.flags & GPIOLINE_FLAG_IS_OUT ? GPIOD_DIRECTION_OUT - : GPIOD_DIRECTION_IN; + return line->info.flags & GPIOLINE_FLAG_IS_OUT ? GPIOD_DIRECTION_OUTPUT + : GPIOD_DIRECTION_INPUT; } int gpiod_line_polarity(struct gpiod_line *line) @@ -256,9 +256,9 @@ int gpiod_line_request_bulk(struct gpiod_line_bulk *line_bulk, if (config->flags & GPIOD_REQUEST_OPEN_SOURCE) req->flags |= GPIOHANDLE_REQUEST_OPEN_SOURCE; - if (config->direction == GPIOD_DIRECTION_IN) + if (config->direction == GPIOD_DIRECTION_INPUT) req->flags |= GPIOHANDLE_REQUEST_INPUT; - else if (config->direction == GPIOD_DIRECTION_OUT) + else if (config->direction == GPIOD_DIRECTION_OUTPUT) req->flags |= GPIOHANDLE_REQUEST_OUTPUT; if (config->polarity == GPIOD_POLARITY_ACTIVE_LOW) @@ -268,7 +268,7 @@ int gpiod_line_request_bulk(struct gpiod_line_bulk *line_bulk, for (i = 0; i < line_bulk->num_lines; i++) { req->lineoffsets[i] = gpiod_line_offset(line_bulk->lines[i]); - if (config->direction == GPIOD_DIRECTION_OUT) + if (config->direction == GPIOD_DIRECTION_OUTPUT) req->default_values[i] = !!default_vals[i]; } diff --git a/gpiod.h b/gpiod.h index d6b26b1..5792fbf 100644 --- a/gpiod.h +++ b/gpiod.h @@ -48,8 +48,8 @@ int gpiod_simple_get_value(const char *device, unsigned int offset) GPIOD_API; enum { GPIOD_DIRECTION_AS_IS, - GPIOD_DIRECTION_IN, - GPIOD_DIRECTION_OUT, + GPIOD_DIRECTION_INPUT, + GPIOD_DIRECTION_OUTPUT, }; enum { diff --git a/gpioinfo.c b/gpioinfo.c index 90c1d60..327d34f 100644 --- a/gpioinfo.c +++ b/gpioinfo.c @@ -80,7 +80,7 @@ int main(int argc, char **argv) printf("unused"); printf(" "); - printf("%s ", direction == GPIOD_DIRECTION_IN + printf("%s ", direction == GPIOD_DIRECTION_INPUT ? "input" : "output"); printf("%s ", polarity == GPIOD_POLARITY_ACTIVE_LOW ? "active-low" diff --git a/gpioset.c b/gpioset.c index 5245cd0..841f3fa 100644 --- a/gpioset.c +++ b/gpioset.c @@ -71,7 +71,7 @@ int main(int argc, char **argv) memset(&config, 0, sizeof(config)); config.consumer = "gpioset"; - config.direction = GPIOD_DIRECTION_OUT; + config.direction = GPIOD_DIRECTION_OUTPUT; status = gpiod_line_request(line, &config, value); if (status < 0) { -- 2.30.2