From patchwork Thu Aug 4 10:49:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 595928 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF9C9C3F6B0 for ; Thu, 4 Aug 2022 10:49:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229575AbiHDKtd (ORCPT ); Thu, 4 Aug 2022 06:49:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238145AbiHDKta (ORCPT ); Thu, 4 Aug 2022 06:49:30 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5309E5019F for ; Thu, 4 Aug 2022 03:49:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 01150B824E4 for ; Thu, 4 Aug 2022 10:49:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F576C43470; Thu, 4 Aug 2022 10:49:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659610166; bh=NRYgkbOBZl35JeLYiTrlSXLZ0yPBiRFJgFdAcvvkHxU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g2ik1eaEM/rZo+hFWBRmv3Rk+FDT+ZJALZe7ymjJyFELnmquWZgpeqcp991scGS8l 5o1Tw95zcFU2HSUVE+5coEt2Cw/+tqdI281hr5yBGGN9A1azI7n33or5w7DSnU0dLf FamgLbC9AnUfZwDPndvH31IKMBrug8ZWJktIA0vovLV5pMb/y8tA8Szmh903v2v5ZJ VLND6qC1KDVC4gHhCjM7mO6Vf0oayXaYXYWZynBi5OXffA78vBbE8lD92KdKYviqwv Kyj84Y5MHLAzF5SPdCUP9yQRypFl61tC2HSZsudY2+zVJy3DeEnx2TOa+maRzxG6nt aUQqnLrkpzpUA== Received: by pali.im (Postfix) id 0FF91B01; Thu, 4 Aug 2022 12:49:24 +0200 (CEST) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Linus Walleij Cc: =?utf-8?q?Marek_Beh=C3=BAn?= , linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org Subject: [PATCH 3/4] pinctrl: armada-37xx: Checks for errors in gpio_request_enable callback Date: Thu, 4 Aug 2022 12:49:14 +0200 Message-Id: <20220804104915.23719-3-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220804104915.23719-1-pali@kernel.org> References: <20220804104915.23719-1-pali@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Now when all MPP pins are properly defined and every MPP pin has GPIO function, always checks for errors in armada_37xx_gpio_request_enable() function when calling armada_37xx_pmx_set_by_name(). Function armada_37xx_pmx_set_by_name() should not return "not supported" error anymore for any GPIO pin when requesting GPIO mode. Fixes: 87466ccd9401 ("pinctrl: armada-37xx: Add pin controller support for Armada 37xx") Signed-off-by: Pali Rohár --- drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c index e5e5f0ea0e77..8978e6c15905 100644 --- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c @@ -503,8 +503,11 @@ static int armada_37xx_gpio_request_enable(struct pinctrl_dev *pctldev, dev_dbg(info->dev, "requesting gpio %d\n", offset); - while ((group = armada_37xx_find_next_grp_by_pin(info, offset, &grp))) - armada_37xx_pmx_set_by_name(pctldev, "gpio", group); + while ((group = armada_37xx_find_next_grp_by_pin(info, offset, &grp))) { + ret = armada_37xx_pmx_set_by_name(pctldev, "gpio", group); + if (ret) + return ret; + } return 0; }