Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6013455rwp; Mon, 17 Jul 2023 13:18:04 -0700 (PDT) X-Google-Smtp-Source: APBJJlFeYNNeN/s3LZQcVF2eHT9E1bEd39hkhomBd7KRR1Ow2aOc9qt6veQiFJ5/HR2tyXnjurB/ X-Received: by 2002:a17:90b:224a:b0:263:1d18:886a with SMTP id hk10-20020a17090b224a00b002631d18886amr12646380pjb.1.1689625084112; Mon, 17 Jul 2023 13:18:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689625084; cv=none; d=google.com; s=arc-20160816; b=mhiO+DiHXQjqY5OTltPfwI0F4Sa6Tby0EWCTF1/dw5wpGxfpNXJaRkKev5+s1pIYSN cPPs6qokNu1PuGVNVFVTnVli8SU1PlTzAXOWyI2GCKgKlh6kdVZaqrqvRAjJJWUJrO3y vj5XolTthK669gMgeoFI4K+MKWLCs8PKvIE3iwa0IhtcKhetomIJ5Uma2fZ5GDnBQwAj Mb8ISpwi3A1lBoQzXsf92cTTRHPBS50q/aXfMriCRvuIiO7dtpZ0lwSnI1d4DeEmK4bC GNivD1FRQRpyyEEHEkWuE0ZY4JS7PjNEU5pge9cmVXLC6RFbdxBscDZRxvfvR37qdJIV V2ug== 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=eOtYH4hKBzhGlvN/2fJcmQb/NBgM69hMecTKLntsWYw=; fh=r0pW40tkm/jD9RjXabFgSoNafui7KeGC/E7yCAT/cFU=; b=qJr9Td3kpWNXhId3dr+oC2qzF/5Da8o51q0Vfmg4OhnR/hJFDqcfZmJBpneSia6C4l XyS4ireribPMEo336nfEimF+gCWVrcnmsjISdgbGA/cojkhJmJRF1Tf781sz02FMpDzP k9RFkL6Kiv+XYIOFlGy4QVZAMwQJWyFr1cwvYuTUpFiC3OCgmuUvudF3sxb79cLUk7r8 WuRpQxoyDD902dQIzxvek5ngky1I4hWvtkkgo3VsmBoaoB76rHuV99e2YOCOp0KdDif+ a93SES7GDcJ1h4eRV9wH74+JB4xe32yO7ZJzQAc/TFnJPmBmSp7nWJq3ZU4CELQZlG23 ErPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=fHjDCzU4; 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 t70-20020a638149000000b0055e607f1e99si299378pgd.882.2023.07.17.13.17.50; Mon, 17 Jul 2023 13:18:04 -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=fHjDCzU4; 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 S231325AbjGQT0A (ORCPT + 99 others); Mon, 17 Jul 2023 15:26:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231294AbjGQTZ7 (ORCPT ); Mon, 17 Jul 2023 15:25:59 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8010B1B1; Mon, 17 Jul 2023 12:25:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1689621956; 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=eOtYH4hKBzhGlvN/2fJcmQb/NBgM69hMecTKLntsWYw=; b=fHjDCzU4z1U9SSlFa3/lUwZK96EDFjpO/zr6IzuhUvDGLP7d8yoCF79Jk5d8FEC1OUnO65 hHw88RTt5nyzHziz9KI8NhteJirq0XzqMM+He1hvrnBAre+PYf2PfrVO8Jy6Cs9fmjo9WE ww3ao4cdyfwmSh+hig5l1G/je/6rhGY= Message-ID: Subject: Re: [PATCH v2 06/10] pinctrl: at91: 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:25:53 +0200 In-Reply-To: <20230717172821.62827-7-andriy.shevchenko@linux.intel.com> References: <20230717172821.62827-1-andriy.shevchenko@linux.intel.com> <20230717172821.62827-7-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 Reviewed-by: Paul Cercueil Although you could add a bit more info in the message of this patch, to explain why it's OK to remove the __maybe_unused tags (the code is always visible) and why switch from pm_ptr() to pm_sleep_ptr() (it's only used for system-PM callbacks). Cheers, -Paul > --- > =C2=A0drivers/pinctrl/pinctrl-at91.c | 10 ++++------ > =C2=A01 file changed, 4 insertions(+), 6 deletions(-) >=20 > diff --git a/drivers/pinctrl/pinctrl-at91.c > b/drivers/pinctrl/pinctrl-at91.c > index 39956d821ad7..608f55c5ba5f 100644 > --- a/drivers/pinctrl/pinctrl-at91.c > +++ b/drivers/pinctrl/pinctrl-at91.c > @@ -1657,7 +1657,7 @@ static int gpio_irq_set_wake(struct irq_data > *d, unsigned state) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return 0; > =C2=A0} > =C2=A0 > -static int __maybe_unused at91_gpio_suspend(struct device *dev) > +static int at91_gpio_suspend(struct device *dev) > =C2=A0{ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0struct at91_gpio_chip *at= 91_chip =3D dev_get_drvdata(dev); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0void __iomem *pio =3D at9= 1_chip->regbase; > @@ -1675,7 +1675,7 @@ static int __maybe_unused > at91_gpio_suspend(struct device *dev) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return 0; > =C2=A0} > =C2=A0 > -static int __maybe_unused at91_gpio_resume(struct device *dev) > +static int at91_gpio_resume(struct device *dev) > =C2=A0{ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0struct at91_gpio_chip *at= 91_chip =3D dev_get_drvdata(dev); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0void __iomem *pio =3D at9= 1_chip->regbase; > @@ -1903,15 +1903,13 @@ static int at91_gpio_probe(struct > platform_device *pdev) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return 0; > =C2=A0} > =C2=A0 > -static const struct dev_pm_ops at91_gpio_pm_ops =3D { > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0NOIRQ_SYSTEM_SLEEP_PM_OPS(at91= _gpio_suspend, > at91_gpio_resume) > -}; > +static DEFINE_NOIRQ_DEV_PM_OPS(at91_gpio_pm_ops, at91_gpio_suspend, > at91_gpio_resume); > =C2=A0 > =C2=A0static struct platform_driver at91_gpio_driver =3D { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0.driver =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 =3D "gpio-at91", > =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 at91_gpio_of_match, > -=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 =3D pm_ptr(&at91_gpio_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 =3D pm_sleep_ptr(&at91_gpio_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=C2=A0.probe =3D at91_gpio_prob= e, > =C2=A0};