From: Linus Walleij Date: Fri, 30 Aug 2013 07:41:45 +0000 (+0200) Subject: gpio: improve error path in gpiolib X-Git-Tag: v3.12-rc1~111^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be1a4b13089b1e18da83a549d49163ccad3c19ba;p=pandora-kernel.git 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-diff-tree failed