From patchwork Wed Apr 29 15:34:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 466170 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A95161402B0 for ; Thu, 30 Apr 2015 01:35:40 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753604AbbD2Pfj (ORCPT ); Wed, 29 Apr 2015 11:35:39 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:52591 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753570AbbD2Pfi (ORCPT ); Wed, 29 Apr 2015 11:35:38 -0400 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1YnU1R-0005hq-Rl from Vladimir_Zapolskiy@mentor.com ; Wed, 29 Apr 2015 08:35:38 -0700 Received: from eyas.fin.mentorg.com (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server (TLS) id 14.3.224.2; Wed, 29 Apr 2015 16:35:30 +0100 From: Vladimir Zapolskiy To: Linus Walleij , Alexandre Courbot CC: Subject: [PATCH 1/4] Revert "gpio: generic: clamp retured value to [0,1]" Date: Wed, 29 Apr 2015 18:34:58 +0300 Message-ID: <1430321701-13758-2-git-send-email-vladimir_zapolskiy@mentor.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1430321701-13758-1-git-send-email-vladimir_zapolskiy@mentor.com> References: <1430321701-13758-1-git-send-email-vladimir_zapolskiy@mentor.com> MIME-Version: 1.0 X-Originating-IP: [137.202.0.76] Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org This reverts commit 25b35da7f4cce82271859f1b6eabd9f3bd41a2bb. The original change is a fast workaround in GPIO generic driver, which is properly fixed by Alexandre's 23600969ff centralized handling of return values from GPIO chip drivers. To avoid a redundant check and copy/paste confusion, it is better to revert the change done in a particular driver. Signed-off-by: Vladimir Zapolskiy --- drivers/gpio/gpio-generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-generic.c b/drivers/gpio/gpio-generic.c index b92a690..3f90be8 100644 --- a/drivers/gpio/gpio-generic.c +++ b/drivers/gpio/gpio-generic.c @@ -139,7 +139,7 @@ static int bgpio_get(struct gpio_chip *gc, unsigned int gpio) { struct bgpio_chip *bgc = to_bgpio_chip(gc); - return !!(bgc->read_reg(bgc->reg_dat) & bgc->pin2mask(bgc, gpio)); + return bgc->read_reg(bgc->reg_dat) & bgc->pin2mask(bgc, gpio); } static void bgpio_set(struct gpio_chip *gc, unsigned int gpio, int val)