From patchwork Wed Oct 23 06:36:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 21224 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f69.google.com (mail-pa0-f69.google.com [209.85.220.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CDB5520BB3 for ; Wed, 23 Oct 2013 06:36:23 +0000 (UTC) Received: by mail-pa0-f69.google.com with SMTP id kq14sf937681pab.8 for ; Tue, 22 Oct 2013 23:36:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=KFUA2ttTBZmlrKcAJDNskriRNxzR+8zHHntE6WABQBs=; b=dWgb0W6n6SAexlJ5byBY2aJIKM97j9PX0ybO2RHxb9NOWfqpkfsNb3VOUdjId3RgIJ wCGGYwWu6ovTawMQ3MYtOHD7+XeG12j+sNBBlfvLb5pvOwlIn88/fjAxThbIqa0ggRc3 iwxbllVC/11yvNrQpdatxi5DYKFLoW3Q9+1P23HbcYv4OveSeObgz1K7s/jMDU9cqit8 g6b/mLI9LpbxYy/nPDl6S1f293jYZDmHY0zXS2JUw5zLA3jOsnJK1zxv2WQ+4keZvqi8 +IHIOfkQV6/OefMDUM50soLikt/EBis2kngks6GiHhmxBN8hYSqfrunYK1+7BVbFpg58 MxfA== X-Received: by 10.66.136.47 with SMTP id px15mr621370pab.28.1382510182741; Tue, 22 Oct 2013 23:36:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.82.43 with SMTP id f11ls376549qey.33.gmail; Tue, 22 Oct 2013 23:36:22 -0700 (PDT) X-Received: by 10.58.117.7 with SMTP id ka7mr14140veb.44.1382510182594; Tue, 22 Oct 2013 23:36:22 -0700 (PDT) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id na9si6851038vcb.1.2013.10.22.23.36.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Oct 2013 23:36:22 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.171 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.171; Received: by mail-ve0-f171.google.com with SMTP id c14so227821vea.16 for ; Tue, 22 Oct 2013 23:36:22 -0700 (PDT) X-Gm-Message-State: ALoCoQnfnX+sj7pFAPbASGaE4IelUY13ofjijduz3Ywxm7V2INO5/AUOaoViAzP0tv6qgt1gYg8A X-Received: by 10.220.164.202 with SMTP id f10mr3816412vcy.25.1382510182250; Tue, 22 Oct 2013 23:36:22 -0700 (PDT) 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 u4csp286259vcz; Tue, 22 Oct 2013 23:36:21 -0700 (PDT) X-Received: by 10.66.102.100 with SMTP id fn4mr1617953pab.71.1382510181108; Tue, 22 Oct 2013 23:36:21 -0700 (PDT) Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by mx.google.com with ESMTPS id z1si1005690pbw.219.2013.10.22.23.36.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Oct 2013 23:36:21 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.47 is neither permitted nor denied by best guess record for domain of haojian.zhuang@linaro.org) client-ip=209.85.220.47; Received: by mail-pa0-f47.google.com with SMTP id lf10so532866pab.34 for ; Tue, 22 Oct 2013 23:36:20 -0700 (PDT) X-Received: by 10.66.65.134 with SMTP id x6mr1635959pas.142.1382510180616; Tue, 22 Oct 2013 23:36:20 -0700 (PDT) Received: from localhost.localdomain ([27.115.121.40]) by mx.google.com with ESMTPSA id iu7sm2143500pbc.45.2013.10.22.23.36.17 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Oct 2013 23:36:19 -0700 (PDT) From: Haojian Zhuang To: linus.walleij@linaro.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org Cc: patches@linaro.org, Haojian Zhuang Subject: [PATCH] gpio: pl061: hook request if gpio-ranges avaiable Date: Wed, 23 Oct 2013 14:36:11 +0800 Message-Id: <1382510171-5937-1-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 1.8.1.2 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: haojian.zhuang@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.171 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: , gpio-ranges property could binds gpio to pinctrl. But there may be some gpios without pinctrl operation. So check whether gpio-ranges property exists in device node first. Signed-off-by: Haojian Zhuang --- drivers/gpio/gpio-pl061.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c index cb5510b..44a0ba1 100644 --- a/drivers/gpio/gpio-pl061.c +++ b/drivers/gpio/gpio-pl061.c @@ -306,8 +306,11 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id) spin_lock_init(&chip->lock); - chip->gc.request = pl061_gpio_request; - chip->gc.free = pl061_gpio_free; + /* Hook the request()/free() for pinctrl operation */ + if (of_get_property(dev->of_node, "gpio-ranges", NULL)) { + chip->gc.request = pl061_gpio_request; + chip->gc.free = pl061_gpio_free; + } chip->gc.direction_input = pl061_direction_input; chip->gc.direction_output = pl061_direction_output; chip->gc.get = pl061_get_value;