Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5990962rwp; Mon, 17 Jul 2023 12:55:23 -0700 (PDT) X-Google-Smtp-Source: APBJJlG4yAdeTQCNIj6GGrHkJs7PHaSrB14amZhG4vRnkBNmxxGszzTmvYYzV30h0HsRjFHm8Yu3 X-Received: by 2002:a17:902:d483:b0:1ba:fe6a:3845 with SMTP id c3-20020a170902d48300b001bafe6a3845mr14818144plg.11.1689623723351; Mon, 17 Jul 2023 12:55:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689623723; cv=none; d=google.com; s=arc-20160816; b=Xyr4rP32GgAVFBrvajvIKNl1l44uUBFth5ypcVm2u+2+7HFmQkAvPRXCTJ9OecsSas vJVmaUu3It2MML5EQs0YQa6/+pL3x3XizTW4NoZZrx//6KwHS+rIL4HvP1UZ3pPGw5bX 5d4uF5T6sJunLU659pdlvNWrlWzd4Ou+kVzy9Rg9aKpyiK6Q9TkSAOC9f5nuo+PBPqj5 DXFP3bO7PZ/dShpDqTszE2LaqBEi4QyTaGudVLVHZPkuEy49uoYMlsm/fU0nJ7pQWWnW 6Ttz9Bj+zOb/IbuLNm6PcAhGYTshg5OAaCp/cWnBeid4kfE9/sR5H0+nGujuhxsydtWc Vksw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=EUbYZ8pSTKDyookB+Z63SW+UrzvlNrmn7Cc06biQ1RY=; fh=r0pW40tkm/jD9RjXabFgSoNafui7KeGC/E7yCAT/cFU=; b=bHGGy0fGMaShL1m0A8fgRB9sp9J3ICMbbCEULI+6+gHUWcy3eBTXzPifYUqxO4VOee IihYetYTgq7hJIk5bwbLC0I8m7dJEchDNnlZ39fMGNoVfQjc97lxFldSMVnT/8XGGOsj /8i90koL7WM0GwKdWnQPBknzgpV5fy/Qy43n6bjcAIy2WVOplcZuYfAwI6L6Y48PVYgr UJPyvml6aBRaenuqi0DY4W+WfUZFjNaip+sDY1rBe5cIDRXCOYucUIlDSnD4PtMxAlPu qRGvt9QHdUnlS5hBWUtPifr41YD8Ojv/vIpppm6bZ1RSis8bhTCLP9u2dmx0Kzc57jEf wwIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=Vy1ZpdaC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w10-20020a170902e88a00b001b872e20955si400621plg.30.2023.07.17.12.55.10; Mon, 17 Jul 2023 12:55:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=Vy1ZpdaC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230391AbjGQTHH (ORCPT + 99 others); Mon, 17 Jul 2023 15:07:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230408AbjGQTHF (ORCPT ); Mon, 17 Jul 2023 15:07:05 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A60CDA; Mon, 17 Jul 2023 12:07:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1689620817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EUbYZ8pSTKDyookB+Z63SW+UrzvlNrmn7Cc06biQ1RY=; b=Vy1ZpdaCi5k3cwLDqwOtFWg7A3zS5kYwD68mlYCpmulFhmikPGznp1UU+O/FzmpYurkTQU dE1B9mWihM5B463eQv1jcypFaAEP/zRd2Wqcerui3nFeqrtlJnmHBxpmHHYUQq6LE2xUnR df3C1TFbJNELgy4uN2FVXJBkJfK6YxA= Message-ID: Subject: Re: [PATCH v2 07/10] pinctrl: mediatek: Switch to use DEFINE_NOIRQ_DEV_PM_OPS() helper From: Paul Cercueil To: Andy Shevchenko , Mika Westerberg , Linus Walleij , Balsam CHIHI , Claudiu Beznea , Geert Uytterhoeven , Wolfram Sang , Thierry Reding , 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 , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Ludovic Desroches , Nicolas Ferre , Alexandre Belloni , Jonathan Hunter , "Rafael J. Wysocki" , Len Brown , Pavel Machek Date: Mon, 17 Jul 2023 21:06:54 +0200 In-Reply-To: <20230717172821.62827-8-andriy.shevchenko@linux.intel.com> References: <20230717172821.62827-1-andriy.shevchenko@linux.intel.com> <20230717172821.62827-8-andriy.shevchenko@linux.intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andy, Le lundi 17 juillet 2023 =C3=A0 20:28 +0300, Andy Shevchenko a =C3=A9crit= =C2=A0: > Since pm.h provides a helper for system no-IRQ PM callbacks, > switch the driver to use it instead of open coded variant. >=20 > Signed-off-by: Andy Shevchenko > --- > =C2=A0drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 5 +---- > =C2=A0drivers/pinctrl/mediatek/pinctrl-paris.c=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 | 9 +++------ > =C2=A02 files changed, 4 insertions(+), 10 deletions(-) >=20 > 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) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return mtk_eint_do_resume= (pctl->eint); > =C2=A0} > =C2=A0 > -const struct dev_pm_ops mtk_eint_pm_ops =3D { > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0.suspend_noirq =3D mtk_eint_su= spend, > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0.resume_noirq =3D mtk_eint_res= ume, > -}; > +DEFINE_NOIRQ_DEV_PM_OPS(mtk_eint_pm_ops, mtk_eint_suspend, > mtk_eint_resume); > =C2=A0 > =C2=A0static int mtk_pctrl_build_state(struct platform_device *pdev) > =C2=A0{ > 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) > =C2=A0} > =C2=A0EXPORT_SYMBOL_GPL(mtk_paris_pinctrl_probe); > =C2=A0 > -static int mtk_paris_pinctrl_suspend(struct device *device) > +static int mtk_paris_suspend(struct device *device) > =C2=A0{ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0struct mtk_pinctrl *pctl = =3D dev_get_drvdata(device); > =C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return mtk_eint_do_suspen= d(pctl->eint); > =C2=A0} > =C2=A0 > -static int mtk_paris_pinctrl_resume(struct device *device) > +static int mtk_paris_resume(struct device *device) > =C2=A0{ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0struct mtk_pinctrl *pctl = =3D dev_get_drvdata(device); > =C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return mtk_eint_do_resume= (pctl->eint); > =C2=A0} > =C2=A0 > -const struct dev_pm_ops mtk_paris_pinctrl_pm_ops =3D { > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0.suspend_noirq =3D mtk_paris_p= inctrl_suspend, > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0.resume_noirq =3D mtk_paris_pi= nctrl_resume, > -}; > +DEFINE_NOIRQ_DEV_PM_OPS(mtk_paris_pinctrl_pm_ops, mtk_paris_suspend, > mtk_paris_resume); It's a bit more work, but I think you should use EXPORT_GPL_DEV_PM_OPS (or even better, EXPORT_NS_GPL_DEV_PM_OPS) so that the dev_pm_ops is conditionally exported. All callers would have to be updated to use pm_ptr(). Cheers, -Paul > =C2=A0 > =C2=A0MODULE_LICENSE("GPL v2"); > =C2=A0MODULE_DESCRIPTION("MediaTek Pinctrl Common Driver V2 Paris");