From patchwork Fri Nov 8 20:19:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Mayer X-Patchwork-Id: 21432 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gg0-f200.google.com (mail-gg0-f200.google.com [209.85.161.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 86E34244F2 for ; Fri, 8 Nov 2013 20:19:48 +0000 (UTC) Received: by mail-gg0-f200.google.com with SMTP id p4sf3188465ggn.7 for ; Fri, 08 Nov 2013 12:19:47 -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=yIl76dYpIFTFsIYrxFImA0QN8nrXnm8v8Mmz6sKyJvI=; b=N0UpoU0ys9Ipo9ghPmp7tN0nAgV/7YfUy0F+RanTUQIwuJTNajxCjnR7WnLM0lxENn cisNhnqrmnN2mdMg2CjxF9g4vKgPJtBh2P8QvAVMX3n963ONQ3O4apzxJU3wWGHnsLf9 8w4HrY5xVDYW3fAZObJC6AxushbllheIkgIYZxBWVyDbZlR5XVH2e2+UK0vIlNukQIIs rztqr5FxnZao7BmFx+z7DM1MP5HQ6N0re4yvDJIWSgNyKyRNVBQq9Z53ZVPGY7TUo43d //V4va3mYlZyvkcNoqD/o9Zs10GI5S09Z2lXfMnF+mF376hSf7AoaM9dev7+FNpIlhfa eHSQ== X-Gm-Message-State: ALoCoQmigeUdq+hK5TTlliIM3Y+TDDZxqpAU9chOl0otTmva7l1/HvNzSwbL6OnsjjtfEoR4hk/z X-Received: by 10.58.128.67 with SMTP id nm3mr482763veb.38.1383941987700; Fri, 08 Nov 2013 12:19:47 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.59.36 with SMTP id w4ls1692488qeq.67.gmail; Fri, 08 Nov 2013 12:19:47 -0800 (PST) X-Received: by 10.52.35.136 with SMTP id h8mr11086419vdj.6.1383941987523; Fri, 08 Nov 2013 12:19:47 -0800 (PST) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id cx4si1257646vcb.80.2013.11.08.12.19.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 08 Nov 2013 12:19:47 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.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.128.176; Received: by mail-ve0-f176.google.com with SMTP id c14so1707779vea.7 for ; Fri, 08 Nov 2013 12:19:47 -0800 (PST) X-Received: by 10.52.30.104 with SMTP id r8mr6985389vdh.18.1383941987159; Fri, 08 Nov 2013 12:19:47 -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 u4csp55547vcz; Fri, 8 Nov 2013 12:19:46 -0800 (PST) X-Received: by 10.43.48.7 with SMTP id uu7mr51927icb.68.1383941986270; Fri, 08 Nov 2013 12:19:46 -0800 (PST) Received: from mms1.broadcom.com (mms1.broadcom.com. [216.31.210.17]) by mx.google.com with ESMTP id mt3si3945552icc.29.2013.11.08.12.19.45 for ; Fri, 08 Nov 2013 12:19:46 -0800 (PST) Received-SPF: neutral (google.com: 216.31.210.17 is neither permitted nor denied by best guess record for domain of markus.mayer@linaro.org) client-ip=216.31.210.17; Received: from [10.9.208.57] by mms1.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.5)); Fri, 08 Nov 2013 12:19:23 -0800 X-Server-Uuid: 06151B78-6688-425E-9DE2-57CB27892261 Received: from IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.1.438.0; Fri, 8 Nov 2013 12:19:36 -0800 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) with Microsoft SMTP Server id 14.1.438.0; Fri, 8 Nov 2013 12:19:36 -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 8D913246B7; Fri, 8 Nov 2013 12:19:35 -0800 (PST) From: "Markus Mayer" To: "Linus Walleij" cc: "Linaro Patches" , "Alexandre Courbot" , "Linux GPIO List" , "Markus Mayer" Subject: [PATCH v2] gpio: bcm281xx: Fix return value of bcm_kona_gpio_get() Date: Fri, 8 Nov 2013 12:19:04 -0800 Message-ID: <1383941945-27569-1-git-send-email-markus.mayer@linaro.org> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-WSS-ID: 7E6398C11506384959-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.128.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 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..db473f1 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) & 1; } static int bcm_kona_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)