From patchwork Sat Nov 28 10:14:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Hesselbarth X-Patchwork-Id: 7716581 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 33E339F2EC for ; Sat, 28 Nov 2015 10:17:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3CDAE205D1 for ; Sat, 28 Nov 2015 10:17:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5286820544 for ; Sat, 28 Nov 2015 10:17:00 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a2cWe-0002je-5y; Sat, 28 Nov 2015 10:14:40 +0000 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a2cWa-0001kl-5Y for linux-arm-kernel@lists.infradead.org; Sat, 28 Nov 2015 10:14:37 +0000 Received: by wmuu63 with SMTP id u63so78087288wmu.0 for ; Sat, 28 Nov 2015 02:14:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=wnB/QMfig88Pphal6CO99KM2F+wk110opMUFfiS0Fqg=; b=YJPDjd1rLXMlA28gCxgouSO/PG0pjze5bOIoBK869naZf1+8UFDrXGl4f9gpU1Hgl4 gYHsi5EmxPLdWs2/fDrxT9kFkx7JvWUQ9OcLVCeekp2f5NxQ0VC/GKikbfl6jxNm0X7I ud6BTbkRIPOfTgAOArnCZWrx1SvQKwJ1QLsyd2wRiiZtaRgd6G3Nu4BtR3kXX0YVO+7P DaxaNcLJp3xfBhOa1gvv4YqjTB+LM+ASGkWWDIJ9G08tiQxM75qTsHhIei1ZpExenZhO OWwDIwdG2ODOK76z8TSbyHf7d5cxlhsS8OYUa9HGOqWCmVfmlrkHjLun8kh24hwQ/xjo aHpw== X-Received: by 10.28.187.69 with SMTP id l66mr15354982wmf.21.1448705654268; Sat, 28 Nov 2015 02:14:14 -0800 (PST) Received: from topkick.lan (x55b0ef74.dyn.telefonica.de. [85.176.239.116]) by smtp.gmail.com with ESMTPSA id u17sm11611589wmd.8.2015.11.28.02.14.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Nov 2015 02:14:13 -0800 (PST) From: Sebastian Hesselbarth To: Sebastian Hesselbarth Subject: [PATCH] pinctrl: mvebu: complain about missing group after checking variant Date: Sat, 28 Nov 2015 11:14:05 +0100 Message-Id: <1448705645-13881-1-git-send-email-sebastian.hesselbarth@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151128_021436_525754_6914BF99 X-CRM114-Status: GOOD ( 14.16 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , Andrew Lunn , Simon Guinot , Linus Walleij , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Gregory Clement , linux-arm-kernel@lists.infradead.org, Jason Cooper MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Common MVEBU pinctrl driver core gets an array of controls to modify a specific set of registers and an array of modes for each pingroup from each of the different SoC families of MVEBU. Some SoC families comprise different variants that differ in available pingroups and also controls, but to ease driver development, we can pass a variant mask to disable specific pingroups for some variants. However, controls are limited to the true number of pinctrl groups available on a variant. Now, when pinctrl core driver parses over above arrays, it tries to match modes with available controls and complains about missing controls for modes that are passed to the core but actually are not available on a variant with: kirkwood-pinctrl f1010000.pin-controller: unknown pinctrl group 36 This warning is a false-positive and annoying, so move the warning after we checked the variant mask for each mode setting. Also, if there is no supported setting for this variant, do not complain at all. Signed-off-by: Sebastian Hesselbarth Reported-by: Linus Walleij --- Cc: Linus Walleij Cc: Simon Guinot Cc: Thomas Petazzoni Cc: Jason Cooper Cc: Andrew Lunn Cc: Gregory Clement Cc: linux-gpio@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/pinctrl/mvebu/pinctrl-mvebu.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/pinctrl/mvebu/pinctrl-mvebu.c b/drivers/pinctrl/mvebu/pinctrl-mvebu.c index 77d2221d379d..dbc95369317a 100644 --- a/drivers/pinctrl/mvebu/pinctrl-mvebu.c +++ b/drivers/pinctrl/mvebu/pinctrl-mvebu.c @@ -663,16 +663,9 @@ int mvebu_pinctrl_probe(struct platform_device *pdev) /* assign mpp modes to groups */ for (n = 0; n < soc->nmodes; n++) { struct mvebu_mpp_mode *mode = &soc->modes[n]; - struct mvebu_pinctrl_group *grp = - mvebu_pinctrl_find_group_by_pid(pctl, mode->pid); + struct mvebu_pinctrl_group *grp; unsigned num_settings; - if (!grp) { - dev_warn(&pdev->dev, "unknown pinctrl group %d\n", - mode->pid); - continue; - } - for (num_settings = 0; ;) { struct mvebu_mpp_ctrl_setting *set = &mode->settings[num_settings]; @@ -695,6 +688,17 @@ int mvebu_pinctrl_probe(struct platform_device *pdev) set->flags = MVEBU_SETTING_GPI; } + /* skip modes with no settings for this variant */ + if (!num_settings) + continue; + + grp = mvebu_pinctrl_find_group_by_pid(pctl, mode->pid); + if (!grp) { + dev_warn(&pdev->dev, "unknown pinctrl group %d\n", + mode->pid); + continue; + } + grp->settings = mode->settings; grp->num_settings = num_settings; }