Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1310220imm; Wed, 11 Jul 2018 22:51:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfBywhGajfnyhQJFU/NDxb5WOkruayhKUP7IAk2BHoI6egriSLzJ9hfSqiaE/fdnYhHBnga X-Received: by 2002:a17:902:262:: with SMTP id 89-v6mr852458plc.252.1531374693706; Wed, 11 Jul 2018 22:51:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531374693; cv=none; d=google.com; s=arc-20160816; b=UIUrtqFS8vaLj+oC9UrAwlWnuhpOqrOMceCVQftdc/QznTc0Zvug/uFV5MFNRJy/Hm nNhWVKLtefwnqUJ/XCx1lvVoqHhn0IpmfhxMxC06IULFBjiEfAiGKGKFMMxGcDRzygE4 Znyn2e6lJmDaMO1dOMRONvwA8QC0gx7nzYGPVccEq++kM4041mDx1d4sJl4rwjMwevKL S3wdS6riJMDcBrrisRBTMOLh9zmabsReW4XNQL3bar6DTBMwldjuePF2fIKqQYw7UwyI K7hmIWNgJqe/3D2Edbjr0yE8P7ZMl2jw0Yt2lGl3604E11+4v8F2FXugcQFhKnqIaeea eMgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=yqo8vJf2afDqwK9buiuZJGgASvzBhLyyi+Xf5bgqBpA=; b=g+nZfULkQjeAIuK+OJuUtgxPYpWiTwvhwB3oj1AG77wTtA3hrwykmQer6ZdHl69Yqx g7M4qx6/CNQ+qFVCYeFEDbTuATI5ONRSUoFih8aue+0/05H3t90Sa3+qbqjrZIv3Fpiw BAd63XAMtVNFZPbtRXShdayi83684XB/XIpLrwDbYoaB9uYPeTAzvhUBscQvHD9n1F+j neQ4g/rnLEdtQ5j9lG+HsotAU2+7LTVIyYx+dBF3pkUhJFJ+6Gx/ffyyHAlzo9VHvuC7 AlJAuZhjHSzSk4IGl+97PVe1xtbkgeULYuxXmSExjVKlMvETI0F7VpHVHFWBcMpjQTWx 0jnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f23-v6si22888022plj.494.2018.07.11.22.51.18; Wed, 11 Jul 2018 22:51:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732643AbeGLF6G (ORCPT + 99 others); Thu, 12 Jul 2018 01:58:06 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:49429 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726911AbeGLF6G (ORCPT ); Thu, 12 Jul 2018 01:58:06 -0400 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: , CC: , , , Sean Wang , Kevin Hilman 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 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.7.4