Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp1587556ybm; Sat, 30 May 2020 13:52:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxY5sgNCIJIuCl7Li5JH8qVP3JdhJRsPjpn0FycZKauIs/eJAH5Q3kYak7Pl3paavs34WUN X-Received: by 2002:a05:6402:144e:: with SMTP id d14mr13205614edx.14.1590871926359; Sat, 30 May 2020 13:52:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590871926; cv=none; d=google.com; s=arc-20160816; b=HZbh9HNWfiMjfJ31PJ33SW5+IMujY1BD3KXvIB1Y+eAeDzwcgPtIqb63lUx58Clyto FUp4+tL8lrjCtEy/5XTh8fuseLrr+affadRvGRj5egDeuaZZr0Zy7DEvKg8ScNqL9E7T CcF20qHA/G0KZ2QdInJEQwR+2WrTQ6VJUGd2Hwc2lPMP1CC3RVHzt6UKw9BXf6yVMNt0 Ew9qfz5IJcVfMTlOpwV3GPRU0nDdDNjwK2aYvsbtUzHVsVJqy5P+Tu7sN/pZy+y5OyHN g/0KGZ33FwjpLrONfdkgm/WtV5b0nzAb+YjI1VZ+G6pGKSePHlMk1Z8FwyGMkCB4R0HS KUXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Q373dG6zD9qRq6z1KW8SeGgRQcl/oChXRqthg9vDqUo=; b=Gk/VJbDTEFVCiQRUFMmw9orRbqFlRqp9UgYGBlMG/vei5Kaep1vmxDsIuGccdz+T0M L/gLn4/dcxp05FPcVu0Az6A+JpBwy1u1OAjUmzGFatj/xoNzVlSOP+3of6y8JVHs6Edh /2vVsmGEqtH/sV8V/HP4SZ3Hr6nEtvu1hKYqekgs+zyysQY0eY6Na7ybW09h7EtbXgGb IXXuazMdnNf9mmN7fGCZ32FZUgieUZYZEYMlHnFf2zl4gsDFn8DNIfWaowUFoTuQfQpY SUnEO1geMoJ8YOIrPfOrvaax5pU/U2CClV3rrgFXgqWz/FMUU7WTW2asZypWhYw48jZ3 hpHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y18si7932046ejc.318.2020.05.30.13.51.43; Sat, 30 May 2020 13:52:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729297AbgE3UuB (ORCPT + 99 others); Sat, 30 May 2020 16:50:01 -0400 Received: from smtp04.smtpout.orange.fr ([80.12.242.126]:41763 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728741AbgE3UuB (ORCPT ); Sat, 30 May 2020 16:50:01 -0400 Received: from localhost.localdomain ([93.22.132.31]) by mwinf5d08 with ME id l8px220060gnv2t038pxvb; Sat, 30 May 2020 22:49:59 +0200 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 30 May 2020 22:49:59 +0200 X-ME-IP: 93.22.132.31 From: Christophe JAILLET To: aisheng.dong@nxp.com, festevam@gmail.com, shawnguo@kernel.org, stefan@agner.ch, kernel@pengutronix.de, linus.walleij@linaro.org, s.hauer@pengutronix.de, linux-imx@nxp.com, gary.bisson@boundarydevices.com Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] pinctrl: freescale: imx: Fix an error handling path in 'imx_pinctrl_probe()' Date: Sat, 30 May 2020 22:49:55 +0200 Message-Id: <20200530204955.588962-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 'pinctrl_unregister()' should not be called to undo 'devm_pinctrl_register_and_init()', it is already handled by the framework. This simplifies the error handling paths of the probe function. The 'imx_free_resources()' can be removed as well. Fixes: a51c158bf0f7 ("pinctrl: imx: use radix trees for groups and functions") Signed-off-by: Christophe JAILLET --- drivers/pinctrl/freescale/pinctrl-imx.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c index 9f42036c5fbb..1f81569c7ae3 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -774,16 +774,6 @@ static int imx_pinctrl_probe_dt(struct platform_device *pdev, return 0; } -/* - * imx_free_resources() - free memory used by this driver - * @info: info driver instance - */ -static void imx_free_resources(struct imx_pinctrl *ipctl) -{ - if (ipctl->pctl) - pinctrl_unregister(ipctl->pctl); -} - int imx_pinctrl_probe(struct platform_device *pdev, const struct imx_pinctrl_soc_info *info) { @@ -874,23 +864,18 @@ int imx_pinctrl_probe(struct platform_device *pdev, &ipctl->pctl); if (ret) { dev_err(&pdev->dev, "could not register IMX pinctrl driver\n"); - goto free; + return ret; } ret = imx_pinctrl_probe_dt(pdev, ipctl); if (ret) { dev_err(&pdev->dev, "fail to probe dt properties\n"); - goto free; + return ret; } dev_info(&pdev->dev, "initialized IMX pinctrl driver\n"); return pinctrl_enable(ipctl->pctl); - -free: - imx_free_resources(ipctl); - - return ret; } static int __maybe_unused imx_pinctrl_suspend(struct device *dev) -- 2.25.1