Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5985075rwp; Mon, 17 Jul 2023 12:47:16 -0700 (PDT) X-Google-Smtp-Source: APBJJlHPE1BEYlfU9FcZtzIbhvObiBnuJHtZi4juZdKYdWcBhfMNiO0qFz/x5Qf3kojp9hR15mhs X-Received: by 2002:a17:906:9614:b0:993:f9d4:eaac with SMTP id s20-20020a170906961400b00993f9d4eaacmr10540162ejx.24.1689623236238; Mon, 17 Jul 2023 12:47:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689623236; cv=none; d=google.com; s=arc-20160816; b=X2eUPi1r+JNANbC+WhMXHyVcLsFTlKQ7Irp4k4ZPAIv+vLidrIMmAbmx9J7aWqcIop nP1qb8sQDCH8gVk/8PBNylOWTuUrkrnvPtCaJnP1WXs1nw6rQEpTLRlEovB9VrI87J5k zhiFwMsOpWYDw48rP3Exq/eq0p8LTBPhqMkCx3ldoCZNzjPf2ahsUOEhaw0awdB5ETIE 8XTWAGh4XsRxIt7msPKr4fZleGENUGaQ4DQfN9JIoQOskIJmBV4MbwWOx8UDOZMS3byM HlNmO0R6TMFT+Xs3TCskJoHrAyUNa3F4xu4obdwDQNRZ23hqVTblqJR/mIztnblp8ZLP yZ1w== 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=xjvSgydsLBAt+kJ9U/k9BFTw7JpoLGf2fEESmtZCfmw=; fh=r0pW40tkm/jD9RjXabFgSoNafui7KeGC/E7yCAT/cFU=; b=dSmPm+kcXDDD+lW60pRT/RsKx9DfwagzUafhcz3yff3CeMOiblfyO1O71l1O7b/153 19+1CNJAe9u5R+RP7+EN12qjhlLLBuCV1MPN8xbo10cAZFgnxPZ5pvSotg6Onu8DiHsV OmnZG1L03WKfvAcp9pljDGJyuwu7yzSk4t9kTdOMpe+BfWKS8vdxgsHUgQqX7gSTLBut egZZQcgwvLPDxkioIst9T1WX5Lxz8nDEWiX1dZplSEqtSNrw8nYLbLocc5VrpdA72CXR WgixOmvs3XmiVWSV3+votbMz4rjCmtGGtLhUGNB/AmVWjXaugluUqLbTBfEwp3YGEVqt uNiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=qeVCdSL1; 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 a15-20020a1709062b0f00b0098283e90548si76591ejg.570.2023.07.17.12.46.50; Mon, 17 Jul 2023 12:47:16 -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=qeVCdSL1; 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 S230317AbjGQTM6 (ORCPT + 99 others); Mon, 17 Jul 2023 15:12:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229652AbjGQTM5 (ORCPT ); Mon, 17 Jul 2023 15:12:57 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E59D116; Mon, 17 Jul 2023 12:12:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1689621174; 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=xjvSgydsLBAt+kJ9U/k9BFTw7JpoLGf2fEESmtZCfmw=; b=qeVCdSL1DB214zwLBzzpgW1NMPnfeFgV+Ul4yuE7BcFhqMCwo87py2QaHCdb3WJ1HVLVPR fkfBzWXAz4T9KH9iSCSzVhdwtSMTP+x2px4mS2rNi5fUY3UGIX3SJgUCiozeUlLvemRAVo SrkwqmTGB3bGFYaRrjrRbuvZxeZ7nGc= Message-ID: <03592cf5d6854dd5e534e0416de946fd38e4380c.camel@crapouillou.net> Subject: Re: [PATCH v2 09/10] pinctrl: renesas: 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:12:51 +0200 In-Reply-To: <20230717172821.62827-10-andriy.shevchenko@linux.intel.com> References: <20230717172821.62827-1-andriy.shevchenko@linux.intel.com> <20230717172821.62827-10-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/renesas/core.c | 16 +++++++--------- > =C2=A01 file changed, 7 insertions(+), 9 deletions(-) >=20 > diff --git a/drivers/pinctrl/renesas/core.c > b/drivers/pinctrl/renesas/core.c > index 0c8d081da6a8..34232b016960 100644 > --- a/drivers/pinctrl/renesas/core.c > +++ b/drivers/pinctrl/renesas/core.c > @@ -649,7 +649,7 @@ static const struct of_device_id > sh_pfc_of_table[] =3D { > =C2=A0}; > =C2=A0#endif > =C2=A0 > -#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_ARM_PSCI_FW) > +#if defined(CONFIG_ARM_PSCI_FW) > =C2=A0static void sh_pfc_nop_reg(struct sh_pfc *pfc, u32 reg, unsigned in= t > idx) > =C2=A0{ > =C2=A0} > @@ -732,15 +732,13 @@ static int sh_pfc_resume_noirq(struct device > *dev) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0sh_pfc_walk_regs(pfc, sh_pfc_restore_reg); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return 0; > =C2=A0} > - > -static const struct dev_pm_ops sh_pfc_pm=C2=A0 =3D { > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(= sh_pfc_suspend_noirq, > sh_pfc_resume_noirq) > -}; > -#define DEV_PM_OPS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0&sh_pfc_pm > =C2=A0#else > =C2=A0static int sh_pfc_suspend_init(struct sh_pfc *pfc) { return 0; } > -#define DEV_PM_OPS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0NULL > -#endif /* CONFIG_PM_SLEEP && CONFIG_ARM_PSCI_FW */ > +static int sh_pfc_suspend_noirq(struct device *dev) { return 0; } > +static int sh_pfc_resume_noirq(struct device *dev) { return 0; } > +#endif=C2=A0/* CONFIG_ARM_PSCI_FW */ > + > +static DEFINE_NOIRQ_DEV_PM_OPS(sh_pfc_pm, sh_pfc_suspend_noirq, > sh_pfc_resume_noirq); > =C2=A0 > =C2=A0#ifdef DEBUG > =C2=A0#define SH_PFC_MAX_REGS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0300 > @@ -1418,7 +1416,7 @@ static struct platform_driver sh_pfc_driver =3D { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0.driver=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=3D { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0.name=C2=A0=C2=A0=C2=A0=3D DRV_NAME, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0.of_match_table =3D of_match_ptr(sh_pfc_of_table), > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0.pm=C2=A0=C2=A0=C2=A0=C2=A0 =3D DEV_PM_OPS, > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0.pm=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=3D pm_sleep_ptr(&sh_pfc= _pm), I think you could do: .pm =3D IF_PTR(IS_ENABLED(CONFIG_ARM_PSCI_FW), pm_sleep_ptr(&sh_pfc_pm)), Then you wouldn't need the #if defined(CONFIG_ARM_PSCI_FW) guard either (as long as the code still compiles fine when that config option is disabled), and you wouldn't need those dummy callbacks. Cheers, -Paul > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0}, > =C2=A0}; > =C2=A0