From nobody Tue Dec 2 01:03:03 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 2C1AD182D0; Mon, 24 Nov 2025 00:39:03 +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=1763944744; cv=none; b=Yc1tjzUu1EM8y+izA/HyqOa0/0oMfilDem074O6VYua/0e+F0/ElgiM9WoK/yMGfYzm6HrgSTh/bUbfj8SYOYCCfdKjJw3DrS1E5lot6N5g7l6HqJrMrCk96D11O80gd4X0DreDvBd0n9mghMZEiN5FGO1BR1FZ26DCexzW2OVA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763944744; c=relaxed/simple; bh=LwiAHc4RwoQe++kQcc8PBK9cT4Y5Hk4joSlyVBAPSm8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hyVeFh/JapXG3YqVRXaC5t48uavkwz9a9f/E+ir8SPx8YTIoKnRiCSKY+M0i9a30Pm88W1JsXBKC6vR3CKxzrKs7VMg+XxihyvSbSudoqPMBCgbGfVae7To/UHOGLxTE7KlSGdXf51iy0pcAP2mNkn+HO1Bs222+7DN5rPoS8VQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GaFZ0Jv3; 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="GaFZ0Jv3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C26AEC19421; Mon, 24 Nov 2025 00:38:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763944743; bh=LwiAHc4RwoQe++kQcc8PBK9cT4Y5Hk4joSlyVBAPSm8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GaFZ0Jv3OhNzCf02ZN/BsrMtFHL9tyaoKn+po0F7OBSdecaQfGxsEZkvM87aKZLIS 6BD7gUC7AhasdQaQKmxH+pZsQel2f+7WwWviGGvifw65CujchUhN4//IeP4ylv0Q/w qsKQ9nmFwG3mw23Gb50vUJ/0eT7xjgpQI5sfkke66MT65JzoNntr8uEleMq0lQ9qBn dkf3yGsGOP8Dg+lOeTWFdD7A4BdB3c9c01f0T8pPMrKS4SlaSMNZJWTmqefFrS7U47 zVxH5G4xoDWevlC8QHustDaoMLHa3rQlXamBcwYuXK1kCuEY9Gl2m8fMbOQIdimf5G X/OK2FFH6rL6Q== 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, Andy Shevchenko Subject: [PATCH v5 01/14] gpio: dwapb: Use modern PM macros Date: Mon, 24 Nov 2025 08:20:52 +0800 Message-ID: <20251124002105.25429-2-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251124002105.25429-1-jszhang@kernel.org> References: <20251124002105.25429-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 01:03:03 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 5526370809; Mon, 24 Nov 2025 00:39:07 +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=1763944748; cv=none; b=f7y3Or3hVSme04IwZo39e5oUAyZw+ZycWendBpyFJCWAfB15gZ5JYnvLAsYysFlt/bvPB6MolczayVeFk1GAHINB5VNTJmojt5eA6SFK2cI6ZQGS7dUF0CtlaBK+NgDWgBcBM/GzfOWsDudBOkRzznPjDQhQ2kXpC4uFR0RlYWU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763944748; c=relaxed/simple; bh=2hkE4qrZTMJx3LKrzCmdn4jDcilUVOmMo1JI2JFIt9M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=B1NAJVHRraY8cwnMRMYb8NfZCi9RABresgEQQTybBzqdP73bGfuEU/lOihMgmIKmxLn1cXB+e2ZcXlyj3oezV6PKs0VknIdJcsY52zhONH3jfXDxBijiGhvlOlYnykEuUFwQHDnqDgFNebbPlYPKbOvwDj7hj5ZRhodGhZSGOCE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gX9BEm0V; 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="gX9BEm0V" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 140B3C113D0; Mon, 24 Nov 2025 00:39:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763944747; bh=2hkE4qrZTMJx3LKrzCmdn4jDcilUVOmMo1JI2JFIt9M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gX9BEm0V2hbEZTdzOHE3SV6ph03SBheYsYdTyWZVuM9MXFg37dRlmXHQcmpCF4vxk 7MqVh6kXbftGVrkDxJrAQ9p8DyuANgbAK37avBppEk9PSlQ2LY7tIfHij8+iAwKsIQ hQoYr6stQ555kinDrJsYeRLWDQcGtetXfeeQRrlaEe6YLdE23B0Xiq5nnroMJdxjDU eRyjqM2NATSTVyRe1c+h63m8ruq19P+wwAazNsXVBgHgDni71DSq+KVmEnH7mHuzE+ Lg848RwYoH4Vf32LlSxkle4Y1EuOJ8ka+GD9F6pJkYKl0dq76roByayYbFsFKL6daN GjBvn7k6Onesw== 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 v5 02/14] gpio: brcmstb: Use modern PM macros Date: Mon, 24 Nov 2025 08:20:53 +0800 Message-ID: <20251124002105.25429-3-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251124002105.25429-1-jszhang@kernel.org> References: <20251124002105.25429-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 01:03:03 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 3976E70809; Mon, 24 Nov 2025 00:39: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=1763944752; cv=none; b=CNvzBXIG5fJ7PgbdJ+fL42FoZADK/rux1AI9+f+HLyr7swtVsuyvBsVvebhya8vA12YhGi5CxCQDtSB6M6P3ErzHJXTvrSNOh/3UBuX7Nk6eympXHcid5WuxfRh1k6avyRea9iwQM0Cn7fIPd1ctHOX+1jq4sBu1mr0wRWOvcIM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763944752; c=relaxed/simple; bh=UkCi6spCoGBukorZ8+mAQyPnpIaXJp83L7Ud7SQYBdU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FiWtcVExFSKvPNID0Epq+0/7VNnqvS55zEpuHDqSvwGFDRTWQHfxFPu//ZKy2BwaeuIKIL1jIqQ5vgJ7NXK0koMs4d0+73ESTCkmgVH3UaLBHky8qddJe/2h+C8nmqzE10StTB5Yn05ZiX/lvESMkEGbBvjeLizxfvbBqd4hB4k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=N3GUd97s; 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="N3GUd97s" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34A8DC116D0; Mon, 24 Nov 2025 00:39:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763944752; bh=UkCi6spCoGBukorZ8+mAQyPnpIaXJp83L7Ud7SQYBdU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N3GUd97s11C65b3B4qczTaFB/BDMk6u89hqkuACWfPDSZ3+08hQ2INkLoJHrLPy0t wasnmNO3N1CwHmTIkXszdhHaE/81lep+7ox6CPjXOuk5Ou8IMZdu1IbVDvUKYgz8oG HenuTddNMXOJ3La6mK0vOeSO94jPeuIZdOKsE+dFY0o8d9PX3E/EtkGm/fFqXtcDe2 4MWqyhZ1Da3wE+HF+gEP82L/BGOFd87sNyDBS7RHLx/gKDRsExDLYezWNfvsCgQKxp mXvwTySfWeIxGcvWH5GGDHyxWixrI5rMgVKSuNlCtHU9uNHh0lKT5vLc/RSx8dTEZx ORfGozdp9b4jQ== 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, Andy Shevchenko Subject: [PATCH v5 03/14] gpio: htc-egpio: Use modern PM macros Date: Mon, 24 Nov 2025 08:20:54 +0800 Message-ID: <20251124002105.25429-4-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251124002105.25429-1-jszhang@kernel.org> References: <20251124002105.25429-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 01:03:03 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 7E45D13AD26; Mon, 24 Nov 2025 00:39: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=1763944756; cv=none; b=fc4flXfUzu7yijhymBR6Dy3+nGZFLibS4NH5zRUZgpNnMoCpFr/HYjzipYczlZ8wH0A+eqz4OQeLDm/xiowogAPa6mkxVcXHXVU1nu42BdqnFq6UgotGobEVZK8nHaVwLoTAOwXDMdbMU9Q2llqybk9f5962xaMU7tkqmPobxb8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763944756; c=relaxed/simple; bh=s7gmAkXYo3rQVJ8An2wM329PekTsogFXN/YDoZN5CkM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gQXQ5ifRme6bsqZrokYwow3TE9uhc8aaUI/vbp7MXvcjocysGRzc9E3lzNu7CHBDKwIqzItRgC9iMiAnTrFLQ72ujRmT6m8imXKLyXYz9Y6fZDiwCmddRVQsPUkaT2frqG7EZJKsJELpUiX/iv/LQi3SUYgy1avhkMGnb9Ed2dE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gsp4l5pF; 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="gsp4l5pF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7ADC5C116D0; Mon, 24 Nov 2025 00:39:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763944756; bh=s7gmAkXYo3rQVJ8An2wM329PekTsogFXN/YDoZN5CkM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gsp4l5pFGdb/D2rE2OGCTtQaBfl2Lker+yqU7k05DSOe8wJuIA4nblIhiGJcmP1MK 4OxJWOiugs9ITt1xm/xUBxX3JwS/DvFjTjFdrodWGO3gn5/9Hu9eeGZtTDWqeCZLtM vPTG/owhUQ5C/aBe0Ell8AzSAvHB6SEq4ocur4Z5ahy+vJQC9+ktATJ85i5Khr2Hdo TT7rDY3zwG/JVS/cCaFd4dYpu5xzwar5qQRTmoGuDyC3rhkPn9blfLKGNrzEyoNKSj qWteCNTQRp/xx35OOutNoFN8wgk29z6eOWPLNwd5NuNNvDOz7VC0LkCKU/Tu5/bdXT n0ZZX3piLTErQ== 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, Andy Shevchenko Subject: [PATCH v5 04/14] gpio: pl061: Use modern PM macros Date: Mon, 24 Nov 2025 08:20:55 +0800 Message-ID: <20251124002105.25429-5-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251124002105.25429-1-jszhang@kernel.org> References: <20251124002105.25429-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 01:03:03 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 13EBE7E792; Mon, 24 Nov 2025 00:39: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=1763944761; cv=none; b=P2Y2Brrp0Zdj6ubzgEIet++GBmv4hGDuzgbJAV0aZ608PfZgXSAZ0nQlJCQqHBkfW/BpMxZ7m23TPWT8E2vbtMeXRTRy/k/N1pMM4l7UbUNrT9Jue6zV9dNh8fwZAnZZvxBvgpyWxLvzpZ2bYBFuMM/3ghOr9Rhcfb9viFat4uA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763944761; c=relaxed/simple; bh=HnR+WaJN4+VRnElA/PD+oRig9aQxOxkPp2zyllWs4o8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=twGbnkTw8N2MgOcUoT66BScuN8cV0CvDoCdLswoTXYSpHnuKafjdJONHwCzkqF13z2LJwevSzxQQbf84x6qOW6D3bXANOn07+75Vc2mAQDiklGkZ18rB9C9Sw0rkv01dGd+TIPGJx7an0XXoOGWpV2ekzTjgi9zobT0Mi2PCk1w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UZfih/cc; 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="UZfih/cc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C085FC113D0; Mon, 24 Nov 2025 00:39:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763944760; bh=HnR+WaJN4+VRnElA/PD+oRig9aQxOxkPp2zyllWs4o8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UZfih/ccyLXl61wi/j3VfgOcANTfI7aD3cAzu8wo+bPTu0Wl7jwjRUB8TInvdibOU MHxzvw1yJlT2nIYXK+9YnehjQMKk7fX6DHR1S6vxuuFj3gw9LOSdWssonU0S2OVloT HYJZ9uPQygTHrsXatnWREA0QtzZIotG5Q8pkyPowOM6m6K34aSM9iRVBWOkL3B3kdH HeTwmfV2xykSS9FhPIykT2uKF5y8k0yOWRGZOe+nc/0a+iC986agvz+CmVLyJJucIg L5VoDas8tUzkiH3Fo4vn7yZ5PSc5/zkUKqAcZHlzs7M9oIwDD3kqKHeuQVYHcmSY3V 0nTcKD2dh1sNw== 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, Andy Shevchenko Subject: [PATCH v5 05/14] gpio: ml-ioh: Use modern PM macros Date: Mon, 24 Nov 2025 08:20:56 +0800 Message-ID: <20251124002105.25429-6-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251124002105.25429-1-jszhang@kernel.org> References: <20251124002105.25429-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 01:03:03 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 230AB153598; Mon, 24 Nov 2025 00:39: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=1763944765; cv=none; b=DeN3iCnHEA8roP/uvzYBqgl0Hn5sJF1kaKCA5tAwVTLys+PZpkNYfuq0gL6xNH11RDaV+8aMhII4f1Mx47tDfWoI3H4m+NRl17zeW5/V1uOK2zFtNk/ypWnlzxh/1bnIx+J1FQV5ZlAA+kXHGT5tWdk83UV7Bgt44H2hNmBDy88= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763944765; c=relaxed/simple; bh=1DVXPtxdqGsGdWZ+RiugkVEmTnGiv1c2Unvq2pfYDBU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qhixq42O6HEX3gUl6gnB0QN9zMFD4d7Ka/IvhMoOKmMQhUqn7eKK89tsoiD1yPaZJom/tqGCtolWf32SMMYSLr99hUdw1Zg7x4/lBdJAvT2e1xPn3FZyeEb7GPMHJKq2H6e3mHtI0eIKxdSAE5A8rgF8+w/xui16XH4tsaPxTiY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PrGkBTCh; 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="PrGkBTCh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 111EBC116D0; Mon, 24 Nov 2025 00:39:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763944765; bh=1DVXPtxdqGsGdWZ+RiugkVEmTnGiv1c2Unvq2pfYDBU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PrGkBTChhgq3q5vIkTgzD0Z3MaRQOaCWoyCz/eapHuKz1KS3I42wM0yTecZzIbkCV aLRAoByPnS9CqjfI7pWLk5IHlw5POIPkXRXEoX3X1bdfJ7EX3Y3l6SNqsyOgAr9H/r /++wm0dEpTDqfVIC/tjkIsxlXol4/abqTBX1lKAJVFE4Xou9nq6eM9JL3Fc7oRoDG4 9T0jwLl1I1WRgDr7oNea7f6/2OHLEDnU2KdfUNR4CIDiMVFHQxk+Ijt8sfxyNRrSQL 2HCkhIdpcsvO1j1qzllTG7x3fZrwiXD83fY1ZVK5QE39mveWukecGlqTEM+LwLrnD1 w6XE9YbzzpJVg== 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, Andy Shevchenko Subject: [PATCH v5 06/14] gpio: mlxbf2: Use modern PM macros Date: Mon, 24 Nov 2025 08:20:57 +0800 Message-ID: <20251124002105.25429-7-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251124002105.25429-1-jszhang@kernel.org> References: <20251124002105.25429-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 01:03:03 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 C980F1C84BB; Mon, 24 Nov 2025 00:39: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=1763944769; cv=none; b=OdeKnk4ZH4L8YQ9DTcdCTRiIpRPP1/mfs/mWy51DKm56gE0E39Bi9XCZXKvA03ULFOZPerPXMyqsMpC8oJkpt05+yR7fgJ41P2tH7kIviVM7lhbrq+rDNk7nhfCVLIBkMkYO40vA1Zc2g+vpbn6GOZfntG0o1OWv6HBRYLoJhqc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763944769; c=relaxed/simple; bh=WC2+M04mYIr7o/NCr0cavY7IkNFLvwHDNt3oNg9JZgo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Kl3EHgzAKexZm4PsQ0iS0iyXhWEhlaDb+0b6qE2V1lYD6AUO+lAclEcvQmKTC2TLvvFsCGf8tAOYA0s6G1BdjVaKxdUFwp+3Gxi6BsklDveIuqNun/88GgyDFNd4xI79Z+ii6XKVZ3wy6lKgOBUuq2ZK+COeA4+c9CXx5Ml7jeE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=injHsrPy; 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="injHsrPy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CB34C113D0; Mon, 24 Nov 2025 00:39:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763944769; bh=WC2+M04mYIr7o/NCr0cavY7IkNFLvwHDNt3oNg9JZgo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=injHsrPyUjQPVCB/XUK9TR/rVyA96b5LN3X2gMrlqfvQ4jgwmo8a59bmZDQ0z2qqY ZONmeNhAyvEp8+tgEoyXatj19NpSmsrZguNCw9Wzl3KxtyuETNxXdC1iXGcZLWv7rY yb5/IhB0CjUlq0GIaqcEm51vbJOoxxBIx+QffQHC0JRLYn5YpHyyqV7fqFd+nasIBg NNESW2mVLwHrD9jzIpyLvvw9/DXcVrV0ycqurE/HIurN+gM1UUnc/RyXziMlBtiPiZ kLfliUxCLghzNfs1jG2z87gJpfNyFWAQaEsPkhJfHLoxMqhCXwQJd/VGF2p4WS/l5t T59JfPRgEPMrQ== 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, Andy Shevchenko Subject: [PATCH v5 07/14] gpio: msc313: Use modern PM macros Date: Mon, 24 Nov 2025 08:20:58 +0800 Message-ID: <20251124002105.25429-8-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251124002105.25429-1-jszhang@kernel.org> References: <20251124002105.25429-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 01:03:03 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 DE41678F2F; Mon, 24 Nov 2025 00:39:33 +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=1763944774; cv=none; b=n4MjhEJQut6sgxY6pl+f4HjDiRKlYSP09D8ghInYhCnybm0YQM1L3SW+YcJ+QnJ1dfeKx5SlPGmbJ2dowyS+U5BnJ4OfEoUbEWMUxuBW87jwtUtgaWIXXwZD/Gz6gIWWqpH/8UHtrlu3EoX7HssZPelY9qPUl2T4+CQAF/MtOEo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763944774; c=relaxed/simple; bh=kv6Bgi1yHxmGklUE6nerjA6CCGgjdEkA/o1x5keS5d8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=K1+JCGYed6uXoQ9ldMKAHO2HgAb7Rwi7QU7eAst7Xx3+5U+Rxtzh/4oiHozpSguOHv3F8rUXi9FQjmm41GspTM7y2TIbairdOJ4wPi1aojjihqTRjKKX5DfKaa4s2NvNIiizXQKi0HVylj95fG6kjwz9xkzaryQ/bZH3BXMSZDs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=s/krqGe0; 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="s/krqGe0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1D09C16AAE; Mon, 24 Nov 2025 00:39:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763944773; bh=kv6Bgi1yHxmGklUE6nerjA6CCGgjdEkA/o1x5keS5d8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s/krqGe0C/3dVgHPgzKZTe9NmR3K+fYdHcNmadEUxWvbr1oEL6bwTSPhgPhdGL38v OiYsZhWKtpCTvJfHlnfNVNi5KsnPZ7IbJ7aHApScsgj+0AR47MAxv6ZuGTZbLJMe5b EpJChbkTKtzgZID60bqSRJU687UietN7qBk1H8bRr2NDNyNgRJL3uCG33VD7sFn0pF 0gOtoM0g5s0aBhTk1+4vc/0/FXtp7iNoZA0qsyUf8y6n7ft+KomRySc0Rq7sfOSxXB Icv30oTHAvObuLWKTAVfvdlT77xwv2gAmLbnmm2Q10Y6ln0+r72iEFu7bLqSBeFARz lWaWByG3eY0sw== 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, Andy Shevchenko Subject: [PATCH v5 08/14] gpio: omap: Use modern PM macros Date: Mon, 24 Nov 2025 08:20:59 +0800 Message-ID: <20251124002105.25429-9-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251124002105.25429-1-jszhang@kernel.org> References: <20251124002105.25429-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 01:03:03 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 4419018C031; Mon, 24 Nov 2025 00:39:37 +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=1763944778; cv=none; b=f+VJFmxYCboQmuXaa7sL6TYDrztJphupaC6IRTJUzCpLoOZAs1wH9cnIfTBarUnFiPPQIPgG4OundQyAe7VYb1oBrA7Czb2mNOA7Sc2qH/SWjDjvuuAaBPeMktgdHPDTe3s7HTk2VV6I4bDWg0LVk+6w/wL1psq+cihxF3o9GSs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763944778; c=relaxed/simple; bh=VFpeFUeuZPRq3xz5ZU6irmKj0qIOMxJXU3oErtjJBYY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XeP5EveApG9rgttolcjfviyB4stYkyWrDXjzfOP8EFnt3xy8Qgt/wbjteYuNjU3xQ/lJNE7seOz5fKI+7Lighuu357c2EmIWo4fHMIOetSliL94Vm1qeEYWkhBNqnzDSQU8bk2AiQw4xTJYMTe/1M9tAwrg99zSkuvrfpf8jjZo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vDER0lPG; 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="vDER0lPG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7791C113D0; Mon, 24 Nov 2025 00:39:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763944777; bh=VFpeFUeuZPRq3xz5ZU6irmKj0qIOMxJXU3oErtjJBYY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vDER0lPGrahdM0sac4igfjicgOCtRW3g8DAYfwRbYPuGrNWoLXxYJMPvfINap0AYK GAv45o6Bm04QEw4/QGYpzbSEkLOjhv8L9mOPHRhmUkNef5Dnmog76PTHYx7hsxm9bj PReW/f/H/C21no6///CAuu4U7aBkVjdNAcZfr82EVe7mNDhQKr4LbMiqB78l4ITeI+ oHTmAioq5JRMWX3e0U3gMcSY4yqe9hVAvsQ288TLbNjVvUkX1/6TRKepm4pTOpVJl5 P9Ku14XDBfukxOtFaMgGK8h+28h0sWuiCaLT82Psd4WNtcM/HDyL0yoMsJqjW171SU /IrRdaY9V174g== 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, Andy Shevchenko Subject: [PATCH v5 09/14] gpio: pch: Use modern PM macros Date: Mon, 24 Nov 2025 08:21:00 +0800 Message-ID: <20251124002105.25429-10-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251124002105.25429-1-jszhang@kernel.org> References: <20251124002105.25429-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 01:03:03 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 65AC686359; Mon, 24 Nov 2025 00:39: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=1763944782; cv=none; b=BdaNQZyn1uKH7GT+66JK74NEnPRwKttDdcbEK0IayPQdqQ1zIrQwEeR0voY1yDInPObLiY9MkWv5AAOZ4E0vibc8K6CEVRXbJcpqmupt6EW+1gl+Q/at5xMF5GWt5DvIQ83DzBfd6ZoRuh8My20Waa8iEmQ7B9kgVRoOWYM9u0I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763944782; c=relaxed/simple; bh=m+0s3zR3Jimd2DLICKq/0mKXn1YtbWJGpOHLKqx4PmE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HYQXvT9Xqg5fzYYqHisvh8RUimOVv8WryvnJO8S/E4p/39Xw1sEVV3NrWO2uqxU59STsOhK+srnG7b+HHNXd62ENybRX2RhQfLGW4bAo2soKzHc/6IAqh9lsa7+Rf4rHHPlonCRNxMyjvsjI2GC3akklaRDREp5pDFAYe4YjkhE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rFlaZeef; 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="rFlaZeef" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38862C19421; Mon, 24 Nov 2025 00:39:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763944781; bh=m+0s3zR3Jimd2DLICKq/0mKXn1YtbWJGpOHLKqx4PmE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rFlaZeef+FfC49uYvW+DiJPLHwNO1nfTB7xhSDgl8bGejLmyjtK0dTNE8jl1hmNw+ aleoV1tCfvhmyHqeTYmoCnL+mMujbz7LF2rET4bcPi8J4UJnFMy52UIyN0mKN8V0P1 ZB4TJb1zy7FNZU4v8l8VopT4m3SizwjwJzcGflfNGcpQ9QtcsWaMBXMxvvjhOB48Sj w3HxNIXMhZ+Q38BSFLl3f+B3ktYSbANwMQIzQzrkHOnuPbd5eHn5ofwwhLIcwLUrts nCFQ2+Hh+OQ+kI4NXzKHDoRFElmy93dOXeGLJbB46xOw/Qq6ap2v7FigDLGGtH96iS N8d4DwOLyG1rw== 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 v5 10/14] gpio: tqmx86: Use modern PM macros Date: Mon, 24 Nov 2025 08:21:01 +0800 Message-ID: <20251124002105.25429-11-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251124002105.25429-1-jszhang@kernel.org> References: <20251124002105.25429-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..eedfc0e371e3 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_ptr(&tqmx86_gpio_dev_pm_ops), }, .probe =3D tqmx86_gpio_probe, }; --=20 2.51.0 From nobody Tue Dec 2 01:03:03 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 5B27178F2F; Mon, 24 Nov 2025 00:39: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=1763944786; cv=none; b=bjrc9sg6yGb0oQxoZ5H6KeQgsxY0LX1B5rgBv2zMkpmLpdLKrDfeVxFRsOunfTM0nVJrZJ90qBvnhVJVrygfHcvSWubObt8W85PeVeJiL6/xrHOtaWRa3SSHuJtdLe17vlsRFKDLKiVIFR04LJMfvVOxKaTrRTwKwRmSfudi6rg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763944786; c=relaxed/simple; bh=bsGFhUZVxTm6hQngmTw6wULWw8zijeU06s2+x/P0rs4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LuSAncfdpD9EbEsEUxqA3xXpm3JVYkM+4RBszUs7OZUJKcw9oI4M1Oq6JCznmwJ1AQlwVrI1YZhnJAPNhPX1PpbnWJz1fdZ/xdnXOSxIM7AneC8FroyrGnSLaez0NSLd0cF9+bJ+6hHEMIthjB8/r3ja3GwFm9SfuZN1mjWFPnQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EQQTFBnb; 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="EQQTFBnb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57DC0C116D0; Mon, 24 Nov 2025 00:39:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763944786; bh=bsGFhUZVxTm6hQngmTw6wULWw8zijeU06s2+x/P0rs4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EQQTFBnbLFdJAELaRIUeFPPW9vl9N6+/J6l/c0bnqtNlWSnl/g7TX12a3BD+g1Bea 6y10Trb4s7EjRD5h5NNlSDWxzZCqy90CtPgmWLynxJPfpIgiQuD47s5YgrSeHWlEXj S03+xEfLmaJmoloekQoc+cFDIjhQKMp7Njz9EE+XTNi5pRD3dEvTvAifclWSDzWnF5 vmKkKEEdrELZuBEdUYa6JtMuSLqJ25nP0p85amSdau4dTwyqkjFV9fBpIf0Pf/trgW Xsk0YV58gIh8oxWqVAPkp+uXzwyoPP9MsrblEZOoodUKhtTr97uSlfBbzUbqOJf1Vr /squkNdyIxKpA== 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, Andy Shevchenko Subject: [PATCH v5 11/14] gpio: uniphier: Use modern PM macros Date: Mon, 24 Nov 2025 08:21:02 +0800 Message-ID: <20251124002105.25429-12-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251124002105.25429-1-jszhang@kernel.org> References: <20251124002105.25429-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 01:03:03 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 9ED0519DF66; Mon, 24 Nov 2025 00:39:50 +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=1763944790; cv=none; b=dGDa576y9MhwnqzbRzgInM0uxyFVrqlBM6E+8R1J4nKOdj7tSAlhwy6uMNlQGRd/toRK8keH3myOMCgPzE/uMCqeNI4zy+urolf9zsJ3OLqJtc/IfU2MR+PkpGfcQ82slEoZWVeuB+qKgCKz/MR0ooiVHQ0OtEheiNaNXu0RkyY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763944790; c=relaxed/simple; bh=wdqGkxAtebmF3ixvQNxHJZ8CpzKZyE2eFem6mVWFHIY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YQbQjTKlYm4yDGtkWObxMXyQSMYxQDEWuMyx3ueGi8oaZ56LB9EKnYKo9/CTD4/EVMiJlu9SwwDj0q8+BXhOYQtY2tQsP9WzjJylJPbmMtxGM+tRSTYAOpvnxl87ppQHejibWPrxc4Z3AyokaNTQ71f7igYZSFPfG9+RY0pVgUw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MwHaorhp; 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="MwHaorhp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E0EBC16AAE; Mon, 24 Nov 2025 00:39:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763944790; bh=wdqGkxAtebmF3ixvQNxHJZ8CpzKZyE2eFem6mVWFHIY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MwHaorhp7K7GKU6bv7B8rxnADJ4a5Mzzpqy2pmZqVKgEzhikCrgANX4pW/TeHXApV W8/MdexOuhUCQEddYOVDijLQlu8Ohm/Gsn7/mwxo2775F2TgKIWl69YsX2pE0dFuq/ kkkFyhWVl3gFr3pGRZfTQJLDGJOjTAVwRq8XCnTOgbJPihyc1ccHBoDNF2S39e1LPN d+rchMf/nOyr7efWB9ePvJeR9qcLKc6vf9K8IoEZqdsPBhxogMlw0mpP5MSnHI7Xnq QxuGRcQjHGYXZ/KBBobJIHoViuV4BSt+jVsGgg+/xUe0GU+2lti+96SRSNXJ/XjJe/ SJZxI5KwzefSA== 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, Andy Shevchenko Subject: [PATCH v5 12/14] gpio: xgene: Use modern PM macros Date: Mon, 24 Nov 2025 08:21:03 +0800 Message-ID: <20251124002105.25429-13-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251124002105.25429-1-jszhang@kernel.org> References: <20251124002105.25429-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 01:03:03 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 67B9D19F41C; Mon, 24 Nov 2025 00:39: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=1763944795; cv=none; b=WYmBy7DrOp12xbxEX5oOyQXoXzzIvNYD7wLlF6u+dOKbkrkk7rASyIlBKHWJ0wF6b76h7Bjap0i2iWDqMYSldy0u91Vks6aJOebrWHmAGuY2Uw8VkeHZRaQHSV1xz2C1Efh5mWDTxnny3InieLf3Q831ifnFlvQ9bh4fTDOB5CU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763944795; c=relaxed/simple; bh=tmbVFre4tZko40JOclR4P87MLs3EhlcBKGfS24+8a8A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Xpd0EoUZCyqpmpIb0F11K9IJRDIoA2SEmhj8lfxAGVbZ0hh7/wrVoQscIqt+cOOgrGhpd9ygwE8qNgtPEZyKkgm4AC+tCUmCsIXbowEIc/aodNm0DVRV6GX7n46VCNG/igsUPfM9NlWE8l1kZAtirBcmzCc6V16GpOD9o8+FjoE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LRi61CRD; 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="LRi61CRD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2D1CC116D0; Mon, 24 Nov 2025 00:39:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763944794; bh=tmbVFre4tZko40JOclR4P87MLs3EhlcBKGfS24+8a8A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LRi61CRDpXmyx/baVYTbnK5OEiudN0xVJJDNNoyZKSU/YtCj6emPcD52zDJY3C2J9 CXepScvN7orZLoH/8iAK9VDp+PBIIwLuXuxUAUJLvOoD2MomNhQ29Ct0zXG9/TWywH UDR0k6TG+uRH58G/4dMgRgelN/GHN8bkbuir1MjFOpGGKlf8TLwtZOP3f2yYR0s0y8 4G+JvxMO450itzVCuM+oRr6jBIpfJimTQheAg09iwbfI1l2sssUmIAjXSm3RV0BWMv tNP44McEGSXBiDIT5FUCC5mEBS9uZHlra1Fi+apQRE7hYzeRkNi06aSJ++d/7UQvia YkNiJUWTPfAGg== 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, Andy Shevchenko Subject: [PATCH v5 13/14] gpio: xilinx: Use modern PM macros Date: Mon, 24 Nov 2025 08:21:04 +0800 Message-ID: <20251124002105.25429-14-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251124002105.25429-1-jszhang@kernel.org> References: <20251124002105.25429-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 01:03:03 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 91DBC14A60F; Mon, 24 Nov 2025 00:39: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=1763944799; cv=none; b=hRSxER8sbvg0DYNWtH2u7vJT+hA0rdimaDv5emtoCpRTEyyh7xpQ0/4Kw041zTJQo0XDOLqglyABNU/ASn+cLyZGqp8eLdMiE9mTpowE6Gvzgk55/d+KQ8p76YJzXCL4S1Zucl5aC9TFIObjUz3P5mBUI/gn9Lx7ueDtxODf1Y8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763944799; c=relaxed/simple; bh=59dk9hx3CmiQzssyFO/uVMRkm/znXuNpXQsoz9Ju1v4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=m+yXyCR07K0m/SUmTIQFWw9LXUJ7Rgl3gkQfdCCKQ/1AnKeZDBfBfskWNNzjcIcx965iDMufbFd+KqVdtlHtwHwA7nopGx3wfdvx7oHOZMW1dzoF57NOlx99qqSU5+GoYb/gUa2WFqX2/EXViSaI5ocKqjl/y/qTO/kB3C2AgZc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eUur5oNj; 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="eUur5oNj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33965C16AAE; Mon, 24 Nov 2025 00:39:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763944799; bh=59dk9hx3CmiQzssyFO/uVMRkm/znXuNpXQsoz9Ju1v4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eUur5oNjmxtcf4hxClFd72vx7xSlcJlWZv3a2cGpXd9ZweM8caP4vuTHt26Dkk1ST l03zsuZWGwyVEnWhfgao0jFv9kQb9FUFsWQ6xOFctSu8wQN09fXB2fCaPVlQ4dD6es OEQCeIVpDF4ZlpQTb3GLdF7oI0Jjbea/HX36T5B8KqVeLkJw2DoT6NVZ9IymvrUIAF vpFAvQOiawC81th0Qybi0jXxL0Y4B+acgJw+8fY0twpctgmgJ0Yen1t/7rtpSyoxv4 KgI260pZ0BC7R0mizvQODUG2XaIM207DFKEhkISDdTvWVFxqLywTTx8MLXANZX/5rw 6F7tIhuOWPzhA== 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, Andy Shevchenko Subject: [PATCH v5 14/14] gpio: zynq: Use modern PM macros Date: Mon, 24 Nov 2025 08:21:05 +0800 Message-ID: <20251124002105.25429-15-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251124002105.25429-1-jszhang@kernel.org> References: <20251124002105.25429-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