maa: change dependency on direction for muxs
authorThomas Ingleby <thomas.c.ingleby@intel.com>
Thu, 19 Jun 2014 12:54:19 +0000 (13:54 +0100)
committerThomas Ingleby <thomas.c.ingleby@intel.com>
Thu, 19 Jun 2014 12:54:19 +0000 (13:54 +0100)
* Will not error if cannot set direction, as some muxes are do not have
* the direction file. If the mux really isnt in output mode the
* following write would also fail.

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
src/maa.c

index bfb137e..4cb3283 100644 (file)
--- a/src/maa.c
+++ b/src/maa.c
@@ -119,8 +119,7 @@ maa_setup_mux_mapped(maa_pin_t meta)
         mux_i = maa_gpio_init_raw(meta.mux[mi].pin);
         if (mux_i == NULL)
             return MAA_ERROR_INVALID_HANDLE;
-        if (maa_gpio_dir(mux_i, MAA_GPIO_OUT) != MAA_SUCCESS)
-            return MAA_ERROR_INVALID_RESOURCE;
+        maa_gpio_dir(mux_i, MAA_GPIO_OUT);
         if (maa_gpio_write(mux_i, meta.mux[mi].value) != MAA_SUCCESS)
             return MAA_ERROR_INVALID_RESOURCE;
     }