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: 13411469 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 7C57AE81DF5 for ; Fri, 6 Oct 2023 13:01:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232364AbjJFNBg (ORCPT ); Fri, 6 Oct 2023 09:01:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232365AbjJFNBL (ORCPT ); Fri, 6 Oct 2023 09:01:11 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB366172C for ; Fri, 6 Oct 2023 06:00:40 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20231006130039euoutp012b0f518c395bd38fe06c24f53a8efbcc~LhjNQ0RvZ0240502405euoutp01t for ; Fri, 6 Oct 2023 13:00:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20231006130039euoutp012b0f518c395bd38fe06c24f53a8efbcc~LhjNQ0RvZ0240502405euoutp01t 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 dxcjJ4eEgInEihmfGLsYuTiEBFYwSlxetZQNwvnCKHFv0R12COczo8TGt5OYYFqur/kClVjO KDHzz0Uop5VJ4tHH5WwgVWwCBhIP3iwDS4gItDNK9Ny6BbaFWWAfk8TkjRdZQaqEBawlHs6/ BTaXRUBV4vTdLWDdvAK2Eo8XdLFD7JOX2LPoO1gNp4CdRNPz7ywQNYISJ2c+AbOZgWqat85m BlkgIXCFQ+L1tUVQx7pITJ9+mhHCFpZ4dXwL1FAZidOTe1gg7HyJGZvfA9kcQHaFxN2DXhCm tcTHM8wgJrOApsT6XfoQxY4Spy99ZYOo4JO48VYQ4gA+iUnbpjNDhHklOtqEIKpVJY7vmcQM YUtLPGm5DXWWh8SNifeYJjAqzkLyyiwkr8xC2LuAkXkVo3hqaXFuemqxUV5quV5xYm5xaV66 XnJ+7iZGYEI6/e/4lx2My1991DvEyMTBeIhRgoNZSYQ3vUEmVYg3JbGyKrUoP76oNCe1+BCj NAeLkjivaop8qpBAemJJanZqakFqEUyWiYNTqoFJIvTdqQ+n78eckih5yLA0vDx6edf0Hm/x 98JnZ/5fbJ5u78B5een74LwTywuEUk82ea+9/Vk5viVYZF6kWet0+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1Vr5xrd9SjuC1B+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> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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;