gpio: improve error path in gpiolib
At several places the gpiolib will proceed to handle a GPIO descriptor even if it's ->chip member is NULL and no gpiochip is associated. Fix this by checking that both the descriptor cookie *and* the chip pointer are valid. Also bail out earlier with more specific diagnostic messages on missing operations for setting as input/output or debounce. ChangeLog v1->v2: - Also return -EIO on gpiod_set_debounce() with missing operations in the vtable - Fix indentations. Suggested-by: NAlexandre Courbot <acourbot@nvidia.com> Acked-by: NAlexandre Courbot <acourbot@nvidia.com> Reviewed-by: NFrank Rowand <frank.rowand@sonymobile.com> Cc: Tim Bird <tim.bird@sonymobile.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
Showing
想要评论请 注册 或 登录