From be1a4b13089b1e18da83a549d49163ccad3c19ba Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Fri, 30 Aug 2013 09:41:45 +0200 Subject: [PATCH] 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: Alexandre Courbot Acked-by: Alexandre Courbot Reviewed-by: Frank Rowand Cc: Tim Bird Signed-off-by: Linus Walleij --- Reading git-format-patch failed