From patchwork Sun Apr 16 21:43:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13213084 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 315CFC77B73 for ; Sun, 16 Apr 2023 21:44:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :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=iDLqxulRY/jWw7Fk51kNBKc3IBN/dQvUVfRbt8bUJpk=; b=V2GPkzhQcOfGZ7 pTiOLEE3nYEJv0xte5/uKrJReKBp9hAltAhxU0m7zus/fGVMXsA10nut8SVuX6sqz6k7SFuwBiTZP R7UltdcCBYqrKeLlUZN0JBslnuCu9ZzNEaJqBV4T9rANX6Hd8Uj3goOq0byMdjebJxkdJQmP5hN8s anvIshO8bk8U6fLl/fpSHmj0bJF7B63fAqBX7GRnO/hNykYFtb3pXAw06IWEseU3qFn579Vwy/78Y eQ1q97v+F4HmhZ7MdFY/K+pVo3ZQ0LPpPREvuuhTka8Un3bPKYk12kbat8wR8PiwyxcThH+sv3trr II+TKWpUX/XeD3N+6cBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1poAAB-00ESuj-0q; Sun, 16 Apr 2023 21:43:59 +0000 Received: from smtp-17.smtpout.orange.fr ([80.12.242.17] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1poAA7-00EStd-1w for linux-arm-kernel@lists.infradead.org; Sun, 16 Apr 2023 21:43:57 +0000 Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id oA9wpixEOfW5ioA9wp7C2p; Sun, 16 Apr 2023 23:43:48 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=orange.fr; s=t20230301; t=1681681428; bh=vF9mRhCUpfiJDniHjN1U8oMAgEUODJM62IemQiobv8s=; h=From:To:Cc:Subject:Date; b=gK7vGpkIcnWsmBbMq6CGRAW+XbhDDYYOymGG1wfwAs7vVyxn91J1Mx95f0U3Os9eQ guPsDh2gbxJS46QjmL+WgUsqXiTDztzb6vWYFLQVbYVvBl7hKfdaFiiUB3R90oS+hn 1MCgcTADMkGMV83yWe2LvmQy8BRClnOHr2I2PyXiLLp0N5aTlZLTgb6MxjlTyQ27yC HyZhaGWX8phlPd9ARerhSwAwdFc620NA2qqSnEXXMQQiQBIdMKISxQ6GrJ3Ac3Keer mDquEVicZfPMpY3TFz+AzAbBVVy1bfu5s2hCn15QgA6rhxbDzpeTt5i0CHg5GKdmEt tX1e9sy1RpSQQ== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 16 Apr 2023 23:43:48 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Linus Walleij , Florian Fainelli , Broadcom internal kernel review list , Ray Jui , Scott Branden , Stefan Wahren Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-gpio@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] pinctrl: bcm2835: Handle gpiochip_add_pin_range() errors Date: Sun, 16 Apr 2023 23:43:41 +0200 Message-Id: <98c3b5890bb72415145c9fe4e1d974711edae376.1681681402.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230416_144355_778653_C7932ED6 X-CRM114-Status: GOOD ( 10.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org gpiochip_add_pin_range() can fail, so better return its error code than a hard coded '0'. Fixes: d2b67744fd99 ("pinctrl: bcm2835: implement hook for missing gpio-ranges") Signed-off-by: Christophe JAILLET --- This patch is speculative and compile tested only. If it is wrong, maybe a comment explaining why 0 should be returned would be welcomed. --- drivers/pinctrl/bcm/pinctrl-bcm2835.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c index 8e2551a08c37..cb298fad354a 100644 --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c @@ -366,10 +366,8 @@ static int bcm2835_add_pin_ranges_fallback(struct gpio_chip *gc) if (!pctldev) return 0; - gpiochip_add_pin_range(gc, pinctrl_dev_get_devname(pctldev), 0, 0, - gc->ngpio); - - return 0; + return gpiochip_add_pin_range(gc, pinctrl_dev_get_devname(pctldev), 0, 0, + gc->ngpio); } static const struct gpio_chip bcm2835_gpio_chip = {