Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752135AbbHMNG7 (ORCPT ); Thu, 13 Aug 2015 09:06:59 -0400 Received: from mail-oi0-f42.google.com ([209.85.218.42]:33803 "EHLO mail-oi0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751517AbbHMNG5 (ORCPT ); Thu, 13 Aug 2015 09:06:57 -0400 MIME-Version: 1.0 In-Reply-To: <20150810224109.GN6519@usrtlx11787.corpusers.net> References: <1438048204-632-1-git-send-email-bjorn.andersson@sonymobile.com> <20150728210040.GE19610@dtor-ws> <20150810224109.GN6519@usrtlx11787.corpusers.net> Date: Thu, 13 Aug 2015 15:06:56 +0200 Message-ID: Subject: Re: [PATCH] input: gpio_keys: Don't report events on gpio failure From: Linus Walleij To: Bjorn Andersson , Alexandre Courbot Cc: Dmitry Torokhov , "linux-input@vger.kernel.org" , "linux-kernel@vger.kernel.org" , John Stultz , "linux-gpio@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1128 Lines: 34 On Tue, Aug 11, 2015 at 12:41 AM, Bjorn Andersson wrote: > But then the question first goes to Linus & co. > > gpio_chip->get() can return a negative value to indicate errors (and did > so in this case), all parts of the API seems indicates that we can get > an error (int vs bool). Ooops. > Should we change _gpiod_get_raw_value() to propagate this error? Yes for now. Can you patch it? :) > Or > should we just ignore this issue and propagate an error as GPIO high > reading? I don't know about the future. In some sense GPIOs are so smallish resources that errorhandling every call to read/write them seem to be a royal PITA. That is why I wanted to switch them to bool and get rid of the problem, but now I also see that maybe that was not such a smart idea, if errors do occur on the set/get_value path. Alexandre? Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/