From patchwork Mon May 22 13:59:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 9740459 Return-Path: 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 11F67601C2 for ; Mon, 22 May 2017 14:02:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 017882864A for ; Mon, 22 May 2017 14:02:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA7382867E; Mon, 22 May 2017 14:02:14 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID 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 751802864A for ; Mon, 22 May 2017 14:02:14 +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-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=Rq8pfvyI2r0/Ygv5CBZeYszsjLAbX5F+acE8E7nZFYI=; b=ajP GOekbxZoWrROKcBcNFUkx80AzHFZ2R98xNnUiVuaqJixjrmWo3Skj5VRvmwSQM/xeqTP8cbi2n1/m MynqXV2jfEwrlEyqYyFau/G1tLmQAO/tzG8WzftaVEAXeNiRFprOI2bDMKYSkg+andsj1he/rLQqY EugGfF9aaKtduLPhzXI77TTwsPmkA34wPocgAyeEss6OXPOOGN/1E2FaS6bvrWQPyK75f6yz7QDsv bIs9Ovtpygt/SoEu94+IXJKUCRSaMgGBO9EeyXRIgXPMPc3L66zDrRdEGtdwE8w+GROkXCyQOYD3G jTsYgdqHxvg66DHzsAnIk2hi3xfEVFw==; 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 1dCnuW-0004zA-Ni; Mon, 22 May 2017 14:02:12 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dCnt9-00031K-0j for linux-arm-kernel@lists.infradead.org; Mon, 22 May 2017 14:01:28 +0000 Received: from localhost.localdomain (unknown [106.187.91.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 21BE1239E2; Mon, 22 May 2017 14:00:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 21BE1239E2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=shawnguo@kernel.org From: Shawn Guo To: Linus Walleij Subject: [PATCH] pinctrl: zte: fix group_desc initialization Date: Mon, 22 May 2017 21:59:35 +0800 Message-Id: <1495461575-29488-1-git-send-email-shawnguo@kernel.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170522_070047_979760_FA3D6601 X-CRM114-Status: GOOD ( 11.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-gpio@vger.kernel.org, Shawn Guo , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Shawn Guo There are a couple of issues with group_desc initialization in function zx_pinctrl_build_state(). - num_pins is not initialized and remains zero. - pins shouldn't be initialized with a pointer to variable in the stack. With them fixed, pin_request() in pinmux_enable_setting() can be invoked correctly. Signed-off-by: Shawn Guo --- Hi Linus, This is a fix for ZTE pinctrl driver that is queued on your devel branch. Shawn drivers/pinctrl/zte/pinctrl-zx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/zte/pinctrl-zx.c b/drivers/pinctrl/zte/pinctrl-zx.c index 2aca4e4b3f1c..787e3967bd5c 100644 --- a/drivers/pinctrl/zte/pinctrl-zx.c +++ b/drivers/pinctrl/zte/pinctrl-zx.c @@ -282,10 +282,10 @@ static int zx_pinctrl_build_state(struct platform_device *pdev) for (i = 0; i < ngroups; i++) { const struct pinctrl_pin_desc *pindesc = info->pins + i; struct group_desc *group = groups + i; - int id = pindesc->number; group->name = pindesc->name; - group->pins = &id; + group->pins = (int *) &pindesc->number; + group->num_pins = 1; radix_tree_insert(&pctldev->pin_group_tree, i, group); }