From patchwork Tue Dec 22 14:52:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 58930 Delivered-To: patch@linaro.org Received: by 10.112.89.199 with SMTP id bq7csp3282212lbb; Tue, 22 Dec 2015 06:52:08 -0800 (PST) X-Received: by 10.98.42.69 with SMTP id q66mr35702440pfq.72.1450795928625; Tue, 22 Dec 2015 06:52:08 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 82si11710824pfh.152.2015.12.22.06.52.08; Tue, 22 Dec 2015 06:52:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753877AbbLVOwH (ORCPT + 4 others); Tue, 22 Dec 2015 09:52:07 -0500 Received: from mail-lf0-f46.google.com ([209.85.215.46]:33229 "EHLO mail-lf0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753525AbbLVOwG (ORCPT ); Tue, 22 Dec 2015 09:52:06 -0500 Received: by mail-lf0-f46.google.com with SMTP id p203so132123923lfa.0 for ; Tue, 22 Dec 2015 06:52:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=p6yg4PmqmOWxqghuPeQwMayADa10YOpcP7uhykUcTgg=; b=YG5FgO30Vo7ILTFaHYPytiY6l6gtQj0Bo3nisUzxrRH/NbcB7SIV8y7Tl5NhPXZ+Nc W7QIAVyc52dt2kcmPj3Q0uRdaeSz9ll2N6KoQ3w17dRBhvUOd9JOV6XlVnvKRylx1IF2 tTTfcB0Kl58FwRip7GX64OMMbwZ43jh5GMRJc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=p6yg4PmqmOWxqghuPeQwMayADa10YOpcP7uhykUcTgg=; b=boSOOPlEBcGOvJPVqjHxVh/38cC2yLsURm7ZYZYFA2oQo39ch2QsGWEUSQHLYGgKfz eWJVwXx8DcsHhpjUjiyWZSYfU7eRzhiApjKylnKkQ0rlgfQozVyTPjZDm7RFElBIXFen YPEoY77VCN0UoN6GBdTogd6i2f7MI7LniL2AMnqWgbHAsqngtmeDR6JZpgn/loBgyskV 0vAsta4angbo1f9nkN1upJ+URD4ezu54vAsHrl4MFRtUeWD8nb5zEHjDoBawwjEs7Sdi 6+BigekHJH0ztCUC1UDeoX7mamgjXF7t9VMfPzowfUJ8o3PcLtRfnZKkod8d2jcQtu2J gQpw== X-Gm-Message-State: ALoCoQl92csV5vYxTRFgj/vcHAatK//PmcoEqQ7B9MZQ4q64QFsmtHyHyaC83z7EfO/5AagIn6wPUNW34FSvPSlMjom+86Qt3Q== X-Received: by 10.25.211.10 with SMTP id k10mr9228219lfg.114.1450795925125; Tue, 22 Dec 2015 06:52:05 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id e9sm5748938lbs.13.2015.12.22.06.52.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Dec 2015 06:52:04 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij Subject: [PATCH 54/54] Revert "gpio: revert get() to non-errorprogating behaviour" Date: Tue, 22 Dec 2015 15:52:02 +0100 Message-Id: <1450795922-28744-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org This reverts commit 45ad7db90b42555c8107f18ec6d6a1e9bce34860. We have fixed all the drivers that were returning ambious values not clamped to [0,1] or an error code, so return the error propagating behaviour of the API. Signed-off-by: Linus Walleij --- drivers/gpio/gpiolib.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index d72ac1fdcd98..975a548bd71e 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1303,13 +1303,7 @@ static int _gpiod_get_raw_value(const struct gpio_desc *desc) chip = desc->chip; offset = gpio_chip_hwgpio(desc); value = chip->get ? chip->get(chip, offset) : -EIO; - /* - * FIXME: fix all drivers to clamp to [0,1] or return negative, - * then change this to: - * value = value < 0 ? value : !!value; - * so we can properly propagate error codes. - */ - value = !!value; + value = value < 0 ? value : !!value; trace_gpio_value(desc_to_gpio(desc), 1, value); return value; }