Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4188091imm; Sat, 25 Aug 2018 10:59:42 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZJlWsXWInCFvS+xQ3wWRr3eyybAarkVY+6SRdsh1GCghiKsHrhPQP3X8Ejw76VYFBh4B3T X-Received: by 2002:a62:5cc1:: with SMTP id q184-v6mr7155941pfb.241.1535219982691; Sat, 25 Aug 2018 10:59:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535219982; cv=none; d=google.com; s=arc-20160816; b=ePH0WVNMyEaOwDsb1/hbfFaJAatvQcoAmuaJ2GEMgBqSlGtwr8m52tVkdkanhgZKMV k+kXJzJKctdLmXE+U+j3fBDgrlbVwDFgjBMERD/rye7NDBLO1qFW1mALJff3FGQVeqd9 GgOBUf1Q3YUYN36i7OHGGN+7a0+hwGPgKcHFoGXxe7pShzA3AoKxOjsTyepnAHYivAD+ cIjXA9pZBqxhXOadch6VnWKeNRmOUXnLOIXNEbTpEop/E0Bv9VeqO8Alnr2Z1UOpn3by Q6euXuTmX3AOWIi8Q4PacWumALgbwOIMxT8WIkyENcW/K7RLwNcv+/xmEu6o7lx6jib6 fKBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:message-id:date:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=WpniL1PH9TW42ttDhccaMZjBXnObCHQiRCi1TMd/yb0=; b=KECAO9RGaJGoBB0hVMehmaZVbbenBvySkVjhXBn21qyYFU2R9f8ba1+HXgM4VIMAb5 ZZzdEdPFvB57QfKRmklROlrVIY2tC7OOly5SZ0HZEnchgmfeiEc0ulrBjhDsn2PKBIXU 3xGC7yUbfOi8Mcpt6eC+rK2kGZNCL/NtzEyxWsJCDRaj00879qsdbYMZcYQAw/iZffsc 9VCkHj5pjX0Y3sxg/jvCV0IL6ZBqNr8MNppKAMXDOxTAjixrxuCcIQcKwv2G57KgzxiD HSq1lLUU1NFkWgXxri1y/Er1oGmThGn2aaRcTTvbXnvcAn7fxpCqZTqYg2JQntLnUfMQ AS2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wavesemi.onmicrosoft.com header.s=selector1-wavecomp-com header.b=T9KzqcXo; 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 m2-v6si11244840pfi.351.2018.08.25.10.58.59; Sat, 25 Aug 2018 10:59:42 -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; dkim=pass header.i=@wavesemi.onmicrosoft.com header.s=selector1-wavecomp-com header.b=T9KzqcXo; 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 S1726946AbeHYVeF (ORCPT + 99 others); Sat, 25 Aug 2018 17:34:05 -0400 Received: from mail-cys01nam02on0124.outbound.protection.outlook.com ([104.47.37.124]:60808 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726672AbeHYVeE (ORCPT ); Sat, 25 Aug 2018 17:34:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wavesemi.onmicrosoft.com; s=selector1-wavecomp-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WpniL1PH9TW42ttDhccaMZjBXnObCHQiRCi1TMd/yb0=; b=T9KzqcXoT49q2bPYWWb/EblDTMoLyBzqnZEGRn2/2LaKfJ6ZZsIq37r+JVKVDIh0KBqM7vHLAanIct3MpoMFm6u9U0iDGQiYBl6Vc2srvjtZ5i3F9aUoViySs+Pt9km+ZLdXipAbYq4bUu5U5wZ/7mb5CPZhYsp8VmbBAF3lCLA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=pburton@wavecomp.com; Received: from pburton-laptop.mipstec.com (4.16.204.77) by BYAPR08MB4934.namprd08.prod.outlook.com (2603:10b6:a03:6a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.15; Sat, 25 Aug 2018 17:54:20 +0000 From: Paul Burton To: linux-gpio@vger.kernel.org Cc: Paul Burton , Linus Walleij , Paul Cercueil , Tony Lindgren , linux-kernel@vger.kernel.org Subject: [PATCH] pinctrl: ingenic: Fix group & function error checking Date: Sat, 25 Aug 2018 10:53:28 -0700 Message-Id: <20180825175328.16687-1-paul.burton@mips.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [4.16.204.77] X-ClientProxiedBy: MWHPR2001CA0003.namprd20.prod.outlook.com (2603:10b6:301:15::13) To BYAPR08MB4934.namprd08.prod.outlook.com (2603:10b6:a03:6a::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 211833cd-39c8-4d99-89e6-08d60ab3c921 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BYAPR08MB4934; X-Microsoft-Exchange-Diagnostics: 1;BYAPR08MB4934;3:fcxQFD3XrK2uP3+uRSu0pVlCG/1IxGc3QhE+FVdZiBzMxV0MI1SyfqRCLm/Sz2rV40W9OBsC16VXhzXDjJn+rPO+NXef9Y+HLQ7Ry6LhYsz1jbCxMbHn88p/EzAkgbeMTqY+01GhpuJiNq+WS/0hbNZh+otJCEvswsW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d5jNjvUk8mdiGxNlMSN6JPeRU09mi1let4HaggDG+tg5Rp5SrG4LJHi7JAFa/pN47fIGSLmG7Tg4SPGbmMM+s9YB3c0KFjam2tlYJLiOoE0LwsCmEDDiYPjqEfosYNLf2SyCCHjxTiBTGvplVa1v6IL4HGMcYdoTu8J4Y1+wEMNt6wPiLaJO19cTZK8M4aQ1926MLspkkhtdxjjQAlAti14DbEtjP2Lm9FFfpT8sd X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(149027)(150027)(6041310)(20161123562045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(201708071742011)(7699016);SRVR:BYAPR08MB4934;BCL:0;PCL:0;RULEID:;SRVR:BYAPR08MB4934; X-Forefront-PRVS: 0775716B9D X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(39840400004)(366004)(396003)(376002)(136003)(346002)(189003)(199004)(5660300001)(50466002)(48376002)(25786009)(16586007)(54906003)(66066001)(386003)(6506007)(36756003)(6916009)(53936002)(47776003)(6486002)(97736004)(6512007)(316002)(8936002)(2351001)(50226002)(4326008)(105586002)(53416004)(68736007)(69596002)(486006)(44832011)(476003)(2616005)(956004)(2906002)(3846002)(106356001)(6116002)(478600001)(1076002)(81156014)(81166006)(51416003)(8676002)(2361001)(26005)(305945005)(52116002)(1857600001)(16526019)(7736002)(42882007)(186003);DIR:OUT;SFP:1102;SCL:1;SRVR:BYAPR08MB4934;H:pburton-laptop.mipstec.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: wavecomp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BYAPR08MB4934;23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ezp1Vm1fBtWCaBayI6/rPfi7oWR1etpbiuTIur7GZ0/EWnCXMII5TwIWLWYTiUOGErD8KGZovqWGvLswp7X/Lmd32V7dSQ0/A5LpouJ4iH/CF1c94ayF6zO91xY7Veo+w6cHIjJfS+67mSphkvP3kspQZKe+DVgxdCe7mt7bNYqSQ1Tqbma//7KP0Ks/XSQtYcmt7Z1E30RvoIUL8243Jzl9i0zQOi2NAVadG0yHba1qh84XgcYqYRZ89wwEO06fmi3Yx1w2dud3GCMtPzp+zsz2RABx+3OO481g==;5:PJY/4auCnU5wGOME5dTTtp7CmWt2X5JrMo3nFdy0FelQ3Rys2rPkeQ36ZgbgTg6mMNo7y4Dv/Vdvb6eQ4hQHYa7GybhVuYOvE8k8QyRoK0Jo0r6f9f3H7BVcFv13ETlrc191JSmUT/G5VTNFnbZcz0W028GBhV1asHR/jDx8Wmk=;7:1xxxZaVaK3fGfBh/k/ct50m8gG7Z0emAd8lV4lFvA5BGPm6xFH9JJWA8jVrWOpvqrgqZh2XIOqYPbqFgOZoNhQ+2rGmCPPquUnruBXDvuqjlP8If1b9uXwgJcP1OldK+L18ZU+vtFzIajd/3NgQApeyOh9mZvOE8o1QffkPTjBXXIwNMeLo7jSTCLyQ1jk3ZZ6YhO11RNPYcRfIrJ4A5EUo+OXgxx4JYaCH4SPShs+WF6aNasvsgOeXEOzZ72Npy SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: mips.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2018 17:54:20.5703 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 211833cd-39c8-4d99-89e6-08d60ab3c921 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 463607d3-1db3-40a0-8a29-970c56230104 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR08MB4934 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit a203728ac6bb ("pinctrl: core: Return selector to the pinctrl driver") and commit f913cfce4ee4 ("pinctrl: pinmux: Return selector to the pinctrl driver") modified the return values of pinctrl_generic_add_group() and pinmux_generic_add_function() respectively, but did so without updating their callers. This broke the pinctrl-ingenic driver, which treats non-zero return values from these functions as errors & fails to probe. For example on a MIPS Ci20: pinctrl-ingenic 10010000.pin-controller: Failed to register group uart0-hwflow pinctrl-ingenic: probe of 10010000.pin-controller failed with error 1 Without the pinctrl driver probed, other drivers go on to fail to probe too & the system is unusable. Fix this by modifying the error checks to treat only negative values as errors, matching the commits that introduced the breakage & similar changes made to other drivers. Signed-off-by: Paul Burton Fixes: a203728ac6bb ("pinctrl: core: Return selector to the pinctrl driver") Fixes: f913cfce4ee4 ("pinctrl: pinmux: Return selector to the pinctrl driver") Cc: Linus Walleij Cc: Paul Cercueil Cc: Tony Lindgren Cc: linux-gpio@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/pinctrl/pinctrl-ingenic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-ingenic.c index 6a1b6058b991..628817c40e3b 100644 --- a/drivers/pinctrl/pinctrl-ingenic.c +++ b/drivers/pinctrl/pinctrl-ingenic.c @@ -793,7 +793,7 @@ static int ingenic_pinctrl_probe(struct platform_device *pdev) err = pinctrl_generic_add_group(jzpc->pctl, group->name, group->pins, group->num_pins, group->data); - if (err) { + if (err < 0) { dev_err(dev, "Failed to register group %s\n", group->name); return err; @@ -806,7 +806,7 @@ static int ingenic_pinctrl_probe(struct platform_device *pdev) err = pinmux_generic_add_function(jzpc->pctl, func->name, func->group_names, func->num_group_names, func->data); - if (err) { + if (err < 0) { dev_err(dev, "Failed to register function %s\n", func->name); return err; -- 2.18.0