From patchwork Fri Oct 6 12:55:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Majewski X-Patchwork-Id: 13411464 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 8CF04E81DF4 for ; Fri, 6 Oct 2023 13:01:19 +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:References:MIME-Version:In-Reply-To: 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: List-Owner; bh=i4xaFhfmEenA6wiBqM2850GZZmemG0ffGIVRND/LXQ4=; b=oo2/U7O50UhPoN zYruSAH3EoGQKosWvvoAmbpIXH4AOx8fLRzEsVUO0lHsWyYUX4u5rSWwbOpOzn1mMvwTr6E1zl3zs eUkP7J2nC716TfjV9XdRpXWrrREzmmVizDJD8M85TY8FkV8jpsP0lhaVZoBA3dey1Mu9niel0z0hs /IVLdEfdhEI7GhhMO3BxjtQk60MwSI3WjM/tV71gjbJ5W7j6fnIrCBXbsEBlYbdgF102TMpurrrVy gaeuE5BQ6noJKFRPxIwLV1B0fgB9HclJ4taLjG79mgUkYNTcR3D7yX/L73pQauSmGerNbqx9M8dhW QqXarIZNmkKZxyvkZU6g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qokRj-005q6B-0t; Fri, 06 Oct 2023 13:00:47 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qokRe-005q3h-29 for linux-arm-kernel@lists.infradead.org; Fri, 06 Oct 2023 13:00:45 +0000 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20231006130039euoutp02b0aaaafbe13ba1f944ebbbba4161e019~LhjNILwxq0723107231euoutp02d for ; Fri, 6 Oct 2023 13:00:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20231006130039euoutp02b0aaaafbe13ba1f944ebbbba4161e019~LhjNILwxq0723107231euoutp02d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1696597239; bh=HHwaNMwgorwT9qyUyNc3f5mPDjxlKqnK60SVh708oL4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nBfY9BMj0TkQo5INau6r7hV2y/CHAUmHMxodmVADkzYj7x6i4lZZJyFhVARVnHCxi nkoxVws2/cZjC35bA9MannuUg07xlkHJL8dxyO2sSXnKgbTxUJo2hMPKlWrPLSReJF SBWDu2XmgwmgpC6jTo/M8huASjh+i94Tkrm6ogOs= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20231006130038eucas1p1dc043e5c709b0fbb1ae19524081bc6b8~LhjMsMNFp3118331183eucas1p14; Fri, 6 Oct 2023 13:00:38 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 4C.75.11320.6F400256; Fri, 6 Oct 2023 14:00:38 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20231006130038eucas1p1c849a21714227a11759681ef909ffd94~LhjMLY7He2199621996eucas1p1n; Fri, 6 Oct 2023 13:00:38 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20231006130038eusmtrp1242bf59a026e8a36054e116e1a543efa~LhjMKyUEW3160731607eusmtrp1O; Fri, 6 Oct 2023 13:00:38 +0000 (GMT) X-AuditID: cbfec7f4-97dff70000022c38-d1-652004f6acd6 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id C9.AA.25043.6F400256; Fri, 6 Oct 2023 14:00:38 +0100 (BST) Received: from AMDC4515.eu.corp.samsungelectronics.net (unknown [106.120.51.28]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231006130037eusmtip24d6f4e51e43a7e697bb3db29e67a5d98~LhjLj-GO81292012920eusmtip2T; Fri, 6 Oct 2023 13:00:37 +0000 (GMT) From: Mateusz Majewski To: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mateusz Majewski , Tomasz Figa , Krzysztof Kozlowski , Sylwester Nawrocki , Alim Akhtar , Linus Walleij , Marek Szyprowski Subject: [PATCH 1/4] pinctrl: samsung: defer pinctrl_enable Date: Fri, 6 Oct 2023 14:55:54 +0200 Message-ID: <20231006125557.212681-2-m.majewski2@samsung.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231006125557.212681-1-m.majewski2@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCKsWRmVeSWpSXmKPExsWy7djPc7rfWBRSDSZtM7V4MG8bm8Xe11vZ Lab8Wc5ksenxNVaLzfP/MFpc3jWHzWLG+X1MFhOPTWa2WHvkLrvF4TftrBardv1hdOD22Dnr LrvHnWt72Dw2L6n36NuyitHj8ya5ANYoLpuU1JzMstQifbsEroybB26zF9zmrbjaOJm1gXEL dxcjJ4eEgInEihmfGLsYuTiEB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LrvHnWt72Dw2L6n36NuyitHj8ya5ANYoPZui/NKSVIWM/OISW6VoQwsjPUNLCz0jE0s9Q2Pz WCsjUyV9O5uU1JzMstQifbsEvYybB26zF9zmrbjaOJm1gXELdxcjJ4eEgInE9TVf2LsYuTiE BJYySux+PZURIiEtcfjLFHYIW1jiz7UuNhBbSKCZSaKxzw3EZhMwkHjwZhlYjYhAN6PEt4lc IIOYBQ4wSSyZdRCsQVjAWuLh/FtMIDaLgKrE6btbwOK8ArYSjxd0QS2Ql9iz6DtYDaeAnUTT 8+8sEMtsJQ7t2MMEUS8ocXLmE7A4M1B989bZzBMYBWYhSc1CklrAyLSKUSS1tDg3PbfYSK84 Mbe4NC9dLzk/dxMjMHa2Hfu5ZQfjylcf9Q4xMnEwHmKU4GBWEuFNb5BJFeJNSaysSi3Kjy8q zUktPsRoCnT3RGYp0eR8YPTmlcQbmhmYGpqYWRqYWpoZK4nzehZ0JAoJpCeWpGanphakFsH0 MXFwSjUwyV9h3FC2+e8uoZ7M9rpTizdt7PWcusDbbIqLt9lkUZ0zwjVivxOCpe9n8pR41/TI Mh/k9HNi/F4p8Co1Vr5xrd9SjuC1B+W+Po3RWnQg4VTa74NRb0SvlbycEXGlI7NXrfxN3BLm RTMkDnp6Jr+KvLZ1qe2aDqlL+3lCbsydNVX+Wtm/205SVkwvC5cJ9tzuYag70x6srCHc0BUn neQqpC7ivXrB9l/lXC/Wsm6o/WJzNuyRfJWLOfv1B1Win83mrHV3mBxl2/G/69W0Rk0OJ0EB fsfDy6yXTrM3sFes8DqV7tq26bbYoncXJgWUFn574jjRcMMLrTe7ajTnxAkXzfQ0FnqRf/XH RH8X5jQlluKMREMt5qLiRABiEClaJgMAAA== X-CMS-MailID: 20231006130038eucas1p1c849a21714227a11759681ef909ffd94 X-Msg-Generator: CA X-RootMTR: 20231006130038eucas1p1c849a21714227a11759681ef909ffd94 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20231006130038eucas1p1c849a21714227a11759681ef909ffd94 References: <20231006125557.212681-1-m.majewski2@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231006_060042_966981_7C0E0837 X-CRM114-Status: GOOD ( 18.44 ) 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 dev_pinctrl_register function immediately enables the pinctrl subsystem, which is unpreferable in general, since drivers might be unable to handle calls immediately. Hence devm_pinctrl_register_and_init, which does not call pinctrl_enable, is preferred. In case of our driver using the old function does not seem to be problematic for now, but will become an issue when we postpone parts of pinctrl initialization in a future commit, and it is a good idea to move off a deprecated-ish function anyway. Signed-off-by: Mateusz Majewski --- drivers/pinctrl/samsung/pinctrl-samsung.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index e54847040b4a..e496af72a587 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -904,11 +904,11 @@ static int samsung_pinctrl_register(struct platform_device *pdev, if (ret) return ret; - drvdata->pctl_dev = devm_pinctrl_register(&pdev->dev, ctrldesc, - drvdata); - if (IS_ERR(drvdata->pctl_dev)) { + ret = devm_pinctrl_register_and_init(&pdev->dev, ctrldesc, drvdata, + &drvdata->pctl_dev); + if (ret) { dev_err(&pdev->dev, "could not register pinctrl driver\n"); - return PTR_ERR(drvdata->pctl_dev); + return ret; } for (bank = 0; bank < drvdata->nr_banks; ++bank) { @@ -1176,6 +1176,10 @@ static int samsung_pinctrl_probe(struct platform_device *pdev) if (ret) goto err_unregister; + ret = pinctrl_enable(drvdata->pctl_dev); + if (ret) + goto err_unregister; + platform_set_drvdata(pdev, drvdata); return 0;