Message ID | 22ef3c75-bdf6-6aeb-a1dd-2d03eb46fd58@codeaurora.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E6D1160235 for <patchwork-linux-arm@patchwork.kernel.org>; Mon, 16 Oct 2017 13:43:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D6C2A28599 for <patchwork-linux-arm@patchwork.kernel.org>; Mon, 16 Oct 2017 13:43:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB52B2859F; Mon, 16 Oct 2017 13:43:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C219428599 for <patchwork-linux-arm@patchwork.kernel.org>; Mon, 16 Oct 2017 13:43:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HnAIWpWkdIorN7/ICZ0law91bzAlYjkm+gEaPFhRenY=; b=QYrnOwWDR0HjtkC3RdIhr3Fx0 omE/3GcxpcuVhKMdwLN9ixiF6RyLCzM/6JopHXX/eVGbW1X/nXCFb9fVv+mL+VUPudy4yUJr77J83 jm/uKbEw10MBpxaxjmrjPtJM2vsaovGJwc8bpDxlxJCDaWmjr5kBzLtDY7hMpswACMV+8NQefqMSg OURTvVQUVn+WSnmGVPXhjHOqfSgmQhE0pusI0BglC/Qr3oufhgdH7kHfOTDhUt9++rC6/rqMyrj6T kt2MuzKcuiOjMmgcI/MIBt31wUaoDzhUowpm1etGR42VDPjP0P54E69X9WNaTA/ytUIhZKFlVSKuM 5DbT/4IjQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e45fg-0001Sn-AO; Mon, 16 Oct 2017 13:43:08 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e45fc-0001Ph-F4 for linux-arm-kernel@lists.infradead.org; Mon, 16 Oct 2017 13:43:06 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 121F860B11; Mon, 16 Oct 2017 13:42:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1508161364; bh=Unx3Cy+t6C5oZ9dMyLubI+ojWhevBTYH4BQLR64QfXU=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=LqKhPt53SHlBRts/4Hwc2cZp/OI4T0ZTB4zYbUBFG0PgwGGvQgtfodJ4BDD7oTaq/ lm8BCSuSyXYbngaEJd/pJslfJC12eCDv/BL/n8/SUuLXEauLF/x72SfnScpbvdCQgc N6z2SNpxx6C+XaFgWdkRsrtRdzaAWoEd10w7rFS4= Received: from [10.222.143.167] (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: timur@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id A23386083D; Mon, 16 Oct 2017 13:42:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1508161363; bh=Unx3Cy+t6C5oZ9dMyLubI+ojWhevBTYH4BQLR64QfXU=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=ix0A2U+Cj2dkGetu2+1wCiFHGCiGTMZUjQtynMCUgZ2srYOeE+VCU4LlasDcat8LR h9kh0asWDwdtcPgGrE6xrjm1JdkZhojBLRl8EEDyvPHiaoRb6znegR9hp/CtSpjOoi 2R68mLl0FDZukTW3oDKgwkJd7BnyFOPd5/GOjmzo= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org A23386083D Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=timur@codeaurora.org Subject: Re: [PATCH 0/2] [v5] pinctrl: qcom: add support for sparse GPIOs To: Linus Walleij <linus.walleij@linaro.org>, Stephen Boyd <sboyd@codeaurora.org> References: <CACRpkdZcdLac_wYW+XqtZ=-APo8VmvYL4B1oL-wZyLy8KEs9AA@mail.gmail.com> <1ecdf6ee-5098-15d3-f85e-66b39a6c25f9@codeaurora.org> <CACRpkdaUV1Mjh7U9bBAgZA5Zq1oqN0HBT=VH5NkvPnY4gHxDVw@mail.gmail.com> <d53e67a2-4f69-752f-ba35-53872d9b9760@codeaurora.org> <CACRpkdYfAcKrgbgybccurUKTyR0E+tHDyzp7sbXxXxKuyMOGhQ@mail.gmail.com> <619f48d2-59c7-c090-4ace-9e8db9f92064@codeaurora.org> <CACRpkdZFunwQ=tiQqsapap7Ozz42hr=df5vqbC0S5xy5Wn+ZWw@mail.gmail.com> <255ad0dc-2d16-ae7f-0b45-500e23cff1a4@codeaurora.org> <20171003220311.GU457@codeaurora.org> <CACRpkdYXsY5eixYkEeuZTHJn7q6_6BdTxZ-2yneUyEKUjKF3Gw@mail.gmail.com> <20171012073922.GB18706@codeaurora.org> <CACRpkdYis3kNG45zmkTcP8vCutfRJkh5UjnzwFVeyLmFYFEC-A@mail.gmail.com> From: Timur Tabi <timur@codeaurora.org> Message-ID: <22ef3c75-bdf6-6aeb-a1dd-2d03eb46fd58@codeaurora.org> Date: Mon, 16 Oct 2017 08:42:41 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <CACRpkdYis3kNG45zmkTcP8vCutfRJkh5UjnzwFVeyLmFYFEC-A@mail.gmail.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171016_064304_701338_9E01B43C X-CRM114-Status: GOOD ( 16.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: "linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>, "linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>, anjiandi@codeaurora.org, Bjorn Andersson <bjorn.andersson@linaro.org>, David Brown <david.brown@linaro.org>, "thierry.reding@gmail.com" <thierry.reding@gmail.com>, Andy Gross <andy.gross@linaro.org>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Mika Westerberg <mika.westerberg@linux.intel.com>, "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c index ff491da64dab..ca4ae3d76eb4 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm.c +++ b/drivers/pinctrl/qcom/pinctrl-msm.c @@ -443,6 +443,14 @@ static int msm_gpio_get_direction(struct gpio_chip *chip, unsigned int offset) g = &pctrl->soc->groups[offset]; + /* + * During initialization, gpiolib may query all GPIOs for their + * initial direction, regardless if they exist, so block access + * to those that are unavailable. + */ + if (!g->npins) + return -ENODEV; + val = readl(pctrl->regs + g->ctl_reg);