From patchwork Mon Jul 17 17:28:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13316536 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org From: Andy Shevchenko Subject: [PATCH v2 07/10] pinctrl: mediatek: Switch to use DEFINE_NOIRQ_DEV_PM_OPS() helper Date: Mon, 17 Jul 2023 20:28:18 +0300 Message-Id: <20230717172821.62827-8-andriy.shevchenko@linux.intel.com> In-Reply-To: <20230717172821.62827-1-andriy.shevchenko@linux.intel.com> References: <20230717172821.62827-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+lwn-linux-arm-kernel=archive.lwn.net@lists.infradead.org List-Archive: To: Andy Shevchenko , Mika Westerberg , Linus Walleij , Balsam CHIHI , Claudiu Beznea , Geert Uytterhoeven , Wolfram Sang , Thierry Reding , Paul Cercueil , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org Cc: Andy Shevchenko , Andrew Lunn , Alexandre Belloni , Len Brown , "Rafael J. Wysocki" , Gregory Clement , Sean Wang , Jonathan Hunter , Ludovic Desroches , Pavel Machek , Matthias Brugger , Sebastian Hesselbarth , AngeloGioacchino Del Regno Since pm.h provides a helper for system no-IRQ PM callbacks, switch the driver to use it instead of open coded variant. Signed-off-by: Andy Shevchenko Reviewed-by: Jonathan Cameron --- drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 5 +---- drivers/pinctrl/mediatek/pinctrl-paris.c | 9 +++------ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c index 665dec419e7c..2bf5082d3aa9 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c @@ -922,10 +922,7 @@ static int mtk_eint_resume(struct device *device) return mtk_eint_do_resume(pctl->eint); } -const struct dev_pm_ops mtk_eint_pm_ops = { - .suspend_noirq = mtk_eint_suspend, - .resume_noirq = mtk_eint_resume, -}; +DEFINE_NOIRQ_DEV_PM_OPS(mtk_eint_pm_ops, mtk_eint_suspend, mtk_eint_resume); static int mtk_pctrl_build_state(struct platform_device *pdev) { diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.c b/drivers/pinctrl/mediatek/pinctrl-paris.c index 33d6c3fb7908..b1cbd5bafa2e 100644 --- a/drivers/pinctrl/mediatek/pinctrl-paris.c +++ b/drivers/pinctrl/mediatek/pinctrl-paris.c @@ -1119,24 +1119,21 @@ int mtk_paris_pinctrl_probe(struct platform_device *pdev) } EXPORT_SYMBOL_GPL(mtk_paris_pinctrl_probe); -static int mtk_paris_pinctrl_suspend(struct device *device) +static int mtk_paris_suspend(struct device *device) { struct mtk_pinctrl *pctl = dev_get_drvdata(device); return mtk_eint_do_suspend(pctl->eint); } -static int mtk_paris_pinctrl_resume(struct device *device) +static int mtk_paris_resume(struct device *device) { struct mtk_pinctrl *pctl = dev_get_drvdata(device); return mtk_eint_do_resume(pctl->eint); } -const struct dev_pm_ops mtk_paris_pinctrl_pm_ops = { - .suspend_noirq = mtk_paris_pinctrl_suspend, - .resume_noirq = mtk_paris_pinctrl_resume, -}; +DEFINE_NOIRQ_DEV_PM_OPS(mtk_paris_pinctrl_pm_ops, mtk_paris_suspend, mtk_paris_resume); MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("MediaTek Pinctrl Common Driver V2 Paris");