From patchwork Thu Jul 12 05:50:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 10521027 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 4C9D2602C8 for ; Thu, 12 Jul 2018 05:50:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45A5B292C5 for ; Thu, 12 Jul 2018 05:50:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A1D0292F8; Thu, 12 Jul 2018 05:50:32 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 1B29B292C5 for ; Thu, 12 Jul 2018 05:50:31 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=v71H3FVgubazd/FLs11j9DpHgcnzEUYAITNFt+pUlCE=; b=uDjpfIi1ONU3Jx yyvmUjga8WsJ2tO8PWRYiX17utG3BYI7DGAKmY9U8cseny2JYE4J0S0yQG4yVCgg4rg49E0j0prw6 OxipMgc1bWJwVzLSZrUnN4hiDf4rrFidOCrlVvWFFfj9WhL8hMY1vLQ6FVpotWlHvUSQXoo4Y4EOE Ter02s57yG5YrVNMh0DG7BXSHdOT68OuXD7/yIX/aB17FXVS8NXM1yPRPVhHMrRjiDiN3h4zlvpW/ iDGIILCbC1tbjSnY+MlTp0911oWxoHXcK5Zhxani6oRq8Ac9sJ1sZz9gX6XC9L++XA5gIgVdAOvA6 bbQqe+S+EzmUYmCda4fw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fdUUm-0001K9-2S; Thu, 12 Jul 2018 05:50:28 +0000 Received: from [210.61.82.184] (helo=mailgw02.mediatek.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fdUUj-0000tr-GL; Thu, 12 Jul 2018 05:50:27 +0000 X-UUID: 8398a40f49f040cab38ddbedded558e7-20180712 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 287653363; Thu, 12 Jul 2018 13:50:04 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Thu, 12 Jul 2018 13:50:02 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Thu, 12 Jul 2018 13:50:02 +0800 From: To: , Subject: [PATCH] pinctrl: mt7622: fix probe fail by misuse the selector Date: Thu, 12 Jul 2018 13:50:00 +0800 Message-ID: X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180711_225025_683937_F1A03C47 X-CRM114-Status: GOOD ( 11.80 ) 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, Sean Wang , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Kevin Hilman 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: Sean Wang After the commit acf137951367 ("pinctrl: core: Return selector to the pinctrl driver") and the commit 47f1242d19c3 ("pinctrl: pinmux: Return selector to the pinctrl driver"), it's necessary to add the fixes needed for the pin controller drivers to use the appropriate returned selector for a negative error number returned in case of the fail at these functions. Otherwise, the driver would have a failed probe and that causes boot message cannot correctly output and devices fail to acquire their own pins. Cc: Kevin Hilman Fixes: acf137951367 ("pinctrl: core: Return selector to the pinctrl driver") Fixes: 47f1242d19c3 ("pinctrl: pinmux: Return selector to the pinctrl driver") Signed-off-by: Sean Wang --- drivers/pinctrl/mediatek/pinctrl-mt7622.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/mediatek/pinctrl-mt7622.c b/drivers/pinctrl/mediatek/pinctrl-mt7622.c index 2411c384..6f931b8 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mt7622.c +++ b/drivers/pinctrl/mediatek/pinctrl-mt7622.c @@ -1538,7 +1538,7 @@ static int mtk_build_groups(struct mtk_pinctrl *hw) err = pinctrl_generic_add_group(hw->pctrl, group->name, group->pins, group->num_pins, group->data); - if (err) { + if (err < 0) { dev_err(hw->dev, "Failed to register group %s\n", group->name); return err; @@ -1559,7 +1559,7 @@ static int mtk_build_functions(struct mtk_pinctrl *hw) func->group_names, func->num_group_names, func->data); - if (err) { + if (err < 0) { dev_err(hw->dev, "Failed to register function %s\n", func->name); return err;