From: Thomas Ingleby Date: Wed, 21 May 2014 13:55:14 +0000 (+0100) Subject: gpio: made export functions static. X-Git-Tag: v0.2.6~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=98800a5c76b5e2ffd6e8c8bfea7afbb6e263c01a;p=contrib%2Fmraa.git gpio: made export functions static. * removed functions from api also Signed-off-by: Thomas Ingleby --- diff --git a/api/gpio.h b/api/gpio.h index adfe45b..b371154 100644 --- a/api/gpio.h +++ b/api/gpio.h @@ -151,23 +151,6 @@ maa_result_t maa_gpio_dir(maa_gpio_context dev, gpio_dir_t dir); */ maa_result_t maa_gpio_close(maa_gpio_context dev); -/** Unexport the GPIO context (maa_gpio_close() will call this function) - * - * @param dev The GPIO context. - * - * @return maa result type. - */ -maa_result_t maa_gpio_unexport(maa_gpio_context dev); - -/** Unexport the GPIO context (maa_gpio_close() will call this function) - * Forces regardless to to ownership. - * - * @param dev The GPIO context. - * - * @return maa result type. - */ -maa_result_t maa_gpio_unexport_force(maa_gpio_context dev); - /** Read the GPIO value. * * @param dev The GPIO context. diff --git a/src/gpio/gpio.c b/src/gpio/gpio.c index 1a625c4..c3a80e9 100644 --- a/src/gpio/gpio.c +++ b/src/gpio/gpio.c @@ -411,16 +411,7 @@ maa_gpio_write(maa_gpio_context dev, int value) return MAA_SUCCESS; } -maa_result_t -maa_gpio_unexport(maa_gpio_context dev) -{ - if(dev->owner) { - return maa_gpio_unexport_force(dev); - } - return MAA_ERROR_INVALID_RESOURCE; -} - -maa_result_t +static maa_result_t maa_gpio_unexport_force(maa_gpio_context dev) { int unexport = open(SYSFS_CLASS_GPIO "/unexport", O_WRONLY); @@ -441,6 +432,14 @@ maa_gpio_unexport_force(maa_gpio_context dev) maa_gpio_isr_exit(dev); return MAA_SUCCESS; } +static maa_result_t +maa_gpio_unexport(maa_gpio_context dev) +{ + if(dev->owner) { + return maa_gpio_unexport_force(dev); + } + return MAA_ERROR_INVALID_RESOURCE; +} maa_result_t maa_gpio_close(maa_gpio_context dev)