From patchwork Mon Nov 14 14:10:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 82113 Delivered-To: patch@linaro.org Received: by 10.182.1.168 with SMTP id 8csp1151412obn; Mon, 14 Nov 2016 06:10:41 -0800 (PST) X-Received: by 10.98.147.93 with SMTP id b90mr36483746pfe.170.1479132641373; Mon, 14 Nov 2016 06:10:41 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h68si22386025pfe.37.2016.11.14.06.10.41; Mon, 14 Nov 2016 06:10:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932506AbcKNOKf (ORCPT + 3 others); Mon, 14 Nov 2016 09:10:35 -0500 Received: from mail-lf0-f51.google.com ([209.85.215.51]:33939 "EHLO mail-lf0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932507AbcKNOKe (ORCPT ); Mon, 14 Nov 2016 09:10:34 -0500 Received: by mail-lf0-f51.google.com with SMTP id o141so59055902lff.1 for ; Mon, 14 Nov 2016 06:10:33 -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=PPdxsVyY2j4yO13Y48V45Ai16aQi+9TyQJG6SrCiOSE=; b=kp+ErVtIffh0Gtqdiqh+z9zVEBb1DwXhH6VdZeX0rpREZDKLOBN3jtt5fOplN3314S zmDWsLY7fF80gFT9b5vWVx8GJOOXOSXSPKEcPj6xMqKB8WIbXyEok2W952yzfjgvZif4 9m871iZici7Az6X1NQwWa+aHveaYNZrAOO6NE= 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=PPdxsVyY2j4yO13Y48V45Ai16aQi+9TyQJG6SrCiOSE=; b=AhC2oPw8s33vl/j9kNVZ6zmmlsdXDUITT/qJdA6NahUqKUuZRTcFcg1vlhE8s0DYGM ThroOAtLl9eQHJffOiho66p9EfbRbhWeM1dgc4avXjuQ++Fll377yX0AC+8RxAGZNN6w vtkjTZ0EEJsxDAJ4BCU8eb6JldQ0B6rVrQ1KzFCD8VdIrdemKhu+iOD9y2zIIFm0df3a 9I5l0fFIgy9v9bYLMa0FsDCnTtLXkFcSob7KLgxBkXM3uKSt6SWIHOQBBAnV2Mk9qH1m 9ut9Nu02wuJo5C26qwAX1TmoA0eYX1fD+pWptGMHSBlcBwnlPfNCzXS20c/xp+MvSaTw EUFw== X-Gm-Message-State: ABUngvdEPvkrzsIWqiHmPBo48LtpqUvCkEqvStAhO9WWoFaBVUt3b2T5j83xKRLcEnHAb3xv X-Received: by 10.25.195.195 with SMTP id t186mr6629389lff.96.1479132632457; Mon, 14 Nov 2016 06:10:32 -0800 (PST) Received: from linuslaptop.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id u74sm5138696lfi.9.2016.11.14.06.10.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Nov 2016 06:10:31 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Alexandre Courbot Cc: Linus Walleij , stable@vger.kernel.org Subject: [PATCH] gpio: tc3589x: fix up .get_direction() Date: Mon, 14 Nov 2016 15:10:29 +0100 Message-Id: <1479132629-24067-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The bit in the TC3589x direction register is 0 for input and 1 for output, but the gpiolib expects the reverse. Fix up the logic. Cc: stable@vger.kernel.org Fixes: 14063d71e5e6 ("gpio: tc3589x: add .get_direction() and small cleanup") Signed-off-by: Linus Walleij --- drivers/gpio/gpio-tc3589x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe stable" 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/gpio-tc3589x.c b/drivers/gpio/gpio-tc3589x.c index 65d380b2bad2..94ec262a99e0 100644 --- a/drivers/gpio/gpio-tc3589x.c +++ b/drivers/gpio/gpio-tc3589x.c @@ -97,7 +97,7 @@ static int tc3589x_gpio_get_direction(struct gpio_chip *chip, if (ret < 0) return ret; - return !!(ret & BIT(pos)); + return !(ret & BIT(pos)); } static int tc3589x_gpio_set_single_ended(struct gpio_chip *chip,