From patchwork Thu Nov 21 23:12:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Mayer X-Patchwork-Id: 21668 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f197.google.com (mail-pd0-f197.google.com [209.85.192.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8429C20E7C for ; Thu, 21 Nov 2013 23:13:01 +0000 (UTC) Received: by mail-pd0-f197.google.com with SMTP id v10sf885525pde.4 for ; Thu, 21 Nov 2013 15:13:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe:content-type:content-transfer-encoding; bh=gq9BtOjm53yYpE5owJzCtHOwaFb5ZPpZUyUs2UfZaKU=; b=jRjxLG1Aq/622KHPAz7+qiqnVfn7Kdi1ckx+wu8j0/1vku7JFdHp4Zs4aGK75jTt7t httJJ9ZHuOVOyLwK5VV9AMnRrNw2ajK5xrZcuEVcpocOYgiB0Fqlr8xi918FS9+F2GBu NgCepeMuigVeeXok0egDhgCUSLvrHUI4B3IDrsbfzch12Pj8qJd4U5WsZcz9q107lPqa 6OydFAuzWCiy5jlW5cQkX9YfiLYDWaJbJOd7JBdGIzBSf10QrFpunXdUQnf9LHYLV2Sv Tb8pQjgsMZh6C2UN8NiqGZfzVOfVRdBTRnXg4K2Of1o8R7EwBiI2tL9cTFn2OH015JK7 6Rug== X-Gm-Message-State: ALoCoQkH4Doxcbs4O7fMFXDMFUywJ1CNe49iV49OzC3kHBMMy5LoFvZEux5QphsA1W/WwQzr4RLH X-Received: by 10.67.2.41 with SMTP id bl9mr3446447pad.16.1385075579932; Thu, 21 Nov 2013 15:12:59 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.30.37 with SMTP id p5ls742832qeh.51.gmail; Thu, 21 Nov 2013 15:12:59 -0800 (PST) X-Received: by 10.52.33.44 with SMTP id o12mr6852391vdi.7.1385075579697; Thu, 21 Nov 2013 15:12:59 -0800 (PST) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id at4si11537617ved.75.2013.11.21.15.12.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Nov 2013 15:12:59 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id lf12so331581vcb.7 for ; Thu, 21 Nov 2013 15:12:59 -0800 (PST) X-Received: by 10.220.74.69 with SMTP id t5mr8211162vcj.18.1385075579559; Thu, 21 Nov 2013 15:12:59 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp33313vcz; Thu, 21 Nov 2013 15:12:59 -0800 (PST) X-Received: by 10.182.29.66 with SMTP id i2mr3021792obh.23.1385075578689; Thu, 21 Nov 2013 15:12:58 -0800 (PST) Received: from mms3.broadcom.com (mms3.broadcom.com. [216.31.210.19]) by mx.google.com with ESMTP id q10si3060977oej.90.2013.11.21.15.12.57 for ; Thu, 21 Nov 2013 15:12:58 -0800 (PST) Received-SPF: neutral (google.com: 216.31.210.19 is neither permitted nor denied by best guess record for domain of markus.mayer@linaro.org) client-ip=216.31.210.19; Received: from [10.9.208.57] by mms3.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.5)); Thu, 21 Nov 2013 15:11:50 -0800 X-Server-Uuid: B86B6450-0931-4310-942E-F00ED04CA7AF Received: from IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.1.438.0; Thu, 21 Nov 2013 15:12:45 -0800 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) with Microsoft SMTP Server id 14.1.438.0; Thu, 21 Nov 2013 15:12:45 -0800 Received: from mail.broadcom.com (lbrmn-lnxub70.ric.broadcom.com [10.136.8.215]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 2EF85246A4; Thu, 21 Nov 2013 15:12:45 -0800 (PST) From: "Markus Mayer" To: "Linus Walleij" cc: "Linaro Patches" , "Alexandre Courbot" , "Linux GPIO List" , "Tim Kryger" , "Markus Mayer" Subject: [PATCH v3] gpio: bcm281xx: Fix return value of bcm_kona_gpio_get() Date: Thu, 21 Nov 2013 15:12:46 -0800 Message-ID: <1385075566-23989-1-git-send-email-markus.mayer@linaro.org> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-WSS-ID: 7E904CBC1SC10091713-01-01 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: markus.mayer@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , We need to return the corresponding bit for a particular GPIO. This bit contains shift not mask. Signed-off-by: Markus Mayer Reviewed-by: Tim Kryger Reviewed-by: Matt Porter --- Changes since v2: ----------------- Use return !!(val & BIT(bit)); rather than return (val >> bit) & 1; Changes since v1: ----------------- Clarified commit message drivers/gpio/gpio-bcm-kona.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c index 72c927d..54c18c2 100644 --- a/drivers/gpio/gpio-bcm-kona.c +++ b/drivers/gpio/gpio-bcm-kona.c @@ -158,7 +158,7 @@ static int bcm_kona_gpio_get(struct gpio_chip *chip, unsigned gpio) spin_unlock_irqrestore(&kona_gpio->lock, flags); /* return the specified bit status */ - return !!(val & bit); + return !!(val & BIT(bit)); } static int bcm_kona_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)