From nobody Tue Dec 2 02:20:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF9232877E8; Wed, 19 Nov 2025 15:01:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564490; cv=none; b=U/gEv9af4w3vhuydAS6swBiWkXolQhocgRiqyXxOqBzX18mLnI5rOgAKq62ZDqyWIXR4seD7aLiqnd8irtugPvuVF9wGPmTiIq23MZBWl9/JBysy0Nlt1PkJHBtx0mMWO+v00h/3tJi4UlgW7muEqJbvY8AkgNH+pFlcPebCyxs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564490; c=relaxed/simple; bh=v9W8D36bTqpg+f65pHNpmPN8TfSCoWh/X0xcXoN9wTA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=E1HaVS0a1DLDJe7Tpg+Ojgy45TBGfzYgcLk496QOSPWVuXXhH5eqJNtsJRZTHlAOeR6EC8kG6cwhmxkrEF01fRwpYzzQ59SqEJvflO2YvDYTre3lvIoRx2mCv7gYe0cLCWuiuFJNGhmPDE9ySgLAZa6IlzQiAsqnuhlNt+dkYOQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IbmFVijy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IbmFVijy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8759C113D0; Wed, 19 Nov 2025 15:01:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763564489; bh=v9W8D36bTqpg+f65pHNpmPN8TfSCoWh/X0xcXoN9wTA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IbmFVijy9Gho98tZFFCzSIywVPOUXae5n0xMw7s4R/dPFOMhyBpN0gCw1Rlcnt/VL nH8UX9Tig5hkKSQssrFQmpuyeC4+E21+CikqJVyijFasF3TTJcbMlRjj2+vwf43uuX q76p++y9aGy/Fr5ObtkTdJ53w1ZXmPFM1/I6umOljaQWWeFzNQRTRA+39VRk2A0fiG M0apB+w4udhKu9joXIuaJbZla3XfwMDHAxRi7mJFlT+M5LBJIC9oJGZ5xDOOhj9Zir FzOZqyfzLGqiI38XmT+oXAYaGL4VdIwWkD2QPZtCj2++1d/6N1tw0B57syQkXezgJf mLM/WDnELFmZQ== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Linus Walleij , Bartosz Golaszewski , Hoan Tran , Andy Shevchenko , Daniel Palmer , Romain Perier , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Robert Jarzmik , Kunihiko Hayashi , Masami Hiramatsu , Shubhrajyoti Datta , Srinivas Neeli , Michal Simek Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH v3 01/15] gpio: dwapb: Use modern PM macros Date: Wed, 19 Nov 2025 22:43:13 +0800 Message-ID: <20251119144327.13345-2-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119144327.13345-1-jszhang@kernel.org> References: <20251119144327.13345-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Jisheng Zhang Acked-by: Linus Walleij --- drivers/gpio/gpio-dwapb.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c index b42ff46d292b..4986c465c9a8 100644 --- a/drivers/gpio/gpio-dwapb.c +++ b/drivers/gpio/gpio-dwapb.c @@ -79,7 +79,6 @@ struct dwapb_platform_data { unsigned int nports; }; =20 -#ifdef CONFIG_PM_SLEEP /* Store GPIO context across system-wide suspend/resume transitions */ struct dwapb_context { u32 data; @@ -92,7 +91,6 @@ struct dwapb_context { u32 int_deb; u32 wake_en; }; -#endif =20 struct dwapb_gpio_port_irqchip { unsigned int nr_irqs; @@ -103,9 +101,7 @@ struct dwapb_gpio_port { struct gpio_generic_chip chip; struct dwapb_gpio_port_irqchip *pirq; struct dwapb_gpio *gpio; -#ifdef CONFIG_PM_SLEEP struct dwapb_context *ctx; -#endif unsigned int idx; }; =20 @@ -363,7 +359,6 @@ static int dwapb_irq_set_type(struct irq_data *d, u32 t= ype) return 0; } =20 -#ifdef CONFIG_PM_SLEEP static int dwapb_irq_set_wake(struct irq_data *d, unsigned int enable) { struct gpio_chip *gc =3D irq_data_get_irq_chip_data(d); @@ -378,9 +373,6 @@ static int dwapb_irq_set_wake(struct irq_data *d, unsig= ned int enable) =20 return 0; } -#else -#define dwapb_irq_set_wake NULL -#endif =20 static const struct irq_chip dwapb_irq_chip =3D { .name =3D DWAPB_DRIVER_NAME, @@ -390,7 +382,7 @@ static const struct irq_chip dwapb_irq_chip =3D { .irq_set_type =3D dwapb_irq_set_type, .irq_enable =3D dwapb_irq_enable, .irq_disable =3D dwapb_irq_disable, - .irq_set_wake =3D dwapb_irq_set_wake, + .irq_set_wake =3D pm_sleep_ptr(dwapb_irq_set_wake), .flags =3D IRQCHIP_IMMUTABLE, GPIOCHIP_IRQ_RESOURCE_HELPERS, }; @@ -759,7 +751,6 @@ static int dwapb_gpio_probe(struct platform_device *pde= v) return 0; } =20 -#ifdef CONFIG_PM_SLEEP static int dwapb_gpio_suspend(struct device *dev) { struct dwapb_gpio *gpio =3D dev_get_drvdata(dev); @@ -844,15 +835,14 @@ static int dwapb_gpio_resume(struct device *dev) =20 return 0; } -#endif =20 -static SIMPLE_DEV_PM_OPS(dwapb_gpio_pm_ops, dwapb_gpio_suspend, - dwapb_gpio_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(dwapb_gpio_pm_ops, + dwapb_gpio_suspend, dwapb_gpio_resume); =20 static struct platform_driver dwapb_gpio_driver =3D { .driver =3D { .name =3D DWAPB_DRIVER_NAME, - .pm =3D &dwapb_gpio_pm_ops, + .pm =3D pm_sleep_ptr(&dwapb_gpio_pm_ops), .of_match_table =3D dwapb_of_match, .acpi_match_table =3D dwapb_acpi_match, }, --=20 2.51.0 From nobody Tue Dec 2 02:20:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A93E288535; Wed, 19 Nov 2025 15:01:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564497; cv=none; b=tApxn8AIIjv2nl9i7R4V/HXWivntfVKpzGh+f0x1SCCN80tjPT7QK9GGsezbBYSVa4FERhOecRsoY4kZEECHhgvmck5gJHErP2ytlIJ9cDRjcCS7AwcJEgO+NtXMIPcc54X1BkA5di+m+gnxNQic/QH9ZbfExfRCtUf/x9qP//M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564497; c=relaxed/simple; bh=2hkE4qrZTMJx3LKrzCmdn4jDcilUVOmMo1JI2JFIt9M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Nch5ho9Z+QyUkQLSlpLXA4I7ArWELL1XxOzlL5a3b7RbuzwnP3fKcnM307DXI08kPJLR1sHTZm3iHc9aFbMy1S0In+5e/P6GYzEIdLawdwi3xKBfmFEc4ttX5I29gcHI9zlkM7gn+fhnASXq5Gn2gNvaWaSeRiT1m03vTLEeFUE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jF1kZyVU; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jF1kZyVU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35ACDC4AF17; Wed, 19 Nov 2025 15:01:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763564496; bh=2hkE4qrZTMJx3LKrzCmdn4jDcilUVOmMo1JI2JFIt9M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jF1kZyVUcRZuYZ6D0znFY/qYj9SeF/E7/XGwlp+woe10GUz1Xi1+OK1cGPwkA/eMz 8VKfUaVGgtOrQikqsbWNtU9XdV9vS4MzgfuWBEWcrMWB+zLF3gY3I73Vkq/CFSo3Bf +S0xu66GRHkYqy3YHdQtLtBapNkZBbk3rdk9ZP02kuYcAk+4VbVoK9ncM7/SR6Tqol 3Zh1+9+Ffgkhv2XoixT2grSF0IvCoFK8nnq910CsPRqec1tR+RDINHJNN4gqcGoRPa t1McDzBxqTTWz4jqwhSqJyEseT2MZVT4vkcwoK8S7XBBzTfSPNauZZu/JE0l2746aC rPFdJNWOWwPQg== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Linus Walleij , Bartosz Golaszewski , Hoan Tran , Andy Shevchenko , Daniel Palmer , Romain Perier , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Robert Jarzmik , Kunihiko Hayashi , Masami Hiramatsu , Shubhrajyoti Datta , Srinivas Neeli , Michal Simek Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH v3 02/15] gpio: brcmstb: Use modern PM macros Date: Wed, 19 Nov 2025 22:43:14 +0800 Message-ID: <20251119144327.13345-3-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119144327.13345-1-jszhang@kernel.org> References: <20251119144327.13345-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Jisheng Zhang Acked-by: Doug Berger Reviewed-by: Florian Fainelli Acked-by: Linus Walleij --- drivers/gpio/gpio-brcmstb.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c index f40c9472588b..af9287ff5dc4 100644 --- a/drivers/gpio/gpio-brcmstb.c +++ b/drivers/gpio/gpio-brcmstb.c @@ -533,7 +533,6 @@ static void brcmstb_gpio_shutdown(struct platform_devic= e *pdev) brcmstb_gpio_quiesce(&pdev->dev, false); } =20 -#ifdef CONFIG_PM_SLEEP static void brcmstb_gpio_bank_restore(struct brcmstb_gpio_priv *priv, struct brcmstb_gpio_bank *bank) { @@ -572,14 +571,9 @@ static int brcmstb_gpio_resume(struct device *dev) return 0; } =20 -#else -#define brcmstb_gpio_suspend NULL -#define brcmstb_gpio_resume NULL -#endif /* CONFIG_PM_SLEEP */ - static const struct dev_pm_ops brcmstb_gpio_pm_ops =3D { - .suspend_noirq =3D brcmstb_gpio_suspend, - .resume_noirq =3D brcmstb_gpio_resume, + .suspend_noirq =3D pm_sleep_ptr(brcmstb_gpio_suspend), + .resume_noirq =3D pm_sleep_ptr(brcmstb_gpio_resume), }; =20 static int brcmstb_gpio_probe(struct platform_device *pdev) @@ -755,7 +749,7 @@ static struct platform_driver brcmstb_gpio_driver =3D { .driver =3D { .name =3D "brcmstb-gpio", .of_match_table =3D brcmstb_gpio_of_match, - .pm =3D &brcmstb_gpio_pm_ops, + .pm =3D pm_sleep_ptr(&brcmstb_gpio_pm_ops), }, .probe =3D brcmstb_gpio_probe, .remove =3D brcmstb_gpio_remove, --=20 2.51.0 From nobody Tue Dec 2 02:20:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B8252153BE9; Wed, 19 Nov 2025 15:01:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564506; cv=none; b=qUInjH4M6ie8slcA6ouTZ60YTpOjMX8D4ArXd+8avLtJzOaVYhRTRDPTevN+0DsAHuKN6UXcgLNsH76vwOdyqVpFfb2xBaEK7syTje/I8f4v9b0HbMt/v+hB7JgzTf00jQkn1sWEqohxJgc5HnpUlYGxGXPK/mniWPecTBvbWg8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564506; c=relaxed/simple; bh=DI/09/CPRQP8uNpe7E8yAQK0B+90Wi0+Sy091DCDiog=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YWFdntAJK3zl+9Eirzto8RunSxjrOT+41RvOlgsJ63vfwvIKyU63wCvwPnn5AorZacYl84zuv2U9GUs5lq7D+4CpTptaiz9+usovuE8VoOHPINPxr9B0sPtLeZ7r60nmaxjNp0z7PO2qI/6pxODvBSIT0ZsiyD6/fV3Ul/y5WPc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KgkIqwiy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KgkIqwiy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A102C2BCB1; Wed, 19 Nov 2025 15:01:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763564506; bh=DI/09/CPRQP8uNpe7E8yAQK0B+90Wi0+Sy091DCDiog=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KgkIqwiyXSW16mLtBlHhk1qG1iZADqoFq6vuMHGdfV47AKp3EKGgmTpvW/j9SI3PO eyZWOM6NGrRsaHtHjo3mvp7oX8u0XqvJiSYmlqJ7V0WxpLVuI9/OYdyLn6sTioC2bA EqBYU2KDTtcBpbFkSloadk22H2SSRmChuzmMGsJ2iisbXQ+msrkQOO5ORZk4xo4yNy ke/Z/biJBlr87rfRPOg8Ywjma7/F7S9zRFwc0l07OnlL9OqzEAvCamHsUFPfxXUdhi LeB6a7bTI8qra2xMWQ7bkCK9cB+ReJ94goCGGs9hl1gEbGdOOoUsyTz2yfUhmjwxLy n+QllIMNiarRw== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Linus Walleij , Bartosz Golaszewski , Hoan Tran , Andy Shevchenko , Daniel Palmer , Romain Perier , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Robert Jarzmik , Kunihiko Hayashi , Masami Hiramatsu , Shubhrajyoti Datta , Srinivas Neeli , Michal Simek Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH v3 03/15] gpio: htc-egpio: Use modern PM macros Date: Wed, 19 Nov 2025 22:43:15 +0800 Message-ID: <20251119144327.13345-4-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119144327.13345-1-jszhang@kernel.org> References: <20251119144327.13345-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Jisheng Zhang Reviewed-by: Florian Fainelli --- drivers/gpio/gpio-htc-egpio.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/drivers/gpio/gpio-htc-egpio.c b/drivers/gpio/gpio-htc-egpio.c index 2eaed83214d8..72935d6dbebf 100644 --- a/drivers/gpio/gpio-htc-egpio.c +++ b/drivers/gpio/gpio-htc-egpio.c @@ -364,21 +364,20 @@ static int __init egpio_probe(struct platform_device = *pdev) return 0; } =20 -#ifdef CONFIG_PM -static int egpio_suspend(struct platform_device *pdev, pm_message_t state) +static int egpio_suspend(struct device *dev) { - struct egpio_info *ei =3D platform_get_drvdata(pdev); + struct egpio_info *ei =3D dev_get_drvdata(dev); =20 - if (ei->chained_irq && device_may_wakeup(&pdev->dev)) + if (ei->chained_irq && device_may_wakeup(dev)) enable_irq_wake(ei->chained_irq); return 0; } =20 -static int egpio_resume(struct platform_device *pdev) +static int egpio_resume(struct device *dev) { - struct egpio_info *ei =3D platform_get_drvdata(pdev); + struct egpio_info *ei =3D dev_get_drvdata(dev); =20 - if (ei->chained_irq && device_may_wakeup(&pdev->dev)) + if (ei->chained_irq && device_may_wakeup(dev)) disable_irq_wake(ei->chained_irq); =20 /* Update registers from the cache, in case @@ -386,19 +385,15 @@ static int egpio_resume(struct platform_device *pdev) egpio_write_cache(ei); return 0; } -#else -#define egpio_suspend NULL -#define egpio_resume NULL -#endif =20 +static DEFINE_SIMPLE_DEV_PM_OPS(egpio_pm_ops, egpio_suspend, egpio_resume); =20 static struct platform_driver egpio_driver =3D { .driver =3D { .name =3D "htc-egpio", .suppress_bind_attrs =3D true, + .pm =3D pm_sleep_ptr(&egpio_pm_ops), }, - .suspend =3D egpio_suspend, - .resume =3D egpio_resume, }; =20 static int __init egpio_init(void) --=20 2.51.0 From nobody Tue Dec 2 02:20:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE48A296BB5; Wed, 19 Nov 2025 15:01:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564515; cv=none; b=fW6Rx6N7Kh4c/VPD04XjVZTwLjOcJkT4SlwShOgcOnEBaohUVzCVTQ6Yd8ZbS+3//1wAP2lx7lPnCzm3uH35nZ3LmDpdHPY0V+v1ZLiaCKqfbbLk0cyiSY/BEQvE3dvfdz3PzaMNGtlcl2sCXP7Z90Q4P120ntyPWhMqgMLB56o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564515; c=relaxed/simple; bh=ayYd92BzXLAvZa6PV9kCTiwUJsvbLOFJ9xxXZLTfmYE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nEKcm/+K+HdasHtuHpAR++SaoLMg4TlUStES1P4e5bdwVzLaHI+ujgy8lK6OK3/DoM7oElwaluUHMVfioP7y6CEfLkaqJLVHS73hYYQK7VjTIzZnj89UaCqpzzNSnTL2p0xpATMg7HlyG3Uy4JbBfLz87WXlPcyMRXOGbhsbNi4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HVoSsvhY; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HVoSsvhY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5479C2BCF4; Wed, 19 Nov 2025 15:01:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763564514; bh=ayYd92BzXLAvZa6PV9kCTiwUJsvbLOFJ9xxXZLTfmYE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HVoSsvhYV2SgT6ZAcvZjUiBtzE0eAMr9Nv0usDcUAuTJR3+1mnFDyehdVnVRd7rfK +fETEwL5UZaDYwrdEs1bpiVlQZUMTnCoNAx3D7lXwogJ2gDfi3QCD3aPYpjs1gEe// OPpnhOsEy7J2VCKdULWzb3oc9uXES1dzC6soESUiixjZhTAa6/KGpZNKo2LW0u7Pbg LxTgn/fDwleAu0tSKqgBrI5st1xw28Vpw77mssYjGLr29596xSioLRGC84n7hykCmI N2BCyuhivoJyh9zBbvPd4cD78edSFor88QlzR5XS0+W+fZZVt38p/rA+lAXBvLt73A IEjQs7FrM5+gg== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Linus Walleij , Bartosz Golaszewski , Hoan Tran , Andy Shevchenko , Daniel Palmer , Romain Perier , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Robert Jarzmik , Kunihiko Hayashi , Masami Hiramatsu , Shubhrajyoti Datta , Srinivas Neeli , Michal Simek Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH v3 04/15] gpio: pl061: Use modern PM macros Date: Wed, 19 Nov 2025 22:43:16 +0800 Message-ID: <20251119144327.13345-5-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119144327.13345-1-jszhang@kernel.org> References: <20251119144327.13345-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. The pl061_context_save_regs structure is always embedded into struct pl061 to simplify code, so this brings a tiny 8 bytes memory overhead for !CONFIG_PM_SLEP. Signed-off-by: Jisheng Zhang Reviewed-by: Linus Walleij Acked-by: Linus Walleij --- drivers/gpio/gpio-pl061.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c index 02e4ffcf5a6f..919cf86fd590 100644 --- a/drivers/gpio/gpio-pl061.c +++ b/drivers/gpio/gpio-pl061.c @@ -37,7 +37,6 @@ =20 #define PL061_GPIO_NR 8 =20 -#ifdef CONFIG_PM struct pl061_context_save_regs { u8 gpio_data; u8 gpio_dir; @@ -46,7 +45,6 @@ struct pl061_context_save_regs { u8 gpio_iev; u8 gpio_ie; }; -#endif =20 struct pl061 { raw_spinlock_t lock; @@ -55,9 +53,7 @@ struct pl061 { struct gpio_chip gc; int parent_irq; =20 -#ifdef CONFIG_PM struct pl061_context_save_regs csave_regs; -#endif }; =20 static int pl061_get_direction(struct gpio_chip *gc, unsigned offset) @@ -367,7 +363,6 @@ static int pl061_probe(struct amba_device *adev, const = struct amba_id *id) return 0; } =20 -#ifdef CONFIG_PM static int pl061_suspend(struct device *dev) { struct pl061 *pl061 =3D dev_get_drvdata(dev); @@ -411,13 +406,7 @@ static int pl061_resume(struct device *dev) return 0; } =20 -static const struct dev_pm_ops pl061_dev_pm_ops =3D { - .suspend =3D pl061_suspend, - .resume =3D pl061_resume, - .freeze =3D pl061_suspend, - .restore =3D pl061_resume, -}; -#endif +static DEFINE_SIMPLE_DEV_PM_OPS(pl061_dev_pm_ops, pl061_suspend, pl061_res= ume); =20 static const struct amba_id pl061_ids[] =3D { { @@ -431,9 +420,7 @@ MODULE_DEVICE_TABLE(amba, pl061_ids); static struct amba_driver pl061_gpio_driver =3D { .drv =3D { .name =3D "pl061_gpio", -#ifdef CONFIG_PM - .pm =3D &pl061_dev_pm_ops, -#endif + .pm =3D pm_sleep_ptr(&pl061_dev_pm_ops), }, .id_table =3D pl061_ids, .probe =3D pl061_probe, --=20 2.51.0 From nobody Tue Dec 2 02:20:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9BEF52882CD; Wed, 19 Nov 2025 15:02:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564522; cv=none; b=hAOparUKYiBiwXqTjQN8KTTwQgJbkGu/KDgTd4b1xoHkNQbhQ6+TMn/IvGiCnZIDOFHCfe+R3YmFtMYwbf21Zcs3O+S8r4qKs7WUoOTPytQWUe2c8GnDJwrtjka+/QQqkOLfVUq8P5XTmuRd2D4Snz7ZEJTTZXiJm8Wy5xX7Dgw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564522; c=relaxed/simple; bh=zfENW2Hv0WrBl9fFj1kQqCsjjNw7oPS6NBN0i4rAqIQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WzusrqteAhe4Jv9i+KmB86Ugf7OaT2naqhpKLVBrFg8jfHeTljtCgfNWSAts+vYZwvIJ1PKJrWDQBnv+SLXJisRLTFSYkjr1zc4/0iW7sB00+lxRMONe9U/6EPBMcL/u10OMlA1wjFj6a311O9T9lgYwrLKbhtRq5PDdWOZYMo0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sPBGonWA; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sPBGonWA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04777C4CEF5; Wed, 19 Nov 2025 15:01:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763564521; bh=zfENW2Hv0WrBl9fFj1kQqCsjjNw7oPS6NBN0i4rAqIQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sPBGonWAUoey2l2Bq16Rpp0VQELITJ7w829ucjDacFOc973E0xqfFFvo949H4WqZz 9zCy60ApFWc4VYyR6BPqOPs3gHvgLGUEZ+pH5x99alY75XdPJZlvnMTRPsx5P9nh3E 9iOr3pY/9GgIB+HKq6Kei65YxH1BdH8WBJOOb3TPEu1DqrNuvcYe9mM2MSO0yObGJr EC46kvX6Ikn8FbWK+Hq6rKgsxyaKdsXzJ2GaUE8YQzF3Fw1MItk0ZAHg/5LbhB1yB2 OghZnht9JIswxJ4gFDR5g6TSYvmrtoena2XDF1EhM21/yCfQwFAFFcHf8eM2+dsxTT EP7+EEDJaFARA== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Linus Walleij , Bartosz Golaszewski , Hoan Tran , Andy Shevchenko , Daniel Palmer , Romain Perier , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Robert Jarzmik , Kunihiko Hayashi , Masami Hiramatsu , Shubhrajyoti Datta , Srinivas Neeli , Michal Simek Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH v3 05/15] gpio: pxa: Use modern PM macros Date: Wed, 19 Nov 2025 22:43:17 +0800 Message-ID: <20251119144327.13345-6-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119144327.13345-1-jszhang@kernel.org> References: <20251119144327.13345-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Jisheng Zhang Acked-by: Linus Walleij --- drivers/gpio/gpio-pxa.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c index fa22f3faa163..288c72f9c015 100644 --- a/drivers/gpio/gpio-pxa.c +++ b/drivers/gpio/gpio-pxa.c @@ -66,13 +66,10 @@ struct pxa_gpio_bank { unsigned long irq_mask; unsigned long irq_edge_rise; unsigned long irq_edge_fall; - -#ifdef CONFIG_PM unsigned long saved_gplr; unsigned long saved_gpdr; unsigned long saved_grer; unsigned long saved_gfer; -#endif }; =20 struct pxa_gpio_chip { @@ -746,7 +743,6 @@ static int __init pxa_gpio_dt_init(void) } device_initcall(pxa_gpio_dt_init); =20 -#ifdef CONFIG_PM static int pxa_gpio_suspend(void) { struct pxa_gpio_chip *pchip =3D pxa_gpio_chip; @@ -787,14 +783,10 @@ static void pxa_gpio_resume(void) writel_relaxed(c->saved_gpdr, c->regbase + GPDR_OFFSET); } } -#else -#define pxa_gpio_suspend NULL -#define pxa_gpio_resume NULL -#endif =20 static struct syscore_ops pxa_gpio_syscore_ops =3D { - .suspend =3D pxa_gpio_suspend, - .resume =3D pxa_gpio_resume, + .suspend =3D pm_ptr(pxa_gpio_suspend), + .resume =3D pm_ptr(pxa_gpio_resume), }; =20 static int __init pxa_gpio_sysinit(void) --=20 2.51.0 From nobody Tue Dec 2 02:20:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE70F2417E0; Wed, 19 Nov 2025 15:02:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564529; cv=none; b=j+YlOP4HH0C1VIlewwbNvIMzvDcY77eSTxwqr6CXSQDpKZSjOTeA/joqLtHYDItmCRDCqvzyQ0PCP4EOTBrrEEWZNkaOjC0foHoBZ3wth93515FgZeQPoGX2VrTtKt++rlSxvZym6HKWQKcWt+cT+Fv05XKTxBhFOTwV26/8P9Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564529; c=relaxed/simple; bh=YeIVTEsOaOeIbWf+hqNeMNj80Z42ha9QYrhd689CXAc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ks18mEi4urYg5OYc8UdkUvYWuBdVBxMtmv3LRS2FwlmMGnozgp07g5Gmcuo6Oe+0/bL/LVrycc5r3SD5M7Cn33EhyGvJzhXKjiUCt90yaJKIXR7z+BxQV8QAxyQHQsYQwupjlfZSOAl+3+UvZtKNujX7ZMb2CYY8c3Ch3IwzKAg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TaRh+4E4; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TaRh+4E4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9CE32C2BCB3; Wed, 19 Nov 2025 15:02:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763564527; bh=YeIVTEsOaOeIbWf+hqNeMNj80Z42ha9QYrhd689CXAc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TaRh+4E4cr+GLMmPZbq0Okdohn90F8ZsehdwVLjT92LQQEZlp/DnbtW35y22+O09z m49CSLo5aS+/+qEAWj/BSRUfsU8gasUw56w1e0Dkuj0TR/eSheN9fT3zFJUKJP5zvk NX9L8GQfcclf/ieRYIAGQwvwAiXjZWjla5q/xwLffhpIun9nltcLZrkuwuuWVVSj66 +0ac1lVpuiiRAtWT6TBHXRQbWsALJ+QTpuHSGTiSVUJq5zrxatqsyY4oFvMIlDr5Pw KJzxmBH6w5iKnvMOCZz8R10WaME64n9ZYh/RYnQuoQFQ+FvqX2bcBt63axr5oz0YFy lR+qSvDhctXVw== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Linus Walleij , Bartosz Golaszewski , Hoan Tran , Andy Shevchenko , Daniel Palmer , Romain Perier , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Robert Jarzmik , Kunihiko Hayashi , Masami Hiramatsu , Shubhrajyoti Datta , Srinivas Neeli , Michal Simek Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH v3 06/15] gpio: ml-ioh: Use modern PM macros Date: Wed, 19 Nov 2025 22:43:18 +0800 Message-ID: <20251119144327.13345-7-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119144327.13345-1-jszhang@kernel.org> References: <20251119144327.13345-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused Signed-off-by: Jisheng Zhang Acked-by: Andy Shevchenko Acked-by: Linus Walleij --- drivers/gpio/gpio-ml-ioh.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpio/gpio-ml-ioh.c b/drivers/gpio/gpio-ml-ioh.c index f6af81bf2b13..6576e5dcb0ee 100644 --- a/drivers/gpio/gpio-ml-ioh.c +++ b/drivers/gpio/gpio-ml-ioh.c @@ -160,7 +160,7 @@ static int ioh_gpio_direction_input(struct gpio_chip *g= pio, unsigned nr) /* * Save register configuration and disable interrupts. */ -static void __maybe_unused ioh_gpio_save_reg_conf(struct ioh_gpio *chip) +static void ioh_gpio_save_reg_conf(struct ioh_gpio *chip) { int i; =20 @@ -186,7 +186,7 @@ static void __maybe_unused ioh_gpio_save_reg_conf(struc= t ioh_gpio *chip) /* * This function restores the register configuration of the GPIO device. */ -static void __maybe_unused ioh_gpio_restore_reg_conf(struct ioh_gpio *chip) +static void ioh_gpio_restore_reg_conf(struct ioh_gpio *chip) { int i; =20 @@ -479,7 +479,7 @@ static int ioh_gpio_probe(struct pci_dev *pdev, return 0; } =20 -static int __maybe_unused ioh_gpio_suspend(struct device *dev) +static int ioh_gpio_suspend(struct device *dev) { struct ioh_gpio *chip =3D dev_get_drvdata(dev); unsigned long flags; @@ -491,7 +491,7 @@ static int __maybe_unused ioh_gpio_suspend(struct devic= e *dev) return 0; } =20 -static int __maybe_unused ioh_gpio_resume(struct device *dev) +static int ioh_gpio_resume(struct device *dev) { struct ioh_gpio *chip =3D dev_get_drvdata(dev); unsigned long flags; @@ -505,7 +505,7 @@ static int __maybe_unused ioh_gpio_resume(struct device= *dev) return 0; } =20 -static SIMPLE_DEV_PM_OPS(ioh_gpio_pm_ops, ioh_gpio_suspend, ioh_gpio_resum= e); +static DEFINE_SIMPLE_DEV_PM_OPS(ioh_gpio_pm_ops, ioh_gpio_suspend, ioh_gpi= o_resume); =20 static const struct pci_device_id ioh_gpio_pcidev_id[] =3D { { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x802E) }, @@ -518,7 +518,7 @@ static struct pci_driver ioh_gpio_driver =3D { .id_table =3D ioh_gpio_pcidev_id, .probe =3D ioh_gpio_probe, .driver =3D { - .pm =3D &ioh_gpio_pm_ops, + .pm =3D pm_sleep_ptr(&ioh_gpio_pm_ops), }, }; =20 --=20 2.51.0 From nobody Tue Dec 2 02:20:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EAE7328853E; Wed, 19 Nov 2025 15:02:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564536; cv=none; b=IbnS9k6RfrQUTd+Cq1oBXtGQ6Q2p5AZpIC19jT+i1y9X4LJxOSOHfqquaoLCd/JfXNfaUQVslL57SZxahXp8xqhQljsbCMl1mSm7G3e75WOiPz9Yh1UEdWN1H5dtGz6SV0AhdiRQsdA8fdIpl81k+0Cx7nNdyCis7VykHkTFkW4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564536; c=relaxed/simple; bh=O5fL211jY64gu41HAFIXUFvgC/PevKGGEhVmfu+o420=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LQgc7TX9+5IOg3sDCBA4aJorQp89874D70e8IPW6f0//XbuDHmGfSTrs1eT8+p0wPht22ldMn+hrCra6aeZVNkaPK/Ebmj7VO59bdQgvbIXXrR4H21lH7fcTtx0AJ/fMXA3U8tMGSglNlopDvgcDeRpiOAMnAVxSPWMZFuUtg38= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=juSDJAAp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="juSDJAAp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1B42C16AAE; Wed, 19 Nov 2025 15:02:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763564534; bh=O5fL211jY64gu41HAFIXUFvgC/PevKGGEhVmfu+o420=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=juSDJAApvmZbbwiiiMthofICdzr3rL82l7kq3p0VUk/JjGP9ZCrJNx4oSJj4O8sGR 7FravT5c2InFjdHtHtj6RamLgNDRZPhozj+Qzs0oaTHW05BfuHxF4gRXAoRy+cecbc XGxoEJ/6zlggVMVhI3avKgshh+GHYLiibDqvZFCWFJMJzyUaXvBhUsjYrwZ6XcL5N9 u8zhOfPstKEeoRV06UvQRowaUxP5jGzbGOom8XTcXpciyRK3KgNHKdsykYWAGrphEM 4+KrNpkcqobZOV58scGSvYbWDzcbCAaz+uZaY9vJPY/8ElbG4n6Ye/ecEjcd6eotuV zGfOEuX6hncEw== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Linus Walleij , Bartosz Golaszewski , Hoan Tran , Andy Shevchenko , Daniel Palmer , Romain Perier , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Robert Jarzmik , Kunihiko Hayashi , Masami Hiramatsu , Shubhrajyoti Datta , Srinivas Neeli , Michal Simek Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH v3 07/15] gpio: mlxbf2: Use modern PM macros Date: Wed, 19 Nov 2025 22:43:19 +0800 Message-ID: <20251119144327.13345-8-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119144327.13345-1-jszhang@kernel.org> References: <20251119144327.13345-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused Signed-off-by: Jisheng Zhang Acked-by: Linus Walleij --- drivers/gpio/gpio-mlxbf2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-mlxbf2.c b/drivers/gpio/gpio-mlxbf2.c index abffce3894fc..6668686a28ff 100644 --- a/drivers/gpio/gpio-mlxbf2.c +++ b/drivers/gpio/gpio-mlxbf2.c @@ -424,7 +424,7 @@ mlxbf2_gpio_probe(struct platform_device *pdev) return 0; } =20 -static int __maybe_unused mlxbf2_gpio_suspend(struct device *dev) +static int mlxbf2_gpio_suspend(struct device *dev) { struct mlxbf2_gpio_context *gs =3D dev_get_drvdata(dev); =20 @@ -436,7 +436,7 @@ static int __maybe_unused mlxbf2_gpio_suspend(struct de= vice *dev) return 0; } =20 -static int __maybe_unused mlxbf2_gpio_resume(struct device *dev) +static int mlxbf2_gpio_resume(struct device *dev) { struct mlxbf2_gpio_context *gs =3D dev_get_drvdata(dev); =20 @@ -447,7 +447,7 @@ static int __maybe_unused mlxbf2_gpio_resume(struct dev= ice *dev) =20 return 0; } -static SIMPLE_DEV_PM_OPS(mlxbf2_pm_ops, mlxbf2_gpio_suspend, mlxbf2_gpio_r= esume); +static DEFINE_SIMPLE_DEV_PM_OPS(mlxbf2_pm_ops, mlxbf2_gpio_suspend, mlxbf2= _gpio_resume); =20 static const struct acpi_device_id __maybe_unused mlxbf2_gpio_acpi_match[]= =3D { { "MLNXBF22", 0 }, @@ -459,7 +459,7 @@ static struct platform_driver mlxbf2_gpio_driver =3D { .driver =3D { .name =3D "mlxbf2_gpio", .acpi_match_table =3D mlxbf2_gpio_acpi_match, - .pm =3D &mlxbf2_pm_ops, + .pm =3D pm_sleep_ptr(&mlxbf2_pm_ops), }, .probe =3D mlxbf2_gpio_probe, }; --=20 2.51.0 From nobody Tue Dec 2 02:20:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8411C28853E; Wed, 19 Nov 2025 15:02:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564542; cv=none; b=rdAlM6eHoclx1JJgRphfRyb+CKyeBkq5oB3oEhEJ7mIGqOgS6O2EX2Riy96ya2hmlnhiKKRYzslcLpnINc2bQyG+nDutHUX3BIk2EjBYftYY3wyyeeF3mT5/DKlfybtLOMmYUucscwS78yNBk/mWth2hYWRMk4d5CG1tfXUnTYs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564542; c=relaxed/simple; bh=3m03+o1uul0EMqM9dDxOK/eGbWfiEkDRYFrWiLilPvE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QACKK5NdvgOK+ArPWy18pVlpVGwn1x77lwAw6UeZNFV0VMePUNRB8JH///dx6wy0b3Z2AsulvgxN+VLx45h+CV+oBhn5I4CV8jWMWnaHuR28QSp5NuFOGLeK8XuS0ugv5Ugv3LusO1dnuqpCptEKclAIscGKMN/TIwUZTWVGljk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cGhxOM9S; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cGhxOM9S" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60F81C116B1; Wed, 19 Nov 2025 15:02:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763564542; bh=3m03+o1uul0EMqM9dDxOK/eGbWfiEkDRYFrWiLilPvE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cGhxOM9SNzjDD67n5mr+GLid5xKqGQowNBajvGUP1MvDgQbBoAwamt+yOlE2C2Epz j9biM4gWKT+FmFb4/ZQTMfGdKSu72FsQo4dGgNGiALkxOAS8MzwtBcdI1Z24ps4gRl LrcyN3sSroKMQ78d8RcBu9vO7IcSMcybVp9cyafklnvO9mQc1QhNTYKLRE18TGCiOC n0+0D+qicXKTk5MjKyGVbLDSJPa4TsndmFxKw3noeOo5rpyhbNjfoXQ5q49hMnqO1a SIMa9piTFWYTm9UXwqV1be3s8efJqNj3xJRuxBZ51tYWohS0FvbgAw4nwedwpIJIcW jatRwmn8FU0/w== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Linus Walleij , Bartosz Golaszewski , Hoan Tran , Andy Shevchenko , Daniel Palmer , Romain Perier , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Robert Jarzmik , Kunihiko Hayashi , Masami Hiramatsu , Shubhrajyoti Datta , Srinivas Neeli , Michal Simek Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH v3 08/15] gpio: msc313: Use modern PM macros Date: Wed, 19 Nov 2025 22:43:20 +0800 Message-ID: <20251119144327.13345-9-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119144327.13345-1-jszhang@kernel.org> References: <20251119144327.13345-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused Signed-off-by: Jisheng Zhang Acked-by: Linus Walleij --- drivers/gpio/gpio-msc313.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-msc313.c b/drivers/gpio/gpio-msc313.c index b0cccd856840..7345afdc78de 100644 --- a/drivers/gpio/gpio-msc313.c +++ b/drivers/gpio/gpio-msc313.c @@ -694,7 +694,7 @@ static const struct of_device_id msc313_gpio_of_match[]= =3D { * SoC goes into suspend to memory mode so we need to save some * of the register bits before suspending and put it back when resuming */ -static int __maybe_unused msc313_gpio_suspend(struct device *dev) +static int msc313_gpio_suspend(struct device *dev) { struct msc313_gpio *gpio =3D dev_get_drvdata(dev); int i; @@ -705,7 +705,7 @@ static int __maybe_unused msc313_gpio_suspend(struct de= vice *dev) return 0; } =20 -static int __maybe_unused msc313_gpio_resume(struct device *dev) +static int msc313_gpio_resume(struct device *dev) { struct msc313_gpio *gpio =3D dev_get_drvdata(dev); int i; @@ -716,13 +716,13 @@ static int __maybe_unused msc313_gpio_resume(struct d= evice *dev) return 0; } =20 -static SIMPLE_DEV_PM_OPS(msc313_gpio_ops, msc313_gpio_suspend, msc313_gpio= _resume); +static DEFINE_SIMPLE_DEV_PM_OPS(msc313_gpio_ops, msc313_gpio_suspend, msc3= 13_gpio_resume); =20 static struct platform_driver msc313_gpio_driver =3D { .driver =3D { .name =3D DRIVER_NAME, .of_match_table =3D msc313_gpio_of_match, - .pm =3D &msc313_gpio_ops, + .pm =3D pm_sleep_ptr(&msc313_gpio_ops), }, .probe =3D msc313_gpio_probe, }; --=20 2.51.0 From nobody Tue Dec 2 02:20:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6EC572C3244; Wed, 19 Nov 2025 15:02:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564548; cv=none; b=rEgjJhs/cI1E2VdH//0W5vQ5flVB1hEc20HmuuSzhvouWegzFN01lud8G42C1RVHrKloOZ712+4ueZ6nlu0sIHW8I5CnvT+sNvuASZL5/YyJuRCS9fZ5Bi8tJXgvvIfPTBW3jnjPGXderB9Ck99yORHkTKSEN8BTxM1tF3NUtRk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564548; c=relaxed/simple; bh=ylQueHQq0vE869TT1EQhJyrzWInPZ0un96UL9qOXAPE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Lg9/OLTBqXCyuNHkmsX5uFelkOluts3IWPW001zci6pWqhGJa0/3H+QVfv8vXW2aapVVYL/Ajr686q2fVC8LlgilyrtbUA7ROD/8W2brJpin4XHJHmlgkaM+1G6C7MHk2s8eIK90P/2ZCNy/tAk8ElbMTniXvJFIElCSdIbKrnE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=j6rtBjHK; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="j6rtBjHK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D242BC19424; Wed, 19 Nov 2025 15:02:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763564548; bh=ylQueHQq0vE869TT1EQhJyrzWInPZ0un96UL9qOXAPE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j6rtBjHKND7phZMOqBW5X3diZ1CivRDJyE2Y5R/JFLTJ4Flq/XKWWKO/yXnTvbBJB 8tjK13NOuK5NjQfhBDjVVIsGPTBjJUhtD5REq5R6VrxDyepmb20fG5cfhLj8SPVzej 5V4xEFxme/mnFyWupRWuVRl60lxRr0dpALrWhkANFIeTQqLtN8rOBdtoUJB0XlMZS/ jMnrkVPnIqGbsKL4xuzYVRfEZOwy/V5g4l28L+YYrulWHbT+o6HMBupA48qFsfH2mk i86hP+4YGcYYtY1zrJVofpeA4QET8mki+JWPeCWk1LoFa52x4/8EoYzkNS4oi/cU+n lNmHYjBJ2zljg== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Linus Walleij , Bartosz Golaszewski , Hoan Tran , Andy Shevchenko , Daniel Palmer , Romain Perier , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Robert Jarzmik , Kunihiko Hayashi , Masami Hiramatsu , Shubhrajyoti Datta , Srinivas Neeli , Michal Simek Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH v3 09/15] gpio: omap: Use modern PM macros Date: Wed, 19 Nov 2025 22:43:21 +0800 Message-ID: <20251119144327.13345-10-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119144327.13345-1-jszhang@kernel.org> References: <20251119144327.13345-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused Signed-off-by: Jisheng Zhang Acked-by: Linus Walleij --- drivers/gpio/gpio-omap.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index a268c76bdca6..e136e81794df 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -1503,7 +1503,7 @@ static void omap_gpio_remove(struct platform_device *= pdev) clk_unprepare(bank->dbck); } =20 -static int __maybe_unused omap_gpio_runtime_suspend(struct device *dev) +static int omap_gpio_runtime_suspend(struct device *dev) { struct gpio_bank *bank =3D dev_get_drvdata(dev); unsigned long flags; @@ -1516,7 +1516,7 @@ static int __maybe_unused omap_gpio_runtime_suspend(s= truct device *dev) return 0; } =20 -static int __maybe_unused omap_gpio_runtime_resume(struct device *dev) +static int omap_gpio_runtime_resume(struct device *dev) { struct gpio_bank *bank =3D dev_get_drvdata(dev); unsigned long flags; @@ -1529,7 +1529,7 @@ static int __maybe_unused omap_gpio_runtime_resume(st= ruct device *dev) return 0; } =20 -static int __maybe_unused omap_gpio_suspend(struct device *dev) +static int omap_gpio_suspend(struct device *dev) { struct gpio_bank *bank =3D dev_get_drvdata(dev); =20 @@ -1541,7 +1541,7 @@ static int __maybe_unused omap_gpio_suspend(struct de= vice *dev) return omap_gpio_runtime_suspend(dev); } =20 -static int __maybe_unused omap_gpio_resume(struct device *dev) +static int omap_gpio_resume(struct device *dev) { struct gpio_bank *bank =3D dev_get_drvdata(dev); =20 @@ -1554,9 +1554,8 @@ static int __maybe_unused omap_gpio_resume(struct dev= ice *dev) } =20 static const struct dev_pm_ops gpio_pm_ops =3D { - SET_RUNTIME_PM_OPS(omap_gpio_runtime_suspend, omap_gpio_runtime_resume, - NULL) - SET_LATE_SYSTEM_SLEEP_PM_OPS(omap_gpio_suspend, omap_gpio_resume) + RUNTIME_PM_OPS(omap_gpio_runtime_suspend, omap_gpio_runtime_resume, NULL) + LATE_SYSTEM_SLEEP_PM_OPS(omap_gpio_suspend, omap_gpio_resume) }; =20 static struct platform_driver omap_gpio_driver =3D { @@ -1564,7 +1563,7 @@ static struct platform_driver omap_gpio_driver =3D { .remove =3D omap_gpio_remove, .driver =3D { .name =3D "omap_gpio", - .pm =3D &gpio_pm_ops, + .pm =3D pm_ptr(&gpio_pm_ops), .of_match_table =3D omap_gpio_match, }, }; --=20 2.51.0 From nobody Tue Dec 2 02:20:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8CF1293B75; Wed, 19 Nov 2025 15:02:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564555; cv=none; b=D1QlewX0EklWWnMeqtn1NGl7OpLwC74sWnvzajqMD23HLrqwNArKgs1vLYeP0nrQ6WqfxYp33GhtdhVFklazFFezv+oOhUusbPihwNtASJXnY8K1+sa+99L8/pPsbJdrUhRxIPw9Tbs6C3KkL67mvdjnygTyu9z8ACiidLvm7aY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564555; c=relaxed/simple; bh=Uew5IUJxn9PqW6IEG0vuxpewkQ8y9LI7WQZ1ajJmffc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S0jHZ4LjfEZHPmK/h3QP+3aa6b+gVvcu18AYKnd+rJbMaqIjJqwQRTH5N1KF73ejmlyj1bwiW71BxPtmKubtcf5O3ionBcQ/npqw+l6X59Nx+GmKmp2h3JSBVSMGSWzuxMJvdK9/34Y5ddv/TFzmV91J50cBHBjoINpR1UE9kEk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=imo+TZh5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="imo+TZh5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26544C4AF09; Wed, 19 Nov 2025 15:02:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763564554; bh=Uew5IUJxn9PqW6IEG0vuxpewkQ8y9LI7WQZ1ajJmffc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=imo+TZh5Bm/UDvpD4W8b/+/JKWqfDWm+P3ulISVjwtGe/EpD2xlsK+7azS8+4sl8l 7zGUaJwYgsNo6pepJZur0se9sJJaobHUdwG0/FJ3oHXuMy1duW4kyRTZypPLAXQ32H K8xNfiLx4punLs/sOBiqYFgUrn7m4V3xqVgAKblElMEck75VMIcqcS4bNIa0rzPHAy 0nIwpZhY9+ZIP9fYRY1fWG20uRaj7iV+qNScNc/WBoirUpK5llDarm9byIj0sul6H2 GJ1Gxq8cSFa9WVvJvzpC1I3SsvaCnoNPvP8fiDHX4XgkOQzDogTN90Q5mloGR2kNwR MrW4k8il4yuRA== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Linus Walleij , Bartosz Golaszewski , Hoan Tran , Andy Shevchenko , Daniel Palmer , Romain Perier , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Robert Jarzmik , Kunihiko Hayashi , Masami Hiramatsu , Shubhrajyoti Datta , Srinivas Neeli , Michal Simek Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH v3 10/15] gpio: pch: Use modern PM macros Date: Wed, 19 Nov 2025 22:43:22 +0800 Message-ID: <20251119144327.13345-11-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119144327.13345-1-jszhang@kernel.org> References: <20251119144327.13345-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused Signed-off-by: Jisheng Zhang Acked-by: Andy Shevchenko Acked-by: Linus Walleij --- drivers/gpio/gpio-pch.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpio/gpio-pch.c b/drivers/gpio/gpio-pch.c index 9925687e05fb..4ffa0955a9e3 100644 --- a/drivers/gpio/gpio-pch.c +++ b/drivers/gpio/gpio-pch.c @@ -171,7 +171,7 @@ static int pch_gpio_direction_input(struct gpio_chip *g= pio, unsigned int nr) /* * Save register configuration and disable interrupts. */ -static void __maybe_unused pch_gpio_save_reg_conf(struct pch_gpio *chip) +static void pch_gpio_save_reg_conf(struct pch_gpio *chip) { chip->pch_gpio_reg.ien_reg =3D ioread32(&chip->reg->ien); chip->pch_gpio_reg.imask_reg =3D ioread32(&chip->reg->imask); @@ -187,7 +187,7 @@ static void __maybe_unused pch_gpio_save_reg_conf(struc= t pch_gpio *chip) /* * This function restores the register configuration of the GPIO device. */ -static void __maybe_unused pch_gpio_restore_reg_conf(struct pch_gpio *chip) +static void pch_gpio_restore_reg_conf(struct pch_gpio *chip) { iowrite32(chip->pch_gpio_reg.ien_reg, &chip->reg->ien); iowrite32(chip->pch_gpio_reg.imask_reg, &chip->reg->imask); @@ -402,7 +402,7 @@ static int pch_gpio_probe(struct pci_dev *pdev, return pch_gpio_alloc_generic_chip(chip, irq_base, gpio_pins[chip->ioh]); } =20 -static int __maybe_unused pch_gpio_suspend(struct device *dev) +static int pch_gpio_suspend(struct device *dev) { struct pch_gpio *chip =3D dev_get_drvdata(dev); unsigned long flags; @@ -414,7 +414,7 @@ static int __maybe_unused pch_gpio_suspend(struct devic= e *dev) return 0; } =20 -static int __maybe_unused pch_gpio_resume(struct device *dev) +static int pch_gpio_resume(struct device *dev) { struct pch_gpio *chip =3D dev_get_drvdata(dev); unsigned long flags; @@ -428,7 +428,7 @@ static int __maybe_unused pch_gpio_resume(struct device= *dev) return 0; } =20 -static SIMPLE_DEV_PM_OPS(pch_gpio_pm_ops, pch_gpio_suspend, pch_gpio_resum= e); +static DEFINE_SIMPLE_DEV_PM_OPS(pch_gpio_pm_ops, pch_gpio_suspend, pch_gpi= o_resume); =20 static const struct pci_device_id pch_gpio_pcidev_id[] =3D { { PCI_DEVICE_DATA(INTEL, EG20T_PCH, INTEL_EG20T_PCH) }, @@ -444,7 +444,7 @@ static struct pci_driver pch_gpio_driver =3D { .id_table =3D pch_gpio_pcidev_id, .probe =3D pch_gpio_probe, .driver =3D { - .pm =3D &pch_gpio_pm_ops, + .pm =3D pm_sleep_ptr(&pch_gpio_pm_ops), }, }; =20 --=20 2.51.0 From nobody Tue Dec 2 02:20:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C94C293B75; Wed, 19 Nov 2025 15:02:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564565; cv=none; b=VEvVhktkYprhP6o7yEIPm11ZXVlnBrNMzKQOb6I4RBg1DqY4Dvud9kdPCekWEvJMg2UJHWwUoaO1+EAL0N2KVYP3CvyUjhJSKHORVK8jUBrInoKWxd6jDNslXxhwIfiqJ3rIsGnxD2En9qv3dAUaw83VsR0I5VgOlmsprLZuS/U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564565; c=relaxed/simple; bh=bQd3T1M8oxx00RR0Pdp7o13CYHrHsVDpYKo6mjJUh2I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WZp0mEIOplVfntXjJkSKn31SKftLsQCYZC3Uc8dlGZw32KkyjW0l4c+NM18rpH6vQsqZyWmYCnSjxZRSeHlqWKnj2Zv1pIMjNRNnkJAXavVtw0qK/fYkGXexJZ9/HiUfaUMll6BWQTp5ZpM0XcmRTG6fjiECDMsfyzwZ81EyWaw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PmmbT9DK; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PmmbT9DK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67090C113D0; Wed, 19 Nov 2025 15:02:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763564564; bh=bQd3T1M8oxx00RR0Pdp7o13CYHrHsVDpYKo6mjJUh2I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PmmbT9DKyKZR0i77bR6Qn9xkiceF+eTjQHBon2uNIrot/xX3Do9UWOGqwyaSUiJw3 h7Y3m42F4mIx9a0U/T6OdgUcK4gRcYOMzx+9z/iBrOJClFO+Ij3gv7L6sEEGdTrOV9 fMTj96g4+o6eQrMrfCE8Kto7A7oC6u7uE9VA7e9mEnXOun7QSWZwk3FtJl5OpdqsZh OJsn6AHxksb0iVqOQhCUMfyar6fGf1pCaW19crdWHpP71nO1SOSB1SBw2llFJ8PrlE hLPXGQAy7R4hMe/4jFyv/OWzYHA+NoYfQhb7Pmxj0ciOgEp/X63RR3e0lGkSVgi0VK sbZJqTY+BFhrw== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Linus Walleij , Bartosz Golaszewski , Hoan Tran , Andy Shevchenko , Daniel Palmer , Romain Perier , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Robert Jarzmik , Kunihiko Hayashi , Masami Hiramatsu , Shubhrajyoti Datta , Srinivas Neeli , Michal Simek Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH v3 11/15] gpio: tqmx86: Use modern PM macros Date: Wed, 19 Nov 2025 22:43:23 +0800 Message-ID: <20251119144327.13345-12-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119144327.13345-1-jszhang@kernel.org> References: <20251119144327.13345-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused Signed-off-by: Jisheng Zhang Acked-by: Linus Walleij --- drivers/gpio/gpio-tqmx86.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpio/gpio-tqmx86.c b/drivers/gpio/gpio-tqmx86.c index 27dd09273292..d79f515137a5 100644 --- a/drivers/gpio/gpio-tqmx86.c +++ b/drivers/gpio/gpio-tqmx86.c @@ -279,19 +279,18 @@ static void tqmx86_gpio_irq_handler(struct irq_desc *= desc) } =20 /* Minimal runtime PM is needed by the IRQ subsystem */ -static int __maybe_unused tqmx86_gpio_runtime_suspend(struct device *dev) +static int tqmx86_gpio_runtime_suspend(struct device *dev) { return 0; } =20 -static int __maybe_unused tqmx86_gpio_runtime_resume(struct device *dev) +static int tqmx86_gpio_runtime_resume(struct device *dev) { return 0; } =20 static const struct dev_pm_ops tqmx86_gpio_dev_pm_ops =3D { - SET_RUNTIME_PM_OPS(tqmx86_gpio_runtime_suspend, - tqmx86_gpio_runtime_resume, NULL) + RUNTIME_PM_OPS(tqmx86_gpio_runtime_suspend, tqmx86_gpio_runtime_resume, N= ULL) }; =20 static void tqmx86_init_irq_valid_mask(struct gpio_chip *chip, @@ -425,7 +424,7 @@ static int tqmx86_gpio_probe(struct platform_device *pd= ev) static struct platform_driver tqmx86_gpio_driver =3D { .driver =3D { .name =3D "tqmx86-gpio", - .pm =3D &tqmx86_gpio_dev_pm_ops, + .pm =3D pm_sleep_ptr(&tqmx86_gpio_dev_pm_ops), }, .probe =3D tqmx86_gpio_probe, }; --=20 2.51.0 From nobody Tue Dec 2 02:20:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 775E7293B75; Wed, 19 Nov 2025 15:02:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564575; cv=none; b=cD280KfdJbZXhMjpp/tpugdL0U6r+p2lS2NWxaI1jJjHpzkjv0UVBliARi3m/5X/RrIOLWtNNberJgkkRjR7u/I+WFvqYtZDU4hXSA3wGqz98QIiLau2YbccGonEnQVpIfeaZdSQb0FBju0DvV1g36TdG0+qUn1S+lL/oIsexdM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564575; c=relaxed/simple; bh=Os+tBdcRNnMldaZHL0II0bLpAzonGthp4S2yNOuQoUg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mgMpmV0+LY9UX/PZzJEVNNZgkTR3rZ4WzHrQjkoB+UPzhweFxzX2smpd+x4/K1b7yYqrcbnWjwYwNThtlbnHNqKjjOwEeWR3kuoKvfWvqMAvAat1JcdGO/tZwiaOBWzndin4VHbMlOwXaVWRAaDrCae+Cce47qKWpHGD9ZJ5IFs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uiSZHAhN; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uiSZHAhN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87D5DC113D0; Wed, 19 Nov 2025 15:02:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763564574; bh=Os+tBdcRNnMldaZHL0II0bLpAzonGthp4S2yNOuQoUg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uiSZHAhNRZfGjEuVovTiI4milsyYoDWr0fmeBulJYJ9B+EOPDWLIbK/dKJ8siG1SX m4nHj28g/fHQ0D2zv4ygBhsaE49kkqTULffHF2cz/XYU8Fu5yu1lQ+7D1d0tUQ/agx ZJO1VxPsHeE0UMistGeEPWLOIRuG23EAwEHJQQg+PQD204BG/q67UTIwPNwXo16XxT aMCXHu1qiwe8heGYlW9O3HMc4A+3Ucnmh0HWGk2QYeFSac+25sQRmhjU/K69qBkTlC JAJJNn2WtKMHcYY5GXmgMd2NqrRcXac+t+S8s4J+oywXJQ+PqxdT+iBqUFRlqmRDg2 8cbQArBu+CZig== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Linus Walleij , Bartosz Golaszewski , Hoan Tran , Andy Shevchenko , Daniel Palmer , Romain Perier , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Robert Jarzmik , Kunihiko Hayashi , Masami Hiramatsu , Shubhrajyoti Datta , Srinivas Neeli , Michal Simek Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH v3 12/15] gpio: uniphier: Use modern PM macros Date: Wed, 19 Nov 2025 22:43:24 +0800 Message-ID: <20251119144327.13345-13-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119144327.13345-1-jszhang@kernel.org> References: <20251119144327.13345-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused Signed-off-by: Jisheng Zhang Acked-by: Linus Walleij --- drivers/gpio/gpio-uniphier.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpio/gpio-uniphier.c b/drivers/gpio/gpio-uniphier.c index 197bb1d22b3c..0574dde5b5bb 100644 --- a/drivers/gpio/gpio-uniphier.c +++ b/drivers/gpio/gpio-uniphier.c @@ -426,7 +426,7 @@ static void uniphier_gpio_remove(struct platform_device= *pdev) irq_domain_remove(priv->domain); } =20 -static int __maybe_unused uniphier_gpio_suspend(struct device *dev) +static int uniphier_gpio_suspend(struct device *dev) { struct uniphier_gpio_priv *priv =3D dev_get_drvdata(dev); unsigned int nbanks =3D uniphier_gpio_get_nbanks(priv->chip.ngpio); @@ -448,7 +448,7 @@ static int __maybe_unused uniphier_gpio_suspend(struct = device *dev) return 0; } =20 -static int __maybe_unused uniphier_gpio_resume(struct device *dev) +static int uniphier_gpio_resume(struct device *dev) { struct uniphier_gpio_priv *priv =3D dev_get_drvdata(dev); unsigned int nbanks =3D uniphier_gpio_get_nbanks(priv->chip.ngpio); @@ -473,8 +473,7 @@ static int __maybe_unused uniphier_gpio_resume(struct d= evice *dev) } =20 static const struct dev_pm_ops uniphier_gpio_pm_ops =3D { - SET_LATE_SYSTEM_SLEEP_PM_OPS(uniphier_gpio_suspend, - uniphier_gpio_resume) + LATE_SYSTEM_SLEEP_PM_OPS(uniphier_gpio_suspend, uniphier_gpio_resume) }; =20 static const struct of_device_id uniphier_gpio_match[] =3D { @@ -489,7 +488,7 @@ static struct platform_driver uniphier_gpio_driver =3D { .driver =3D { .name =3D "uniphier-gpio", .of_match_table =3D uniphier_gpio_match, - .pm =3D &uniphier_gpio_pm_ops, + .pm =3D pm_sleep_ptr(&uniphier_gpio_pm_ops), }, }; module_platform_driver(uniphier_gpio_driver); --=20 2.51.0 From nobody Tue Dec 2 02:20:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C3FF32BD035; Wed, 19 Nov 2025 15:03:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564582; cv=none; b=CPTND074KOstBZxUD4Y7purPW0EVZSiKktfx0di6sigXXi8cAPBaX5emwDsvZ/GKo+zb6ZjtWSa86q1KEBdxd6mPGYzwhhoipb6RpmI81FRCnUDInfvpNFuvSM6uLLIDDLgderroNhMaUYuQM+2EC+djlJOlNEwgIKIyoSUxKqQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564582; c=relaxed/simple; bh=ubtLg3KUg59lOZoSqAgnUdL4Vryv6Y8AzFbqdyHyiE0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XPiXqQUOrXrsH4T7SrEcXscxzzsmzBy0rWLJgxkSP8OJewwPxKt+/znzV472QXRNiX+g9gvUCY9UjWSFDxUMRfKRHyYdnmqjIsaigLQIeDafOIzTIzIxrY8Ii1hFuykL0uyNDW6yOausYludBBBpOFEbJkfVjCepsBdkcM0g3EI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cSeOzlZm; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cSeOzlZm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6690CC19423; Wed, 19 Nov 2025 15:02:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763564581; bh=ubtLg3KUg59lOZoSqAgnUdL4Vryv6Y8AzFbqdyHyiE0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cSeOzlZmeVuUQmr9BcU0YGDJf39N5vZNKn7jwP9SP0pQVN00bARPbbpIXGl0GbfZD W3dYWk8zoqIhGCZgxp1DfSzLbNEuVXtywBQAPe2z+yJxBzrgfNDO3hmddZeKWsfDts psw66yHpHMQ0Th+ZrEdqIwDTEM9hLewjmJcZXRI3T7HZoyjtz8B0NzQpFWf8ZwECj0 TQ150kEAXveKnA1g1jaLkf2+9rkYP1of8BloA0M6IPnRqCYmKA0N4X0ydMbXuRhSIf 7VfkINiOm4hmYCLtBUUhTmKRgzXn9reJZxIrBFo+vQ1lpyDPCFpRN4tnaOFxvySHR9 0ms2a6XWA++IA== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Linus Walleij , Bartosz Golaszewski , Hoan Tran , Andy Shevchenko , Daniel Palmer , Romain Perier , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Robert Jarzmik , Kunihiko Hayashi , Masami Hiramatsu , Shubhrajyoti Datta , Srinivas Neeli , Michal Simek Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH v3 13/15] gpio: xgene: Use modern PM macros Date: Wed, 19 Nov 2025 22:43:25 +0800 Message-ID: <20251119144327.13345-14-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119144327.13345-1-jszhang@kernel.org> References: <20251119144327.13345-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused Signed-off-by: Jisheng Zhang Acked-by: Linus Walleij --- drivers/gpio/gpio-xgene.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-xgene.c b/drivers/gpio/gpio-xgene.c index 4f627de3f56c..809668449dbe 100644 --- a/drivers/gpio/gpio-xgene.c +++ b/drivers/gpio/gpio-xgene.c @@ -130,7 +130,7 @@ static int xgene_gpio_dir_out(struct gpio_chip *gc, return 0; } =20 -static __maybe_unused int xgene_gpio_suspend(struct device *dev) +static int xgene_gpio_suspend(struct device *dev) { struct xgene_gpio *gpio =3D dev_get_drvdata(dev); unsigned long bank_offset; @@ -143,7 +143,7 @@ static __maybe_unused int xgene_gpio_suspend(struct dev= ice *dev) return 0; } =20 -static __maybe_unused int xgene_gpio_resume(struct device *dev) +static int xgene_gpio_resume(struct device *dev) { struct xgene_gpio *gpio =3D dev_get_drvdata(dev); unsigned long bank_offset; @@ -156,7 +156,7 @@ static __maybe_unused int xgene_gpio_resume(struct devi= ce *dev) return 0; } =20 -static SIMPLE_DEV_PM_OPS(xgene_gpio_pm, xgene_gpio_suspend, xgene_gpio_res= ume); +static DEFINE_SIMPLE_DEV_PM_OPS(xgene_gpio_pm, xgene_gpio_suspend, xgene_g= pio_resume); =20 static int xgene_gpio_probe(struct platform_device *pdev) { @@ -204,7 +204,7 @@ static struct platform_driver xgene_gpio_driver =3D { .name =3D "xgene-gpio", .of_match_table =3D xgene_gpio_of_match, .acpi_match_table =3D ACPI_PTR(xgene_gpio_acpi_match), - .pm =3D &xgene_gpio_pm, + .pm =3D pm_sleep_ptr(&xgene_gpio_pm), }, .probe =3D xgene_gpio_probe, }; --=20 2.51.0 From nobody Tue Dec 2 02:20:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 77AE4359FA1; Wed, 19 Nov 2025 15:03:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564591; cv=none; b=DXmqhhDHni97H5SF1vYJZZ+zx+g02pA+AP3PM+79WiwNdvmN6Ta4uHsEPZXzzHd9KcHyPcPOEY1gD7d9KmkMBzS0HVlWwt7OiEPtXgRGjNcLbpMLWba6e8OOhaHP/a+sD841vNCFb4YvIJcR8RjmGSygqY7U7plWb/bLNNJ+uJ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564591; c=relaxed/simple; bh=FNQBeICxR0B/d8AdnKKxHZ3C9oJ646yuBJEylmDxAf4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LTFmXWZ5xVMCfwOCxJnZNC1I5mzWujOp1JpLwbxtHHweh+SwqEj8+o8dOnQVm7ikQBxKKIPX+Kb8mtPUPnQ0hFQBHuJ6Iw1gnsm2D+U/PXiCUd7jUNSqwH4I7rOZ9QvJw+LfB3joFPZ1LfktvZ7Pd177uzrUnVsz+1p/0CEYwlA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qBuF478Q; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qBuF478Q" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8712C16AAE; Wed, 19 Nov 2025 15:03:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763564591; bh=FNQBeICxR0B/d8AdnKKxHZ3C9oJ646yuBJEylmDxAf4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qBuF478QySTADHYHpuojYYKnlUai66KidfCa0kILAV/j7xfjpU6WiGj6n3Bv6xIPn ht5iEHGyyrb3H98sZfzLPos+iVUKEHso7cOCy0+B4n5lODYJpgjoygTocwvuuGHx7M OffZnwbAlRQy5KuTHFMV8Rkap7p3Ky9z9m+pqGH/Mo7JfSYrA5aMJDhE4u7F6Ia3dI sI+2FZZu9Zc279V90Dq+YzSFWcKuda98PBajRrSL3D+H5FfGCZsu6x3UPyjhS0LuXX urOIdorP/sCw7mUUAguviTjwzpw5iYUBrMr6ySac1jkMesGNKtarUMgQ2wVxVKuKRQ lCNx3uVTzrScg== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Linus Walleij , Bartosz Golaszewski , Hoan Tran , Andy Shevchenko , Daniel Palmer , Romain Perier , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Robert Jarzmik , Kunihiko Hayashi , Masami Hiramatsu , Shubhrajyoti Datta , Srinivas Neeli , Michal Simek Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH v3 14/15] gpio: xilinx: Use modern PM macros Date: Wed, 19 Nov 2025 22:43:26 +0800 Message-ID: <20251119144327.13345-15-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119144327.13345-1-jszhang@kernel.org> References: <20251119144327.13345-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused Signed-off-by: Jisheng Zhang Acked-by: Linus Walleij --- drivers/gpio/gpio-xilinx.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c index 83675ac81077..be4b4d730547 100644 --- a/drivers/gpio/gpio-xilinx.c +++ b/drivers/gpio/gpio-xilinx.c @@ -286,7 +286,7 @@ static void xgpio_free(struct gpio_chip *chip, unsigned= int offset) pm_runtime_put(chip->parent); } =20 -static int __maybe_unused xgpio_suspend(struct device *dev) +static int xgpio_suspend(struct device *dev) { struct xgpio_instance *gpio =3D dev_get_drvdata(dev); struct irq_data *data =3D irq_get_irq_data(gpio->irq); @@ -327,7 +327,7 @@ static void xgpio_irq_ack(struct irq_data *irq_data) { } =20 -static int __maybe_unused xgpio_resume(struct device *dev) +static int xgpio_resume(struct device *dev) { struct xgpio_instance *gpio =3D dev_get_drvdata(dev); struct irq_data *data =3D irq_get_irq_data(gpio->irq); @@ -343,7 +343,7 @@ static int __maybe_unused xgpio_resume(struct device *d= ev) return 0; } =20 -static int __maybe_unused xgpio_runtime_suspend(struct device *dev) +static int xgpio_runtime_suspend(struct device *dev) { struct xgpio_instance *gpio =3D dev_get_drvdata(dev); =20 @@ -352,7 +352,7 @@ static int __maybe_unused xgpio_runtime_suspend(struct = device *dev) return 0; } =20 -static int __maybe_unused xgpio_runtime_resume(struct device *dev) +static int xgpio_runtime_resume(struct device *dev) { struct xgpio_instance *gpio =3D dev_get_drvdata(dev); =20 @@ -360,9 +360,8 @@ static int __maybe_unused xgpio_runtime_resume(struct d= evice *dev) } =20 static const struct dev_pm_ops xgpio_dev_pm_ops =3D { - SET_SYSTEM_SLEEP_PM_OPS(xgpio_suspend, xgpio_resume) - SET_RUNTIME_PM_OPS(xgpio_runtime_suspend, - xgpio_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(xgpio_suspend, xgpio_resume) + RUNTIME_PM_OPS(xgpio_runtime_suspend, xgpio_runtime_resume, NULL) }; =20 /** @@ -682,7 +681,7 @@ static struct platform_driver xgpio_plat_driver =3D { .driver =3D { .name =3D "gpio-xilinx", .of_match_table =3D xgpio_of_match, - .pm =3D &xgpio_dev_pm_ops, + .pm =3D pm_ptr(&xgpio_dev_pm_ops), }, }; =20 --=20 2.51.0 From nobody Tue Dec 2 02:20:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE84D2BF013; Wed, 19 Nov 2025 15:03:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564600; cv=none; b=pqtGnMH+PlRSQ1CvshpJXzvZDpHS7EK+aRLlqDwj/IF5WsUzfgVxvEIIqstDi+RRwLajymZWzt+X9HwH5jSowsLHT75pmmXJXkpAu5tfreVQ1Y/DeVr9TA6mg6lTTitUWNQXLU5vhDWQn4EEmmK7KEXjZH3L4WabfJeNcw4J8v8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763564600; c=relaxed/simple; bh=V41I1DdaKjoguYvIVU3vcsbbLpnEiJ795VwgA1QsjOI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pqmx1xJpRY6aZKTqWCCAel+MCjg38QcMs/3fLUO+nFj2jVrJ/v17G12/otA9tdL7g4wRPKt42RjybcB8WJlxdICwm4okp8Yljnju2SqcdC5ejUPH9bVIIeXzTk6zJ0WxmgAUvWgBpd1aQMVvioHyIMg/vGFeNQAE/bXKsc1IGys= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cItYrC/7; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cItYrC/7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 307F3C16AAE; Wed, 19 Nov 2025 15:03:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763564600; bh=V41I1DdaKjoguYvIVU3vcsbbLpnEiJ795VwgA1QsjOI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cItYrC/7Gv/oF1ZuZmijwPyTgCtpcQjJvd2KcgR5JnuDtTxgP8bA/oAj9ZoNirK3L 91GW/fdqyignkGUcxE9AsI0gAoCki+qIz0QE9d2oKemH7hl8tgSy5tvyJrPY19KahZ Jivm4LCJd3A7+qHtZKNj37tVGWVjuo5VQR9IQ4Hrd1aaheQtMrhYLgPaiRepz6qkQh 2DxnxKfQvZTXz3enyhyLLzcaCgJ08+6JpEwL5phWRl8IzbW/Yg5IzVTp+bOw9lbuXf IZ6h66KwznJvN6mcZbuWb2fAZxHjjAXCHQi7dynKhEBGJ2Oq4+2f9ofOUf/CWCsJlh 7J0gTDaTK6NHg== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Linus Walleij , Bartosz Golaszewski , Hoan Tran , Andy Shevchenko , Daniel Palmer , Romain Perier , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Robert Jarzmik , Kunihiko Hayashi , Masami Hiramatsu , Shubhrajyoti Datta , Srinivas Neeli , Michal Simek Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH v3 15/15] gpio: zynq: Use modern PM macros Date: Wed, 19 Nov 2025 22:43:27 +0800 Message-ID: <20251119144327.13345-16-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119144327.13345-1-jszhang@kernel.org> References: <20251119144327.13345-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused Signed-off-by: Jisheng Zhang Acked-by: Linus Walleij --- drivers/gpio/gpio-zynq.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c index 0ffd76e8951f..97780c57ab56 100644 --- a/drivers/gpio/gpio-zynq.c +++ b/drivers/gpio/gpio-zynq.c @@ -735,7 +735,7 @@ static void zynq_gpio_restore_context(struct zynq_gpio = *gpio) } } =20 -static int __maybe_unused zynq_gpio_suspend(struct device *dev) +static int zynq_gpio_suspend(struct device *dev) { struct zynq_gpio *gpio =3D dev_get_drvdata(dev); struct irq_data *data =3D irq_get_irq_data(gpio->irq); @@ -756,7 +756,7 @@ static int __maybe_unused zynq_gpio_suspend(struct devi= ce *dev) return 0; } =20 -static int __maybe_unused zynq_gpio_resume(struct device *dev) +static int zynq_gpio_resume(struct device *dev) { struct zynq_gpio *gpio =3D dev_get_drvdata(dev); struct irq_data *data =3D irq_get_irq_data(gpio->irq); @@ -779,7 +779,7 @@ static int __maybe_unused zynq_gpio_resume(struct devic= e *dev) return 0; } =20 -static int __maybe_unused zynq_gpio_runtime_suspend(struct device *dev) +static int zynq_gpio_runtime_suspend(struct device *dev) { struct zynq_gpio *gpio =3D dev_get_drvdata(dev); =20 @@ -788,7 +788,7 @@ static int __maybe_unused zynq_gpio_runtime_suspend(str= uct device *dev) return 0; } =20 -static int __maybe_unused zynq_gpio_runtime_resume(struct device *dev) +static int zynq_gpio_runtime_resume(struct device *dev) { struct zynq_gpio *gpio =3D dev_get_drvdata(dev); =20 @@ -814,9 +814,8 @@ static void zynq_gpio_free(struct gpio_chip *chip, unsi= gned int offset) } =20 static const struct dev_pm_ops zynq_gpio_dev_pm_ops =3D { - SET_SYSTEM_SLEEP_PM_OPS(zynq_gpio_suspend, zynq_gpio_resume) - SET_RUNTIME_PM_OPS(zynq_gpio_runtime_suspend, - zynq_gpio_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(zynq_gpio_suspend, zynq_gpio_resume) + RUNTIME_PM_OPS(zynq_gpio_runtime_suspend, zynq_gpio_runtime_resume, NULL) }; =20 static const struct zynq_platform_data versal_gpio_def =3D { @@ -1022,7 +1021,7 @@ static void zynq_gpio_remove(struct platform_device *= pdev) static struct platform_driver zynq_gpio_driver =3D { .driver =3D { .name =3D DRIVER_NAME, - .pm =3D &zynq_gpio_dev_pm_ops, + .pm =3D pm_ptr(&zynq_gpio_dev_pm_ops), .of_match_table =3D zynq_gpio_of_match, }, .probe =3D zynq_gpio_probe, --=20 2.51.0