commit | fc4e2514995d9cd7f3e1a67098ce65d72acf8ec7 | [log] [tgz] |
---|---|---|
author | Ryan Mallon <rmallon@gmail.com> | Mon Oct 22 11:39:12 2012 +1100 |
committer | Linus Walleij <linus.walleij@linaro.org> | Tue Oct 23 00:13:36 2012 +0200 |
tree | 05cb8ff2fbf178fd5282e970173cac05f6e6c132 | |
parent | 67a0d4993d85ee2f42c9909127794553df69dd59 [diff] |
gpiolib: Refactor gpio_export The gpio_export function uses nested if statements and the status variable to handle the failure cases. This makes the function logic difficult to follow. Refactor the code to abort immediately on failure using goto. This makes the code slightly longer, but significantly reduces the nesting and number of split lines and makes the code easier to read. Signed-off-by: Ryan Mallon <rmallon@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>