From nobody Tue Dec 2 02:20:30 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 17D5D302758; Wed, 19 Nov 2025 16:51:25 +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=1763571086; cv=none; b=u80ob2K03IdzxFBjiowVpk6Ov/N2mmTU4RLgHvDs0dHKEiC7UTatJt7k2l+5ieO8IRohQoAcmIq1/khbpsmmJi3Zd/2ecibyWpkE7niAp/Qrp+LziOt6iI6MFjys5x3HcqwHnCVwTB4OZFyBa7SgUm13PC+dJIoW4tmkhpWmwiA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763571086; c=relaxed/simple; bh=v9W8D36bTqpg+f65pHNpmPN8TfSCoWh/X0xcXoN9wTA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iHS4ydZGvLd2CwFoBnIUPr9F7SJhYP8+ykI8c9OeUvUgPktahru0dzR4gUJn938CMrS703vindtX8bit6G9r3n9lBhFGr+mg1aHNEPDRFRzD5W/Pv+dFH7kkPs0drUYZD32Zavguw7A7wqCFiAMeJap4E4lsib+hfhuI+U6QTXs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vCaA6Cbu; 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="vCaA6Cbu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61F90C113D0; Wed, 19 Nov 2025 16:51:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763571085; bh=v9W8D36bTqpg+f65pHNpmPN8TfSCoWh/X0xcXoN9wTA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vCaA6Cbu6O5VFQw6OV8BcwcM+AGuQWdxwus610ipNhwk8zV9BuDJra5OShfuRRukZ vpRHtrnWbdf+C3PzqmFlfb3q4Y/zI2NHACW4ie3s6RetsHZRh0FnhM2tQTIp8WuxgI 6zt/kHP4Oee64A7OPFzZPrRmOa7aPxegjXbsWf4C9wvagjQDGqz5dxSz22AJmvS64Q tc8oNvRF7nTOUc1o4//Lz4FhofRvRyTxShMrSZkvk75lcpE4Y9ezz/JgbtgILFGrmR o0n+Pgi4OhZyMFIMM2SQa7bvVTGHWQJdgKLqxvr0p5N84qBRrojVWOuMFQkVVVhzTH m7IudkjPw9wMw== 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 v4 01/15] gpio: dwapb: Use modern PM macros Date: Thu, 20 Nov 2025 00:33:13 +0800 Message-ID: <20251119163327.16306-2-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119163327.16306-1-jszhang@kernel.org> References: <20251119163327.16306-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 Reviewed-by: Andy Shevchenko --- 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:30 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 44F5D303A1A; Wed, 19 Nov 2025 16:51: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=1763571090; cv=none; b=SCePR3e9/CE97YnA+R3L0eS4GTeX07CM1luVL94TcLIZYd1S6NDijXeaXS0QMzfTUcYQhkZ2iy1d6toc5eN3PJX7nRfkbXHi51xTsmu7rpNHzX/oBQEU0N93jtHXFjqXeHToVBLpgA3mmw7NhHq6KGIS3ZIHgdfhnoXvDZM+Vrs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763571090; c=relaxed/simple; bh=2hkE4qrZTMJx3LKrzCmdn4jDcilUVOmMo1JI2JFIt9M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZKQF3ZSkQb5Jq+zdywOiE+nh/9qXCooP2sfzXq+YYF2EjhsOBhD/OrcrNoSKBo8LHU8jJT/UBzvZsCId4Aks7W8DYFTPUI0khiojskko6JKdsDfWGsT1rShoFV7rnpKYK93DzOXBvmXm9WwwEQjgOouXaCtLIyEmc1n8zgK+b74= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sq3aXh4/; 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="sq3aXh4/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3FEAC4CEF5; Wed, 19 Nov 2025 16:51:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763571089; bh=2hkE4qrZTMJx3LKrzCmdn4jDcilUVOmMo1JI2JFIt9M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sq3aXh4/D9Hrq9OX9uSj7FS761zTd+ZQhkb7X0UfBuhOIdDGqRb6aCmIU2uZqqLdW 3XrdfptTjvWmBHqQl+k77B73l5I1DRmiM7VGaGyfngMVoTTf5XLIAevUWmlIMNbd2K V3gT+7xS3ULHkb81VwajzJOzADaxSdye9xaN3EYXg3KPwO+Na7m7UG8fzS4U975zD2 0fVhYfnbQW3LhHJTluyEXgT14gkmEgnafHhQgKW23R9UFdXNRQwuI5TDDaxxB2GM9V y3YX9XsN4EFzK+qbwLZ2rMN2XA08dht2wXV2I1pfbHu7A0iNCypKun/UbKEa5qd25y J81hqlAdf9XmA== 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 v4 02/15] gpio: brcmstb: Use modern PM macros Date: Thu, 20 Nov 2025 00:33:14 +0800 Message-ID: <20251119163327.16306-3-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119163327.16306-1-jszhang@kernel.org> References: <20251119163327.16306-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 Reviewed-by: Andy Shevchenko --- 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:30 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 8B5CC3043B2; Wed, 19 Nov 2025 16:51:34 +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=1763571094; cv=none; b=paHlY+oZGm6b7j1T7gblCJZoOVm16kIpJ01rpZ/MUnSqpEIb8PlsEji5zS4tiknMYBjD8BmS2ZT/1eNxPxMGOkdTaJEle1Dv7OkAAXcKfmQAxlcnnuxtOyxidI2Z3CtzK03DS/shF3EwqqLxorMSEYpz0ERXmvVRCKfC3E1VNmE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763571094; c=relaxed/simple; bh=DI/09/CPRQP8uNpe7E8yAQK0B+90Wi0+Sy091DCDiog=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=q21OZQBcudAxAI9XrcicmIoCkrM6NUxjUjTmCs8AQDOhsZx6yjP0IzuortPQdWoR1iMiiGGnH376U7VencOvQk1vlpwD2OA+hO9ACaj5JTgNQFK8v5dYJGwCbU5ngmsXxcPMGztOmrppdekadw+glgpcMjBJs2ImAhpSv+xVBJc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BW05CQie; 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="BW05CQie" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3952AC116C6; Wed, 19 Nov 2025 16:51:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763571094; bh=DI/09/CPRQP8uNpe7E8yAQK0B+90Wi0+Sy091DCDiog=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BW05CQiekCujJ+DBChmUfIDvwC3HVGN89uSLlcAmC9Dg2TssDVC7wxDwfKqfHZqPx TR2/n9i0whY9nCZjKPaPwD5Ykr/d1FPr9mDvAp70mjOeKBrAyRnt5NDH5OFxXAs40X ilW9vL1Lg8a5F64VT1PS2kjKYlga4e7miHLpHWgM7CZKYNs4LuIdN91P0upbd8phhW 69r261Yxef5fY7ihSjtRZI+HGCPsIvP1eBLHQUzRjPAN77Djqe0UeDepk9bCnzthiH +KJdqh4RPE2VOF9jsCXcuzwNz49ERKYNgmpnYVM0UxaJ+rptOXCxcKTgzdZvOisp4X kqAwZqAl2YEZw== 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 v4 03/15] gpio: htc-egpio: Use modern PM macros Date: Thu, 20 Nov 2025 00:33:15 +0800 Message-ID: <20251119163327.16306-4-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119163327.16306-1-jszhang@kernel.org> References: <20251119163327.16306-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 Reviewed-by: Andy Shevchenko --- 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:30 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 C57B62FF66B; Wed, 19 Nov 2025 16:51:38 +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=1763571098; cv=none; b=Za3Iv91268MskmeMr2ag/oE9G++GK5PkYjevpZE0SfRTUl4BGObhar4PZbCfGuR0QFYmF8BrjkTlxYL4WZgUjsSvD39iHpOE+6CvCpv6Lb++26XrLXW5g4R+QdfhIe6XnAswQaD2Cv4Srq4N0gVWXsdXmjfxfhI+86o7IGHkVEE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763571098; c=relaxed/simple; bh=jFvafjHbvBgZyLImwAeIsp3vca+8NDd5agRAQRQOk+M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=r8sLgV2jtSefr5Xr9evdsVzh5YZmYcbNjEHMPT/TQ3VMiTt86xTOIu6/LBC/F9U3Xl8NRjMsg8Nx6DLrJceFoYKlRXSC+dOohie6aIC1qdbcX7qFGYhoRBhFY4qxc63rUIn5nWTT/mT/V4dxMRTcd2pI1SCLflE2TftvV+w+WBY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=h3qD6/sF; 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="h3qD6/sF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C489C113D0; Wed, 19 Nov 2025 16:51:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763571098; bh=jFvafjHbvBgZyLImwAeIsp3vca+8NDd5agRAQRQOk+M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h3qD6/sFJkomwBhepg9xSpJe1MUH0LcdZaudkyukMtPd+drlfAvs20dn09cP3S/qv AEVwkPNnXIHJJH5W5Agu35X293ocafzCiRQY0YY9a0DMV5yctXO5UFi5l8jpYOjdrO dvMDPOekUsyzrTO/xwbkWIm+6R/k13F5i4s3vmvNkoOJO5palsPA1t1LXfxPjTyVrU niQVYifeNEM/pef6mmSSYaPjKYJK9wIa5VueTqaUrzgUUYwP+i7KobbJL8OBo8JQfE oPv8USR5ESH8fpkXtQZiiPZKEudULgxmIYLjhx+6IBZzIt3nQhNeA3NqKegLl086vv H4+leGrlPhxpA== 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 v4 04/15] gpio: pl061: Use modern PM macros Date: Thu, 20 Nov 2025 00:33:16 +0800 Message-ID: <20251119163327.16306-5-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119163327.16306-1-jszhang@kernel.org> References: <20251119163327.16306-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_SLEEP. Signed-off-by: Jisheng Zhang Reviewed-by: Linus Walleij Acked-by: Linus Walleij Reviewed-by: Andy Shevchenko --- 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:30 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 000C0309DB1; Wed, 19 Nov 2025 16:51:42 +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=1763571103; cv=none; b=rS3dGbLo0G7U6jldGaOSaifO0tCC69LKDO+c/4dAyzylejyiWprPBLUuHSlZNM8p+wEZMvbwV9U5OSEPZrgW/ULgUOQ0tXJLWxUU29aMBzA+G8xrwwzron83cYil9GrDF7AvVY1EHt8nqBTaYzF0gbgyj+xlojZhGiFsPhdu6O8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763571103; c=relaxed/simple; bh=QwUEwA3W4uoGikamrTnsYO8wbCGZ57Q4s7Y5tcCZlBc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Y6B/POyY8kinOhP0/LX4k6ZKmFTPPpf4xVwfTk6XuhDtOCHi/lAd69VU/5NuPeiq0vHzc0syiPWIhhsFhnElvesg6sdpAoce5S/DgQAWPu71GY1yqofro5ef0DGKuF6F+9xJaADZuaDKyn5u8mfIiK+gZvipPvV1U5OWcRkAERA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OXCBOHKp; 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="OXCBOHKp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4660C4CEF5; Wed, 19 Nov 2025 16:51:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763571102; bh=QwUEwA3W4uoGikamrTnsYO8wbCGZ57Q4s7Y5tcCZlBc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OXCBOHKpIz9x9NZxo4o0Uv4HVwPZB6sAi+6Ad0vjNHnOrwlKorqkZeMbrW6SksB/A qN45Csi0xe1fbvpY5fgZl9A7yipQcX7GPcY2JSOVVZZX3oXjJyD/rEUfphh//x8bLX TLpyWZa1trodf8Uw7C/bB6IOlP7IgKqawevF9qJIn+cNWhGxi+noUfKmyXR2Vt1ZVp vVXMoNKlCHuBsI3ZUm0nshbn04bEpGPlAboZKhAey16v4vBWsUH8XpyPUEsuOaujTn 9LeZWDTE+GgWYrOswRdepUHasm0gmLmMhlJRRun7EoYcg7Cp8mxXU7oTuw87zaJn2Z cIK1qMsAPOdmA== 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 v4 05/15] gpio: pxa: Use modern PM macros Date: Thu, 20 Nov 2025 00:33:17 +0800 Message-ID: <20251119163327.16306-6-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119163327.16306-1-jszhang@kernel.org> References: <20251119163327.16306-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 Reviewed-by: Andy Shevchenko --- drivers/gpio/gpio-pxa.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c index fa22f3faa163..17350fea2113 100644 --- a/drivers/gpio/gpio-pxa.c +++ b/drivers/gpio/gpio-pxa.c @@ -67,12 +67,10 @@ struct pxa_gpio_bank { unsigned long irq_edge_rise; unsigned long irq_edge_fall; =20 -#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 +744,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 +784,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:30 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 2E89533A701; Wed, 19 Nov 2025 16:51: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=1763571108; cv=none; b=bPbxzeU+fVLBhxQZNg8msXqj19KZpvRXAuSGof/LJMnN2u53jkiT+iyQw8M4crRkb+9WdvfHQ5yBilqfvmll8VDBgrZJTjugpj/qyu2ErvNGloSUFzyCEo0EO/IArc9JtUFhtDqUG0xfv/qIAFL4q6J4uo/t+5GfWL4WqpPPhHM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763571108; c=relaxed/simple; bh=YeIVTEsOaOeIbWf+hqNeMNj80Z42ha9QYrhd689CXAc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=blfCRPfvLTalYl//zuNSBFkeyX3x4rGU5fzT4TPVq8u5jQ/2HJGioVuAMFg3qsQP7T6+z3gFLqIxK48/Nil5hjxQRtdNl+XLLPTvWNvPVjVMvCZ7JcmMLKQIqIcLgNsBQTVvM6go1VO2yd0JKId5+Pl94liohiosk++8q8lwl08= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vDevqylK; 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="vDevqylK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EFC0AC116C6; Wed, 19 Nov 2025 16:51:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763571106; bh=YeIVTEsOaOeIbWf+hqNeMNj80Z42ha9QYrhd689CXAc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vDevqylKPkPCm1qdectUEP5VyqefJian6EOENpuptK58dy6mxPk7HTsazoyGXOTfN FxYKKkom94v3/UbWMdt2TDNQ0oIaiLvbZBmaN+X94IJWdOjzPCZdaY9aa12oyYqj8W V4V3PZqnx+800KBonsaNRwjtJIGBFsLDPwIBAg8pNsGAqi90ldXhFoy7HJeLL1sYdh +0Zj2CK/6CXfxV4cRm1fy1gR8NpD4yiDZxZlY/DDw3lbigzyAgnyolT5GGFjmHDaON E0yTGiZKwCL/VzxoT6Fq5RuMXPKNw+3hyx3lMF6dvGZ6oNaw/Hjf5n3o7mo0D7sXhm DgbV82JISYSVQ== 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 v4 06/15] gpio: ml-ioh: Use modern PM macros Date: Thu, 20 Nov 2025 00:33:18 +0800 Message-ID: <20251119163327.16306-7-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119163327.16306-1-jszhang@kernel.org> References: <20251119163327.16306-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 Reviewed-by: Andy Shevchenko --- 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:30 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 5EFFF35BDAB; Wed, 19 Nov 2025 16:51:51 +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=1763571111; cv=none; b=GedUayQ1fpAqYF5tXuoA5COLnyjSSYummz2g5pIyjcgRnC52jaWGQQxcN6hpAXjFXpeIEc/bxxrW1mMGc0vYVBGXAUwkdZQ5SpJU2cYMTY/2EBnRANKcaD9gk0/69e9s0Ml1M7/AvKzZUHik8Gj985iOVkS3jl1d6Bb9c3Hbu2E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763571111; c=relaxed/simple; bh=O5fL211jY64gu41HAFIXUFvgC/PevKGGEhVmfu+o420=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gkwQE0EPfmg3Mf2XydcVglwVhJH7Sr2zLUDbi2+MWLAWOWHMbmMUjkjz/9dWNpzqIbX/gQHyVGMwIY8xfzLfiktQ8KZxtuyFrLvV9co3r3sHUckgj2RTapuM1BT9DSTN8s30YvDnJQRT5iKAt8+1+R6QxFHhzYEGWaGUvx2/j8g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cKJI00eY; 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="cKJI00eY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 343E8C16AAE; Wed, 19 Nov 2025 16:51:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763571111; bh=O5fL211jY64gu41HAFIXUFvgC/PevKGGEhVmfu+o420=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cKJI00eYxEG5Ab5cjpMf2CrISnmWOu7mUgGXZohhlsPd3jN7tuPS3jvVK0oXN8CYX xfPV0WeRWIEfM4b4ZB4XlyxI7ZXKU77Jhmb68jm08LecRVVqyiStiXMdNY2pn85XsK WLSOHySjYauCpJlOV9MrFtHrPGFcZLB9kI0qZlUo0s5WTXt4j8953yeCQhvLdiIXkT /xACrZb0Sw+tXsQFuoAEhmOpDWgEh0ukxsf3+y+nFd0aViidrpilACxYOSkJrFlxd0 m5rmAzkY2J/VHlnbqejWEX6doX0G85sVhEKBFSUNueDuwMkrxEJpVN0mvKS6IYMAqa lWpXaGnW1ji7Q== 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 v4 07/15] gpio: mlxbf2: Use modern PM macros Date: Thu, 20 Nov 2025 00:33:19 +0800 Message-ID: <20251119163327.16306-8-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119163327.16306-1-jszhang@kernel.org> References: <20251119163327.16306-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 Reviewed-by: Andy Shevchenko --- 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:30 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 5E57035BDC5; Wed, 19 Nov 2025 16:51: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=1763571115; cv=none; b=LYwEA76Ag5l53PVHepYCLDHuHgOULIGZUX+eSE5aL4/GVonbQj7Thcyp/RnEt8gdFlDhqVr69eYof61uDZKxtSTg21cxShojvArcnvQHuGiqJZzdV1SrUJele0IsSHQ73NeB3zJEdBC2jaFFi/GLl7+8NtEL936d0phBHj5YIVw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763571115; c=relaxed/simple; bh=3m03+o1uul0EMqM9dDxOK/eGbWfiEkDRYFrWiLilPvE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Jc3DNP51YKAl0B74ZgVcTboLfy0ozcJMXWyHGtGKOSS9GDc74OYSh8UWo98MC604wpiLXX+4r7W25j5SNT+o6P2Q7TBGE1sETlIW+btsPHVqeksGX7WGBs8sWtR18eF4PXs935fI1mbUKx+uxctzyWmAgUBMaltEJIcj/VftiMU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=a8cLEvHy; 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="a8cLEvHy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CE50C4CEF5; Wed, 19 Nov 2025 16:51:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763571115; bh=3m03+o1uul0EMqM9dDxOK/eGbWfiEkDRYFrWiLilPvE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a8cLEvHynyCIHxSr9bCntp1znvd1VnzvutbMsC2Z5TrWvNGgJo7qe5wrFPyvnZFey U4iT9bY6G8k+nQRzIXnWEE/oJPhvsI43EK0Ojr2KZfp6DO6xixyHlmWva0Mjhsc+BG x6SOIL8LYz9Pof/iqSENv2LzlpvtknOnTyWi2fE4NU8Z0sBYlXZLsJqHzh5CZaw7bj AIm+knCk/k3Xg6w05kUMz87NdRhy5hn2/copp1IyiV9PixTiqW/YeLaDFJA0yf/EwZ 7LPik6l0jKUIm2YJnAHpKLP9kNR2RWSUEph1aT/KvlGoybCRSBmfaQ2f+Eb0kxo/8K 0cKXXy0M6u5oQ== 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 v4 08/15] gpio: msc313: Use modern PM macros Date: Thu, 20 Nov 2025 00:33:20 +0800 Message-ID: <20251119163327.16306-9-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119163327.16306-1-jszhang@kernel.org> References: <20251119163327.16306-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 Reviewed-by: Andy Shevchenko --- 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:30 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 D5F85301002; Wed, 19 Nov 2025 16:51:59 +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=1763571120; cv=none; b=PfSt/4E33COly6MAA8XuRvylve9JvLCKTG8TMS/1f85lHwoFPo6vr1a8MJxyDm67eDsKsa53V3bOTAQLTtw9b8qNINmPpVMfMFO2Cnwt/bomTCDpdncgdXkjvPi4lYBEoc7P5l5uS/VxdjzXQyvhFwmwd8nEL6V3ak1dJwwBJcE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763571120; c=relaxed/simple; bh=ylQueHQq0vE869TT1EQhJyrzWInPZ0un96UL9qOXAPE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YQWH0jR4OVDH2d7g2n8bbe2gL6XX4usX42CTSmr695InJIw1WAtxDlqV6CQenitFnjUti8G4qMen6pZkrdpmRfT97G/iBwchpSdcdz0NEbPYU5VHGM5vqWv5vqLVxLdKam+0URtdUXvmcJPxpNqxl5q0pvRMdu2Iw+qvgGYFIgQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jnfUFH7b; 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="jnfUFH7b" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A57CDC116B1; Wed, 19 Nov 2025 16:51:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763571119; bh=ylQueHQq0vE869TT1EQhJyrzWInPZ0un96UL9qOXAPE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jnfUFH7bCDMpjoAy7UZiCRZp1tbM63OJHTgBv01qYSViy40CfvNVH4o8iuF7ovE5T cw8EEdTkizq6dUdG0yrKXtj46JQAB9Gpotj2dYqW5IwD1Hlt2zJh+jmAxM63UBKV8x /3USsajeoAyaCxHzULgSehXi2Qyfuqf0LY7crOYOUDszPH8ChSOitXZu27eBr7wDq0 s2+wIgxiJruNI7I6rwB/5snPPOzwh+N5TqWi/ZR6fPlyU7+5g7G9+zNYv6Td/R2al3 7l7EqT8R4T0Y55xUiGS/mScqyFSAXNa4j6/Ivt73gMWV7WsDw2Cjdfkbw6A4E7Lhqn XMt0mXPSeifrg== 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 v4 09/15] gpio: omap: Use modern PM macros Date: Thu, 20 Nov 2025 00:33:21 +0800 Message-ID: <20251119163327.16306-10-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119163327.16306-1-jszhang@kernel.org> References: <20251119163327.16306-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 Reviewed-by: Andy Shevchenko --- 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:30 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 8A43E2FFDD9; Wed, 19 Nov 2025 16:52:04 +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=1763571124; cv=none; b=uZT2p/SJqaUwbdbA/oWIRgeSVCapbzWNzUOQl61Khago8ZB+NfzRg9GSMFAxS7BcoYRM7RrnvEiebkn++WUUaH/lpCPDaPTXGNzjM3wOIaeBuALDkHt14oR73Oqe3P8vo0vJeSHdXibHxzNftHtNzvPSvkSrzvd2N0yPuGBARWY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763571124; c=relaxed/simple; bh=Uew5IUJxn9PqW6IEG0vuxpewkQ8y9LI7WQZ1ajJmffc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oqEg+cOBFcJku+eOkzbpxb8/lDJMBn8AqmBfj7YuBli1c2nvVZk4OR0KtkFUcmZdOhVXbK7AZ3PdFl4OgpwhCrynUXvoblKLJr5Kw/67SEZi7dDbDgTTFBDAGDq49QKhhuNTy+xb6MUkIntfqWI484YEDwDceAvQ94u0qjM4pzA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Z7rw1du2; 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="Z7rw1du2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0991C4CEF5; Wed, 19 Nov 2025 16:51:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763571124; bh=Uew5IUJxn9PqW6IEG0vuxpewkQ8y9LI7WQZ1ajJmffc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z7rw1du2mVCM1PxXnx+OjmhmfADl0BCDiXKyuU5sITZ0TfTmlaq1Q9Nhd3CHTGn+S A9zLmujOkeRse73kXgdgUNx99PJwHWfygw/SWtR6ppKTpmAEvvSSFiECW5gxnMN4Ad dyRNwSilydP1Kl4Euss9vrPTzJJPae65Jl4mJ/Zy5THoQqAbNBNfFHCole2zNa0KY5 /V0LgXalhcCPACoOMQezoPYc7CqJaY2bECNZWCuEgbj6pf5EU0PbSUMaFR5t4WaaD3 0K3WMJjupp/xtxVtcEajGOyvDYlPuISjqwwB8h+gJQjOG9P/Dk9B1eGGnrvOm4lvcP eMsCdyq7huTHA== 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 v4 10/15] gpio: pch: Use modern PM macros Date: Thu, 20 Nov 2025 00:33:22 +0800 Message-ID: <20251119163327.16306-11-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119163327.16306-1-jszhang@kernel.org> References: <20251119163327.16306-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 Reviewed-by: Andy Shevchenko --- 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:30 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 7DB89273D81; Wed, 19 Nov 2025 16:52: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=1763571128; cv=none; b=aTawKUu01cHtesbHFh4LnKmkcaQWY11x8kP3O7KN5kHAn/Q54WcXQrOkWmvKZBJ3P8UyyohausMUUGkBQOQPa4PBlu7+94alYYLIjxnM7Qd9sdHNtDeX5uBpvIohaU/+cbQy/BQP5q6uJNHhMJ04ItuAxlFi1DYbcIRsruuQlhM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763571128; c=relaxed/simple; bh=bQd3T1M8oxx00RR0Pdp7o13CYHrHsVDpYKo6mjJUh2I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f3JbsmJLSB1SYTla9tZ2gv9hoDGgg1UtFLINZ0Ihz7sIoM+Fb9qwenKweZNwcsg01fAZsxaKvupJOr/gTMudt4DZKfXcdw24wqg0PK6KrbEcIQVBF6wEiotTnoP0Mt/OvQBVY2Z0zdcahOOJC9ttTa1g44Tbr9EMDtvXwl/x0+Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AOM5O06K; 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="AOM5O06K" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82DBEC116C6; Wed, 19 Nov 2025 16:52:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763571128; bh=bQd3T1M8oxx00RR0Pdp7o13CYHrHsVDpYKo6mjJUh2I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AOM5O06KsRx6MFMQZlTFmhZBZiLB9RZb6zwvx21pvv4l5LxR3e7S64ilLSPjmnB0W 52NDQqyev6U5cXJKzeTdVSpFuF87jyKNULWr3N8rO2ltJmY5fvy8quL40TWi9MrDhq VjksuJjarlGQq6VY6N09w9Lc3t+xpaUSdnHN0exLtTEbmOO3TSvu12CKuklpND9Pcj T85t2nXdlmQ3y0h8K5/IEdt0novlEJuzqOLdllwL+sdOHLrFjYmVguZqmq8d4fMwkw iyBuomXaPe60e4bwWyexDgxAisvXTbAfiVLy1KAPB3e7CGo6FgM8BFPQKGURLtHRft VXOeMJPAlIBZg== 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 v4 11/15] gpio: tqmx86: Use modern PM macros Date: Thu, 20 Nov 2025 00:33:23 +0800 Message-ID: <20251119163327.16306-12-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119163327.16306-1-jszhang@kernel.org> References: <20251119163327.16306-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 Reviewed-by: Andy Shevchenko --- 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:30 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 0A55D301475; Wed, 19 Nov 2025 16:52:12 +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=1763571133; cv=none; b=exD/1eNR31795J3jckrZ4UqO8kRiKQdfZTbJvnJ98aRkwvGiffr3OaR9NKckma1sJPSxG6VoNCG7ub95gWXRIkMEvuLxGYLW+dX/V+8bxhhxupefvYJY0rejJXHwv9COaLiKMr54xJlTKP8NdB0p5H0pIItr9j2k+BkqmjyKuao= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763571133; c=relaxed/simple; bh=Os+tBdcRNnMldaZHL0II0bLpAzonGthp4S2yNOuQoUg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f+ZRpSDjhrBe2s/xa7ed2KL2jkUEQw5Y2UsZiBBHl3ZXq6ow5xDGBDzz5oZDu31M5L/iInxrM7wQpC+PjCHQFcXDWgxBce/7yc6/SQAAtBD96wfp4k2mfRUesPVvVXJRQwIuG14mzA4WrZotWj/MnbsrtSqPkmG+c6UXdPpnOL8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cojMEqRS; 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="cojMEqRS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC04AC4CEF5; Wed, 19 Nov 2025 16:52:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763571132; bh=Os+tBdcRNnMldaZHL0II0bLpAzonGthp4S2yNOuQoUg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cojMEqRSIAU7w+tNy6D9xFUwiPS1yYVrugtviu2Y5JDhLjMJnVkQWkdPKugNajVc+ Jxw9rgOmpNNVL5ZsgbffP/RxHcQ1KY3DO+i57VImTyQixLk7Jz7QKarlKh6/+L/X2f 6ek1N1gzIbbjgQ/7Q9kJXz6a1zpVuYsHG74m5VJkgow7FYnDe9ijlmJOq3M3mlBj7l nRkdSFDHMFfrHg8aMTAD/hX5OBlbNSC8AOpQeHErDhtLm2OAazIL1ynEybb2ciKZJ8 iaZZmCPN86bGKsrmLxDE+791/Ulew30huDkqOvnXnbYq+33+gs5fpZYHrJMPsp1SUW WYE+HrUEKDiZQ== 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 v4 12/15] gpio: uniphier: Use modern PM macros Date: Thu, 20 Nov 2025 00:33:24 +0800 Message-ID: <20251119163327.16306-13-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119163327.16306-1-jszhang@kernel.org> References: <20251119163327.16306-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 Reviewed-by: Andy Shevchenko --- 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:30 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 EDF4836CDFD; Wed, 19 Nov 2025 16:52:16 +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=1763571138; cv=none; b=nBJBbgh9GQYsdKCJbkEQYm++eaaZorYWIaa/aLlAHyfh/CiB062Q+9G2ATbvAdWysiny+6zltfnfpu/aHnEUwD0ra4M0u/8/3f7ckEZwfdVz2ij81kXlZhcF2zI3+Ps6u6J+KTS254v0jzu38Y2EUA5L1f/uRRVPpDj+apn3rNE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763571138; c=relaxed/simple; bh=ubtLg3KUg59lOZoSqAgnUdL4Vryv6Y8AzFbqdyHyiE0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iKdXdHFXnwfwU6CY79BEl36qiq2fYXKqOVdOvyi/PVn5LDYs3UvotrJi43+4lVwLJozj4jFsEjOSRq3910lv0byU7jXI3xRNDeLN7nFUSmVmVodXqBdgsculmN0X1FWHCgh/utXsrdzJIHvCpRIRbbtsQppufexhf+CuVsqTL0s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZwLETMT2; 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="ZwLETMT2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02360C113D0; Wed, 19 Nov 2025 16:52:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763571136; bh=ubtLg3KUg59lOZoSqAgnUdL4Vryv6Y8AzFbqdyHyiE0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZwLETMT2qY/WTDQajr8TWLWn3R6YIskJJXuNGIrqJhWOBoYZepGoF6rUzFegBn29W BYeyGGd3/4D7BWMGWpb8FgeBMcImYvt6aZYEz0EyF04omx0S5zZcqJcR5X3ImIVf3j tN0dnCTV+Opbf+Wkk8VQJvZAfwkExgRdA9JDpWSV11QXUbEcxGII46qIdLn5PB7aZw S4nr2tfucAvBSqKJiWT3NHsOSGfZLN5o4J4iaLQY3SBCGjwnT5HTNwDQh2P51IrNFQ p4dL60WxPJ+claODHgijoPtVLz0SwEyCJLgp35C8Ftuw5fH/R6OJsPPAT8rWXRpVf2 uPO/CPHjB+ctw== 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 v4 13/15] gpio: xgene: Use modern PM macros Date: Thu, 20 Nov 2025 00:33:25 +0800 Message-ID: <20251119163327.16306-14-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119163327.16306-1-jszhang@kernel.org> References: <20251119163327.16306-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 Reviewed-by: Andy Shevchenko --- 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:30 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 836613016F0; Wed, 19 Nov 2025 16:52:21 +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=1763571142; cv=none; b=km/DR44ZxgPV2QJR1Hw5xwf0I/cRXwuezgReu1P1Eu8ihdds0yDtjyl4uDrxHy0q//+2B7tXwnGh3CV/A/xsvW1dI24TLOHrK2vQVfoADA8p0bEHXOTxr5qs4jnEiVu9IYYMWArr2uw/8+7jgvdHqepztekbhs78SoGt+Jo0zXQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763571142; c=relaxed/simple; bh=FNQBeICxR0B/d8AdnKKxHZ3C9oJ646yuBJEylmDxAf4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pHDM9txvp6QkyLsHz80eLA2s21dFHa3H5SZMUZCczEkvQHdGudQXtI6OU3hTj6c1T7d6AUAA4iZLoQtG07m+ZWIvzDmjLkdT/R8XjoWAWQaNdwfIodj7VPRbHqmQQDoCoXeqghC+xmUFxXZWJ3InV76jdUEm//kXLIAgy2qCIms= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Yb49jwwp; 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="Yb49jwwp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3CF00C4CEF5; Wed, 19 Nov 2025 16:52:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763571141; bh=FNQBeICxR0B/d8AdnKKxHZ3C9oJ646yuBJEylmDxAf4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yb49jwwpST2ux8ckZGsg/1gtyw9wN6olufZ6YXSKGipXA4zUgT4HOqZxgQyXlQSIS y2HgB1F9gIgk+aSUcyVhqh8q71p6ghOgKN6730frU+xCfEG+CV/jjbY94dRABK6bVG YOD/gg7DyMuepU9ccr+YLYPczaJNZSCfBM2mwwpXDP22jV6yO0LX+vU3eoDzsIsGO8 pEygm/EcbtvImoW6YCTOxcSl4RG7Z3U69iai6sblaRgpd61mBHEbAqNWTUOiR4o1wL SXl1YKkq3ItBQumWMhuOsNAMAtJxmb8ujlq49WXOOrca3IRXdHRNu6/cm//Kt+7ahn fRREMTcZd1ZGw== 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 v4 14/15] gpio: xilinx: Use modern PM macros Date: Thu, 20 Nov 2025 00:33:26 +0800 Message-ID: <20251119163327.16306-15-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119163327.16306-1-jszhang@kernel.org> References: <20251119163327.16306-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 Reviewed-by: Andy Shevchenko --- 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:30 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 ABE73371DF1; Wed, 19 Nov 2025 16:52:25 +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=1763571145; cv=none; b=p81NLPMX/6Meu8RHnzvynqVOyf5w2EKzvnJv1bjJWIgP6614nxKClYLkEEs6AmTI0EVbQkMSSqJ1UuttWGh1SpjvluqOBAVWfe7biYuVRpPwhl0kGslo8tm6n+mrlxCNOr4/KaoE6+JOB8BA4c4pjSQUvMcWixMRIKoXWI80o40= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763571145; c=relaxed/simple; bh=V41I1DdaKjoguYvIVU3vcsbbLpnEiJ795VwgA1QsjOI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=luP+cRqqCzV38gWEG/+bFegyWgqeJ0y+Lvwb4TDLm0hkpMFstn2mwRYbjCVnK8PuTFKJAO72IJC9cZSDYU2HrqYecYhWXlCU2y+ctm8pQHgLcqbDH7s/ZiBzeSCiEW/WaHOGKzeGEfiPFgIb/rbqw91RRQW+or7VVJ1c/WRr7gQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=X1x+spoC; 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="X1x+spoC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79C07C113D0; Wed, 19 Nov 2025 16:52:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763571145; bh=V41I1DdaKjoguYvIVU3vcsbbLpnEiJ795VwgA1QsjOI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X1x+spoCseQ8luypkccc2zgAdaDOvwmHEdakpVL0NfKN5uROO380pWkKo6zaw/rPH PywBLurv1m5oo41XMhUteOkFUJ9KDrd3cARd8llM+dQqwrYgEgFl686JKf8ge/NX2n qCF/loPK1nvmo3MZkmbCUER1D+k9mV8POEeNbFzdyYo81/FWkVp3MlOCWqWGquI8PH nIaBN4tc7K/F1eWPjk/UDyDISuZjJXieQhEejli8KCPOodwqP3HU0PeAKHwmoYptQ2 1n5BM32Tzfzz/KE14vXkCvUJh2icNHn2FxHLcaWXlYOXMk5FNfrFgQPrWbayvcGs8s o1Dsmkosl66Eg== 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 v4 15/15] gpio: zynq: Use modern PM macros Date: Thu, 20 Nov 2025 00:33:27 +0800 Message-ID: <20251119163327.16306-16-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251119163327.16306-1-jszhang@kernel.org> References: <20251119163327.16306-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 Reviewed-by: Andy Shevchenko --- 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