From nobody Tue Dec 2 02:52:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3E0C2F0692; Tue, 18 Nov 2025 00:50: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=1763427030; cv=none; b=qn2tHUIiWb+xZVNh91BWdkUA9F0IGyQRp+Mj1d7R1ZqH7Zy8a+CMijdtC2Wjo3S4y0OGQ0IBR7xPtKSR2FxSNvfbCL/pHwqructSyoAZQY2EaSublPJCU0HSeNknSkSoSZopWdI3O+P1Q60WafCmJDh5ZcgPzc6b+58FxVOg1J4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763427030; c=relaxed/simple; bh=s62CC9yA6KsObKdsvKU0akXJBf9cG4hbHq+2JH56Xmw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZZhw2HwkRlbHtJv4qWBcWNixL1NaNsYFUNXY+SSViT36P9mFgUAo5Ozl4hWOn247jQNKcCQ19gvq4Bj7bpdo7R88hruiL8zcl1HV+dndDb0VmEIOmvRtxrD2CVK3SLmb/Npc+5Yu1IIHAjhTE0K5wPaMlA2CNKaoXXBJ5s8zYDo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=aBjJ/TF+; 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="aBjJ/TF+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82D63C2BCB1; Tue, 18 Nov 2025 00:50:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763427029; bh=s62CC9yA6KsObKdsvKU0akXJBf9cG4hbHq+2JH56Xmw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aBjJ/TF+LqtQIiSOfFSGwXXyr1M+MXLvN16gWHBRk3JjNJ5oxtm0lKdTha5LzubUz Mvo0EXbaH9+K2EFwPLiWuC4HdkOOSlWlOeMNj+LM095+MqtYqWuGRJRhznG1t2ms/L OdI3mtQcWNNApvikzHI0HHatU3xUj6TZhmOMO4ydxJ2O4rzGnVHgB1g3cbLwvpK4PO 6VOvylqhPfmAnPGvWLjK06VSpIu8twQAs7tY1GhdC+zXXT298E5ni5MWn6SjIMQABl e3cXVX31G/ys0LwMcXzVy+qj23meIKdiftxLgh92xthGovefcC3sun+yiuNnXHK12k OFzgMHszsw9qw== 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 v2 01/15] gpio: dwapb: Use modern PM macros Date: Tue, 18 Nov 2025 08:32:15 +0800 Message-ID: <20251118003229.26636-2-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251118003229.26636-1-jszhang@kernel.org> References: <20251118003229.26636-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 dwapb_context structure is always embedded into struct dwapb_gpio_port to simplify code. Sure this brings a tiny 36 bytes data overhead for !CONFIG_PM_SLEP. After greping the arm/arm64/riscv dts dir, the max port number is 6, the berlin2q soc families, so this means current we have wasted 216 bytes memory which is trivial compared to the system memory. Signed-off-by: Jisheng Zhang Acked-by: Linus Walleij --- drivers/gpio/gpio-dwapb.c | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c index b42ff46d292b..a431bea959ed 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 + struct dwapb_context ctx; unsigned int idx; }; =20 @@ -363,12 +359,11 @@ static int dwapb_irq_set_type(struct irq_data *d, u32= type) 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); struct dwapb_gpio *gpio =3D to_dwapb_gpio(gc); - struct dwapb_context *ctx =3D gpio->ports[0].ctx; + struct dwapb_context *ctx =3D &gpio->ports[0].ctx; irq_hw_number_t bit =3D irqd_to_hwirq(d); =20 if (enable) @@ -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, }; @@ -515,12 +507,6 @@ static int dwapb_gpio_add_port(struct dwapb_gpio *gpio, port->gpio =3D gpio; port->idx =3D pp->idx; =20 -#ifdef CONFIG_PM_SLEEP - port->ctx =3D devm_kzalloc(gpio->dev, sizeof(*port->ctx), GFP_KERNEL); - if (!port->ctx) - return -ENOMEM; -#endif - dat =3D gpio->regs + GPIO_EXT_PORTA + pp->idx * GPIO_EXT_PORT_STRIDE; set =3D gpio->regs + GPIO_SWPORTA_DR + pp->idx * GPIO_SWPORT_DR_STRIDE; dirout =3D gpio->regs + GPIO_SWPORTA_DDR + pp->idx * GPIO_SWPORT_DDR_STRI= DE; @@ -759,7 +745,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); @@ -770,7 +755,7 @@ static int dwapb_gpio_suspend(struct device *dev) for (i =3D 0; i < gpio->nr_ports; i++) { unsigned int offset; unsigned int idx =3D gpio->ports[i].idx; - struct dwapb_context *ctx =3D gpio->ports[i].ctx; + struct dwapb_context *ctx =3D &gpio->ports[i].ctx; =20 offset =3D GPIO_SWPORTA_DDR + idx * GPIO_SWPORT_DDR_STRIDE; ctx->dir =3D dwapb_read(gpio, offset); @@ -818,7 +803,7 @@ static int dwapb_gpio_resume(struct device *dev) for (i =3D 0; i < gpio->nr_ports; i++) { unsigned int offset; unsigned int idx =3D gpio->ports[i].idx; - struct dwapb_context *ctx =3D gpio->ports[i].ctx; + struct dwapb_context *ctx =3D &gpio->ports[i].ctx; =20 offset =3D GPIO_SWPORTA_DR + idx * GPIO_SWPORT_DR_STRIDE; dwapb_write(gpio, offset, ctx->data); @@ -844,15 +829,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:52:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 417541CEAC2; Tue, 18 Nov 2025 00:50:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763427036; cv=none; b=VZb/DyE3DANKLUJW2fJXQF4q+QW6ZgoegFZ9mhLVxVyuRXlgtvYR0G4hr3VlzbuFUbEZooK4E33+OBAlrEoFox0d3vXXO4cdPqCjq2TQNP8RreS3wd/OUZVVIZTxftPWSWzkoTLjUOLIaxVlvhSsneZjF9z0fFdDwhO1YqNvSAY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763427036; c=relaxed/simple; bh=qf5wQxbsrWU7owdm60ld7iye66QKm8BVRnc7uaj4vZM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=A2lwUny6i1ZqXfmvnbvEoTMRH+Fyf2hGCjplYc5mj1YDXSMcMLW4+hvRi2MnWTJPSF49Ic094Quh+JTEEVAsdIJMVofBoMReDm3ENmNoRixDg/fGSPiYQNsG+cda3nvTUmakgn7Zid/tDOaEuU+hK2DkVBcjz0I+QeopCzXqEuQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=b1rWVBxF; 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="b1rWVBxF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EABF9C113D0; Tue, 18 Nov 2025 00:50:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763427035; bh=qf5wQxbsrWU7owdm60ld7iye66QKm8BVRnc7uaj4vZM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b1rWVBxF3PxBcDRtHZ/3/AuhwvMeHPLjKlvaFc06Xhw/3v4oA3BP9Jbs9UQxkvFWp fPLHRgMqKDtRpAZWUhHdgLyPy+wMUcRtaMOOBf4p2s6ObYBkQ3Tbei1oDwVn1PXfr7 NQntMdcnn62DtpfXoXoFgSM04unvsoBpQrlHtmo7r++sG1ipw1JqQQc3H1MyxfOLc3 KDy0V6HA88aux18B58ZgbXaT3cUQ1rUfHzwWsApJLKrKvegt3sEG4MM19spIvoHi9d b5R+7Zw5+NvT2uMFF8JIYO8OQWsNryXTmXdMo3bbRoBiH/lysMwa6F1T3jkDuNQ+C8 dKMGwakpuRYXA== 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 v2 02/15] gpio: brcmstb: Use modern PM macros Date: Tue, 18 Nov 2025 08:32:16 +0800 Message-ID: <20251118003229.26636-3-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251118003229.26636-1-jszhang@kernel.org> References: <20251118003229.26636-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 Acked-by: Linus Walleij Reviewed-by: Florian Fainelli --- 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:52:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5133B1CEAC2; Tue, 18 Nov 2025 00:50:41 +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=1763427041; cv=none; b=kUVRswxTIM7tNpS5V5KCz0VawnuD9ZgHq/x3EhBTtYoAXxBVa6YyAbX9pS/2Dj/53yeaBOoB/oc4J+Pygmv2RaAvujNtkguCaIpu6OhoMNU+GvkbhBQqBSyAm3Qw+AiEUdA5iMU/KoTqcB0UvKy0SZq/687z5+prXB0PbN6cVMg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763427041; c=relaxed/simple; bh=OVwscke6AS/yY6+mwMooEm5bzib2d1Ajnfy9ccf7uIk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=I80HD/1GuBlQ44niynkfddf4UXCFdizu5c4m65+KdSDeA161pe68mV7K8WZh8zEXwXfJbVbhlL7xUyR7oxy8b31cAs2PYpanTWciRj/Hokt6jdW7T4uYZAgylT9VU9hja6oJ9r3nLNYyoRj0BxdBRybLne6r359r0Y6PqpOJ1ug= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CV+U92En; 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="CV+U92En" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C42EC2BCAF; Tue, 18 Nov 2025 00:50:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763427040; bh=OVwscke6AS/yY6+mwMooEm5bzib2d1Ajnfy9ccf7uIk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CV+U92EnywdL/a+b/oSqwJualpYLKvndgx1EtxX3GTHnGGJSe10i9EDiyOgc61dMq ++V7QG6LWLGHl4/8WIt1MnN2klMrF0obOGsYeIIrowFHTtoAc3BChQJ6OYgR3l82L/ olrWwYoofOfDTb9EfVD55bBHnNtFZAPHIsYOrFjUBXSAQc+JaBeZXxY7r1vDFCKA+t sW+JbH83FMhCy9SekqDoUJRGI31htBjKld/OflC5SLkC1wkJXtHmx6CYaS+aKoguBF 9hAypHa5x53Ex7v6qq1i4tN/yyhnBdIfNqgnir93kqZ1H+00otpolPhHTedOaA4vJL QdbTSIqRw3eeQ== 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 v2 03/15] gpio: htc-egpio: Use modern PM macros Date: Tue, 18 Nov 2025 08:32:17 +0800 Message-ID: <20251118003229.26636-4-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251118003229.26636-1-jszhang@kernel.org> References: <20251118003229.26636-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Jisheng Zhang Acked-by: Linus Walleij --- drivers/gpio/gpio-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:52:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9DEDE944F; Tue, 18 Nov 2025 00:50: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=1763427046; cv=none; b=mojbFX5OtR9rUVWS+LkhRbpVKL71dnoTn/st/ZUc22CCn1Pk3Q/SXJhE761Ekj08HJLn4+taRfE4bwpbiPpy2mIe2MvOfkUjVGDyRb8Y2uBbs8UMYre7G44iaARlIiuQUlCwttl/YRlcgYFH+K3jo46kRfB+NrvGPbYmsSq+twI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763427046; c=relaxed/simple; bh=iS5RSX5kssNbD8Tb7keOKotIOZ6qJnsVQ/Lih7t17O0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZAWbIoK/TmJaGR3qEphZE0myV7vzJ4026VK/D1ERfc0rV+CKO+kxNhpPjW950/4SB+EqyxTiJWZo9QnXrDc/RInflhRdkDtnm1eZOX0gHdVrqS7/tXPOQAKbHSlD7sLO/Xsv5LXptWMr0BgaI9yLiBLdauhSNyaC7uhlSoxMdrI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IecAEEMt; 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="IecAEEMt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4EBF9C2BC86; Tue, 18 Nov 2025 00:50:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763427046; bh=iS5RSX5kssNbD8Tb7keOKotIOZ6qJnsVQ/Lih7t17O0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IecAEEMtC3ill6QNjdg4SprpRMemF0/93QHWEzqZyS5B4IWd77btuPZmqauhcnrz9 PREFJjSzjBq/f5O7RTsnB1FC9zLUleTbgHetJMgT0E79iijQ+5hZl70gOfiW/1YNnm qAgxkFlbCRRLOrdqhz94BC3VqsLrdfxkWHJTEctnSdVizDFpnoqI6IS4NSiYHv+z5G BBsCHecYSHsvSE4Vq+t1436HHUdQHqouHYyEbijQL67PHx5HYg8FuNIGq7rPSOkZyx TJF1ybi89eEvUCfS9wD2VVkWLAgUYMUoCilzoi6yNMDIDtvwMopQzLn0pAysEjO6oZ e9/tXi0ZhSyLw== 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 v2 04/15] gpio: pl061: Use modern PM macros Date: Tue, 18 Nov 2025 08:32:18 +0800 Message-ID: <20251118003229.26636-5-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251118003229.26636-1-jszhang@kernel.org> References: <20251118003229.26636-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. The pl061_context_save_regs structure is always embedded into struct pl061 to simplify code, so this brings a tiny 8 bytes memory overhead for !CONFIG_PM_SLEP. Signed-off-by: Jisheng Zhang Reviewed-by: Linus Walleij Acked-by: Linus Walleij --- drivers/gpio/gpio-pl061.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c index 02e4ffcf5a6f..919cf86fd590 100644 --- a/drivers/gpio/gpio-pl061.c +++ b/drivers/gpio/gpio-pl061.c @@ -37,7 +37,6 @@ =20 #define PL061_GPIO_NR 8 =20 -#ifdef CONFIG_PM struct pl061_context_save_regs { u8 gpio_data; u8 gpio_dir; @@ -46,7 +45,6 @@ struct pl061_context_save_regs { u8 gpio_iev; u8 gpio_ie; }; -#endif =20 struct pl061 { raw_spinlock_t lock; @@ -55,9 +53,7 @@ struct pl061 { struct gpio_chip gc; int parent_irq; =20 -#ifdef CONFIG_PM struct pl061_context_save_regs csave_regs; -#endif }; =20 static int pl061_get_direction(struct gpio_chip *gc, unsigned offset) @@ -367,7 +363,6 @@ static int pl061_probe(struct amba_device *adev, const = struct amba_id *id) return 0; } =20 -#ifdef CONFIG_PM static int pl061_suspend(struct device *dev) { struct pl061 *pl061 =3D dev_get_drvdata(dev); @@ -411,13 +406,7 @@ static int pl061_resume(struct device *dev) return 0; } =20 -static const struct dev_pm_ops pl061_dev_pm_ops =3D { - .suspend =3D pl061_suspend, - .resume =3D pl061_resume, - .freeze =3D pl061_suspend, - .restore =3D pl061_resume, -}; -#endif +static DEFINE_SIMPLE_DEV_PM_OPS(pl061_dev_pm_ops, pl061_suspend, pl061_res= ume); =20 static const struct amba_id pl061_ids[] =3D { { @@ -431,9 +420,7 @@ MODULE_DEVICE_TABLE(amba, pl061_ids); static struct amba_driver pl061_gpio_driver =3D { .drv =3D { .name =3D "pl061_gpio", -#ifdef CONFIG_PM - .pm =3D &pl061_dev_pm_ops, -#endif + .pm =3D pm_sleep_ptr(&pl061_dev_pm_ops), }, .id_table =3D pl061_ids, .probe =3D pl061_probe, --=20 2.51.0 From nobody Tue Dec 2 02:52:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B228E2F60A6; Tue, 18 Nov 2025 00:50: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=1763427051; cv=none; b=edIfB7B/Uyph2pT1/afJomc4Tfmd+fUWPg1SCDPTBxaSWBNo9jd0T8PCqojPiORiTYxeVw9qgZe84VS4847mPIbMalsljexlrnMkp+K7W5K9K4ikGNjs2Y0z56vipvl7HNzTS5KxdN7oqmPtHb0uZVaAaZEsPzH9MjEcFXQx5Dc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763427051; c=relaxed/simple; bh=4ox7C0QaWmV0Nnx5hdJFmtfNWffG0pNyqJvi1TSzbhA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NRDVL5GvSPTZUiiM5jeH1zbR/5H1Sl1P5mvJqJkB49omvyTAU/k+6DjhsSdEgIaTar2kyA+me4ZSaZJ2GsQsOygekp3gixmfGpqK1+u4KEPqXGkey39v7Qo15+3cuJEDINPlDRT391BkLal01D16XTaIffNJDLve0xL3DHWeg+w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=b1dKoioj; 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="b1dKoioj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94E05C2BCC6; Tue, 18 Nov 2025 00:50:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763427051; bh=4ox7C0QaWmV0Nnx5hdJFmtfNWffG0pNyqJvi1TSzbhA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b1dKoiojyJfciQVkiaj1s73st57y+w+AaivuSuqltXBsHVMKDXtfqZTATra9QNHEt HKHtTAG05Zt4L5+uK1D7pmvTHEwIWGhXWi3gI3tWCTXw10S3f6EvKk29DrDSZS4zCS oPCdrG96MH0JksMeMfAUHbCKvZ/t/UeJ4dj7IV2bOztJEM9yZO52932v8UHhoaUPMY W7PmJtHf5+vwIkpfGMwgOJHeJ64JL0a5yXJw9RV/YFOLWw5ovdviJP2PNKLUXp/yoM +K1bT5h2TYobS6hbePkQJGDwQEBikIz147AaIuL12fl5POwp9b+oluSgknUf15v0EX vje3ThTMJj7AA== 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 v2 05/15] gpio: pxa: Use modern PM macros Date: Tue, 18 Nov 2025 08:32:19 +0800 Message-ID: <20251118003229.26636-6-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251118003229.26636-1-jszhang@kernel.org> References: <20251118003229.26636-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Jisheng Zhang Acked-by: Linus Walleij --- drivers/gpio/gpio-pxa.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c index fa22f3faa163..288c72f9c015 100644 --- a/drivers/gpio/gpio-pxa.c +++ b/drivers/gpio/gpio-pxa.c @@ -66,13 +66,10 @@ struct pxa_gpio_bank { unsigned long irq_mask; unsigned long irq_edge_rise; unsigned long irq_edge_fall; - -#ifdef CONFIG_PM unsigned long saved_gplr; unsigned long saved_gpdr; unsigned long saved_grer; unsigned long saved_gfer; -#endif }; =20 struct pxa_gpio_chip { @@ -746,7 +743,6 @@ static int __init pxa_gpio_dt_init(void) } device_initcall(pxa_gpio_dt_init); =20 -#ifdef CONFIG_PM static int pxa_gpio_suspend(void) { struct pxa_gpio_chip *pchip =3D pxa_gpio_chip; @@ -787,14 +783,10 @@ static void pxa_gpio_resume(void) writel_relaxed(c->saved_gpdr, c->regbase + GPDR_OFFSET); } } -#else -#define pxa_gpio_suspend NULL -#define pxa_gpio_resume NULL -#endif =20 static struct syscore_ops pxa_gpio_syscore_ops =3D { - .suspend =3D pxa_gpio_suspend, - .resume =3D pxa_gpio_resume, + .suspend =3D pm_ptr(pxa_gpio_suspend), + .resume =3D pm_ptr(pxa_gpio_resume), }; =20 static int __init pxa_gpio_sysinit(void) --=20 2.51.0 From nobody Tue Dec 2 02:52:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8735C2F3636; Tue, 18 Nov 2025 00:50:57 +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=1763427057; cv=none; b=D4V3fQ1qpUEw5c1IwlG6BDM/7nw+xCx4xqrBTw1YWLxOrI0oGA+ZvWTaZRh2VsCUp47tteAJEdqN1Fe2/oEqQepyLoO/yjGersmi2MzPYHC4cTd6ksNJsyfhCR08/iGxz+QHacbvMOqpQWD5SFOczVsNyjuPOzZo8gI3A9fMpl0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763427057; c=relaxed/simple; bh=eOHQgrB5skHPcM2HqeXjcVrG1cllA/I5abBZUOtgWzA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Cer4gFwhfUaoc6sUSLyDBEgM3e2LVgPz+s4jamXbzgMXLl5s+qDCtV4cgffMDBlGIDscUisCjjK8MOI4GoKZ++qFJljrTGQfxJHlOFRBF4HHVXaFkNGiB9HPY83t0gslYYkyuezN7SVBCCO8RwKWFKQXJNRiyVW2abh0SJ328lU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GtPdDfjX; 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="GtPdDfjX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE7C4C116B1; Tue, 18 Nov 2025 00:50:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763427056; bh=eOHQgrB5skHPcM2HqeXjcVrG1cllA/I5abBZUOtgWzA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GtPdDfjXvMf42P6ZmomvHghS1hTPvc9iNhLLk4uxXAhRU5LstSDuGdkaUzdJttu/N hJMKE3/cbZiuGJuRDAyZSIUPI7t9+FpQT/58pN2k9PgZDVZImhuUljWG2bV4yju0kb RYy/jG+rL18vQFh+Lu+RXvoCA/1ZkOTHf+kYLWdt/7a3AXEt3lcWQkx725aZ+EPGBk 4RQT3n5mPXj0FUKK93SH1TM8MYbO/J8+E6U1uUlUaMk1fsvQ2/xhxSq7147hRNi01o K9i1nb0ir3xRZBwNGs3upwIL3taHL3w5EuD0qDEE9m4JvcYRlkQQlzHICsYijWGMdq tznJoVPsTuciw== 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 v2 06/15] gpio: ml-ioh: Use modern PM macros Date: Tue, 18 Nov 2025 08:32:20 +0800 Message-ID: <20251118003229.26636-7-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251118003229.26636-1-jszhang@kernel.org> References: <20251118003229.26636-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused Signed-off-by: Jisheng Zhang Acked-by: Andy Shevchenko Acked-by: Linus Walleij --- drivers/gpio/gpio-ml-ioh.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpio/gpio-ml-ioh.c b/drivers/gpio/gpio-ml-ioh.c index f6af81bf2b13..6576e5dcb0ee 100644 --- a/drivers/gpio/gpio-ml-ioh.c +++ b/drivers/gpio/gpio-ml-ioh.c @@ -160,7 +160,7 @@ static int ioh_gpio_direction_input(struct gpio_chip *g= pio, unsigned nr) /* * Save register configuration and disable interrupts. */ -static void __maybe_unused ioh_gpio_save_reg_conf(struct ioh_gpio *chip) +static void ioh_gpio_save_reg_conf(struct ioh_gpio *chip) { int i; =20 @@ -186,7 +186,7 @@ static void __maybe_unused ioh_gpio_save_reg_conf(struc= t ioh_gpio *chip) /* * This function restores the register configuration of the GPIO device. */ -static void __maybe_unused ioh_gpio_restore_reg_conf(struct ioh_gpio *chip) +static void ioh_gpio_restore_reg_conf(struct ioh_gpio *chip) { int i; =20 @@ -479,7 +479,7 @@ static int ioh_gpio_probe(struct pci_dev *pdev, return 0; } =20 -static int __maybe_unused ioh_gpio_suspend(struct device *dev) +static int ioh_gpio_suspend(struct device *dev) { struct ioh_gpio *chip =3D dev_get_drvdata(dev); unsigned long flags; @@ -491,7 +491,7 @@ static int __maybe_unused ioh_gpio_suspend(struct devic= e *dev) return 0; } =20 -static int __maybe_unused ioh_gpio_resume(struct device *dev) +static int ioh_gpio_resume(struct device *dev) { struct ioh_gpio *chip =3D dev_get_drvdata(dev); unsigned long flags; @@ -505,7 +505,7 @@ static int __maybe_unused ioh_gpio_resume(struct device= *dev) return 0; } =20 -static SIMPLE_DEV_PM_OPS(ioh_gpio_pm_ops, ioh_gpio_suspend, ioh_gpio_resum= e); +static DEFINE_SIMPLE_DEV_PM_OPS(ioh_gpio_pm_ops, ioh_gpio_suspend, ioh_gpi= o_resume); =20 static const struct pci_device_id ioh_gpio_pcidev_id[] =3D { { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x802E) }, @@ -518,7 +518,7 @@ static struct pci_driver ioh_gpio_driver =3D { .id_table =3D ioh_gpio_pcidev_id, .probe =3D ioh_gpio_probe, .driver =3D { - .pm =3D &ioh_gpio_pm_ops, + .pm =3D pm_sleep_ptr(&ioh_gpio_pm_ops), }, }; =20 --=20 2.51.0 From nobody Tue Dec 2 02:52:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F27C6304BD8; Tue, 18 Nov 2025 00:51:02 +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=1763427063; cv=none; b=F0RpPSSwom8kOm7OTYScCYUzmiwGfAekJEB+yNfK21ThWx8Td3r+NNE2x6CpItyw57e7GxgaiQknzGrrCPuU6hOVOMe2jnRQGNqkomWgGWmpmI0j8RchxuUE64jL7ujIcSeLnXkQ2C63kEXiq/t9CQlBjnNl7/espLC4nfBrroM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763427063; c=relaxed/simple; bh=b0QGRj1zJhMlxhEi1e8gZ427wDLzbANpOOdNU7pTMXI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qEAbKWRsT/cCR2qWge9cyIKuwNZ2ifDpKCpSPHcB+UOV+u4QpX6u+oMYHOw82mlBhws+/ciC0sXUlWKuRAZtXGV4W+LZ2NCPv4Q4gd/eZXA16FZ1YhsQY7KISRfO0DnhMa5MmV5F/UQ6s7ePE6wlycvW7bwRMW1xdez90pR51AI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LSDvLOqL; 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="LSDvLOqL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 649D3C2BC9E; Tue, 18 Nov 2025 00:50:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763427062; bh=b0QGRj1zJhMlxhEi1e8gZ427wDLzbANpOOdNU7pTMXI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LSDvLOqLC6Su6v05duZuemZY4oFxhzfCkSUp18lFu+pkS3nzWACmUmuG61vVm46E+ Oxj7dL4O7TY1TNB1HOAll1vshHZMlKEyGcuZ4zAdyFJsvpWVzztxrMGJEMA0Xro+8C amStortbZve34SZt3k8gOMWsh7B2VrqpEkr6MdW/nlmlfVMP9Ktp3lAM+lYYvCLD0a URhwg6Aeo0oeKaOEomqfNT+AUu8qWeocdfovofDVX1naySGvI6y0F6H6b2hHHcX/SA c7xKz4N0flAjDYyKPz6Zsip1ugXyBwx2ZcR6XwCxjISEnrnW7PwXSXSQJsisAGRQkS sKgCnk+NkFkAg== 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 v2 07/15] gpio: mlxbf2: Use modern PM macros Date: Tue, 18 Nov 2025 08:32:21 +0800 Message-ID: <20251118003229.26636-8-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251118003229.26636-1-jszhang@kernel.org> References: <20251118003229.26636-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused Signed-off-by: Jisheng Zhang Acked-by: Linus Walleij --- drivers/gpio/gpio-mlxbf2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-mlxbf2.c b/drivers/gpio/gpio-mlxbf2.c index abffce3894fc..6668686a28ff 100644 --- a/drivers/gpio/gpio-mlxbf2.c +++ b/drivers/gpio/gpio-mlxbf2.c @@ -424,7 +424,7 @@ mlxbf2_gpio_probe(struct platform_device *pdev) return 0; } =20 -static int __maybe_unused mlxbf2_gpio_suspend(struct device *dev) +static int mlxbf2_gpio_suspend(struct device *dev) { struct mlxbf2_gpio_context *gs =3D dev_get_drvdata(dev); =20 @@ -436,7 +436,7 @@ static int __maybe_unused mlxbf2_gpio_suspend(struct de= vice *dev) return 0; } =20 -static int __maybe_unused mlxbf2_gpio_resume(struct device *dev) +static int mlxbf2_gpio_resume(struct device *dev) { struct mlxbf2_gpio_context *gs =3D dev_get_drvdata(dev); =20 @@ -447,7 +447,7 @@ static int __maybe_unused mlxbf2_gpio_resume(struct dev= ice *dev) =20 return 0; } -static SIMPLE_DEV_PM_OPS(mlxbf2_pm_ops, mlxbf2_gpio_suspend, mlxbf2_gpio_r= esume); +static DEFINE_SIMPLE_DEV_PM_OPS(mlxbf2_pm_ops, mlxbf2_gpio_suspend, mlxbf2= _gpio_resume); =20 static const struct acpi_device_id __maybe_unused mlxbf2_gpio_acpi_match[]= =3D { { "MLNXBF22", 0 }, @@ -459,7 +459,7 @@ static struct platform_driver mlxbf2_gpio_driver =3D { .driver =3D { .name =3D "mlxbf2_gpio", .acpi_match_table =3D mlxbf2_gpio_acpi_match, - .pm =3D &mlxbf2_pm_ops, + .pm =3D pm_sleep_ptr(&mlxbf2_pm_ops), }, .probe =3D mlxbf2_gpio_probe, }; --=20 2.51.0 From nobody Tue Dec 2 02:52:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 15DA52FC876; Tue, 18 Nov 2025 00:51: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=1763427068; cv=none; b=DxCba02Hs4pwNeNIURgTCyNTGPBpL1Mrvr49IuLgPxVMxIYM5xgldCtwdwnmxo6o9clzFpibNIwlpAyPttKMzoE8go9URRo9cZYvoQ5Oy3LfXiWeFRicR8jPiOSwgpzXYhuqXFxv4yaJNYxkj1S2mMw5qBm2WxS+IoVRuSrP4+U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763427068; c=relaxed/simple; bh=pVjWUEvvssaN7iGS7PtE44X/CcQ/Woo7dEU2W/P2eu0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mP8TSdvHPA6h+zEeM748uH9sIMr71X8/T+lTUdS358dSzMMRVND0iLgk3KB319UhnUfpc+vPYj5++MZ60Lypgg824moVkM6Xq1IlO0rRpoTX+B0aYYnZWzEq0leIR6mtbwGJTSeSdI/6jiqJFLYOKKo4sTFDUaabXVTCZ5eu8qI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pcG+cM2m; 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="pcG+cM2m" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD437C2BCB6; Tue, 18 Nov 2025 00:51:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763427067; bh=pVjWUEvvssaN7iGS7PtE44X/CcQ/Woo7dEU2W/P2eu0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pcG+cM2mL8IYP8AErR86W9AMuyDr3JY5OUC1x2iS5nyQHwJVc/A4oEzMrqmnjvMtJ qicp2jUVOaQqgmE8jlaXVUHCKudTRRRMyXhw3kJnLTtGj2EBB23IBl43Kjf9Xa5wRh m/bPEFAUkQT31/SuhwF8F8BZy0viXA9eo/+2sBwVKNDNmUQVB8em5ltgcVAe9gcCNo R6V8/Nv2yaxFldhKQMnRzGdheD3h0k5PStLDycloTlnEzGOemzuCMvBuQ8VhrGlx47 Dcec+DoxCxix5JMi9yUAG3C0zIsDW/oC+DHlvK4qEAXkYIZCXJI9nD+YHILTa3gTcF zSLKFoibHWshw== 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 v2 08/15] gpio: msc313: Use modern PM macros Date: Tue, 18 Nov 2025 08:32:22 +0800 Message-ID: <20251118003229.26636-9-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251118003229.26636-1-jszhang@kernel.org> References: <20251118003229.26636-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused Signed-off-by: Jisheng Zhang Acked-by: Linus Walleij --- drivers/gpio/gpio-msc313.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-msc313.c b/drivers/gpio/gpio-msc313.c index b0cccd856840..7345afdc78de 100644 --- a/drivers/gpio/gpio-msc313.c +++ b/drivers/gpio/gpio-msc313.c @@ -694,7 +694,7 @@ static const struct of_device_id msc313_gpio_of_match[]= =3D { * SoC goes into suspend to memory mode so we need to save some * of the register bits before suspending and put it back when resuming */ -static int __maybe_unused msc313_gpio_suspend(struct device *dev) +static int msc313_gpio_suspend(struct device *dev) { struct msc313_gpio *gpio =3D dev_get_drvdata(dev); int i; @@ -705,7 +705,7 @@ static int __maybe_unused msc313_gpio_suspend(struct de= vice *dev) return 0; } =20 -static int __maybe_unused msc313_gpio_resume(struct device *dev) +static int msc313_gpio_resume(struct device *dev) { struct msc313_gpio *gpio =3D dev_get_drvdata(dev); int i; @@ -716,13 +716,13 @@ static int __maybe_unused msc313_gpio_resume(struct d= evice *dev) return 0; } =20 -static SIMPLE_DEV_PM_OPS(msc313_gpio_ops, msc313_gpio_suspend, msc313_gpio= _resume); +static DEFINE_SIMPLE_DEV_PM_OPS(msc313_gpio_ops, msc313_gpio_suspend, msc3= 13_gpio_resume); =20 static struct platform_driver msc313_gpio_driver =3D { .driver =3D { .name =3D DRIVER_NAME, .of_match_table =3D msc313_gpio_of_match, - .pm =3D &msc313_gpio_ops, + .pm =3D pm_sleep_ptr(&msc313_gpio_ops), }, .probe =3D msc313_gpio_probe, }; --=20 2.51.0 From nobody Tue Dec 2 02:52:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B5912FC876; Tue, 18 Nov 2025 00:51:13 +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=1763427073; cv=none; b=mho3gARvXW+iitxatrxEbIwx7dpQeDz137xtf1xk/QoH2r+X5GiLogersnfSvoUHXL3JIpiilZXvX02k5IRQtGbxroXg9T+y43/GMTYtGfs3AwrY7MbC31lqG1XcVf9uSniRDVxAcKTHvoRKXjuCe1+2QDuuQF6L4wKj38jlMyg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763427073; c=relaxed/simple; bh=uBYzXnNEL/J0rcqGNMQx7tTaHWYqsTP86ap/m0VE1lU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Y2ZfyBk3CnINPkkaS3EO9gEeoZcFnUlyCNFT46oYs6J5dULHfGWCqZ6NlJA319wPw1glBrxPqZPam2l3Mdl088UDF5JojT3IWUojnK92MAKXo15oqzJYv4Z6PPCi56gtsekmvsp0x0G560xoLQPB03GHGWmslj1nxU1Dyjfz2MY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iVNmI0Ip; 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="iVNmI0Ip" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09E31C19421; Tue, 18 Nov 2025 00:51:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763427072; bh=uBYzXnNEL/J0rcqGNMQx7tTaHWYqsTP86ap/m0VE1lU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iVNmI0IpY2egn1YXzFocw0Bhlr6eNxhOjrYPQ7WesAekIoWGhmCIiF2Ej5UdMa1je JoOzZuu7t/jHIyvCApCDIihRJTGNtrO7B9sP0eZv/CKMh4m4aufVWm2mKUxW1dBv2K vT3H0NXuKBD6lNywEcRumVCHRmJMjCRrp8lLELmQXtXKKs3pLlOlOsNFaSwhK9TNVN 5G2u8c0hxUQz+Lenz4HpNltlT+GV17Q0rd97mHZ8nW3EnpqjUoR5/9MlqDn8/iJSjO H9ZA9xyWWyRjCoJnlIiKyF/WiqcxAz0gID5Jr+3mguGj6UU+8+fElYrTsnLdY17wj4 KeEaV76HcJ6mw== 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 v2 09/15] gpio: omap: Use modern PM macros Date: Tue, 18 Nov 2025 08:32:23 +0800 Message-ID: <20251118003229.26636-10-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251118003229.26636-1-jszhang@kernel.org> References: <20251118003229.26636-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused Signed-off-by: Jisheng Zhang Acked-by: Linus Walleij --- drivers/gpio/gpio-omap.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index a268c76bdca6..e136e81794df 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -1503,7 +1503,7 @@ static void omap_gpio_remove(struct platform_device *= pdev) clk_unprepare(bank->dbck); } =20 -static int __maybe_unused omap_gpio_runtime_suspend(struct device *dev) +static int omap_gpio_runtime_suspend(struct device *dev) { struct gpio_bank *bank =3D dev_get_drvdata(dev); unsigned long flags; @@ -1516,7 +1516,7 @@ static int __maybe_unused omap_gpio_runtime_suspend(s= truct device *dev) return 0; } =20 -static int __maybe_unused omap_gpio_runtime_resume(struct device *dev) +static int omap_gpio_runtime_resume(struct device *dev) { struct gpio_bank *bank =3D dev_get_drvdata(dev); unsigned long flags; @@ -1529,7 +1529,7 @@ static int __maybe_unused omap_gpio_runtime_resume(st= ruct device *dev) return 0; } =20 -static int __maybe_unused omap_gpio_suspend(struct device *dev) +static int omap_gpio_suspend(struct device *dev) { struct gpio_bank *bank =3D dev_get_drvdata(dev); =20 @@ -1541,7 +1541,7 @@ static int __maybe_unused omap_gpio_suspend(struct de= vice *dev) return omap_gpio_runtime_suspend(dev); } =20 -static int __maybe_unused omap_gpio_resume(struct device *dev) +static int omap_gpio_resume(struct device *dev) { struct gpio_bank *bank =3D dev_get_drvdata(dev); =20 @@ -1554,9 +1554,8 @@ static int __maybe_unused omap_gpio_resume(struct dev= ice *dev) } =20 static const struct dev_pm_ops gpio_pm_ops =3D { - SET_RUNTIME_PM_OPS(omap_gpio_runtime_suspend, omap_gpio_runtime_resume, - NULL) - SET_LATE_SYSTEM_SLEEP_PM_OPS(omap_gpio_suspend, omap_gpio_resume) + RUNTIME_PM_OPS(omap_gpio_runtime_suspend, omap_gpio_runtime_resume, NULL) + LATE_SYSTEM_SLEEP_PM_OPS(omap_gpio_suspend, omap_gpio_resume) }; =20 static struct platform_driver omap_gpio_driver =3D { @@ -1564,7 +1563,7 @@ static struct platform_driver omap_gpio_driver =3D { .remove =3D omap_gpio_remove, .driver =3D { .name =3D "omap_gpio", - .pm =3D &gpio_pm_ops, + .pm =3D pm_ptr(&gpio_pm_ops), .of_match_table =3D omap_gpio_match, }, }; --=20 2.51.0 From nobody Tue Dec 2 02:52:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA3F5313274; Tue, 18 Nov 2025 00:51:18 +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=1763427079; cv=none; b=Zwnm5TtvDVvGqJBsiqvz+4vNRFV39SkDTMreAal+XsZOw/gnJXTH5vhe6rubx3IJK8W6So6L7ewTg91bCDG34R/ZLIUAahlcfT5jCkkwwv2yHGbWr+hNDxAkdTIdYeO8z5vTLUMWU3TYLqMSh1x4Cu3tyNl6aAHoigAsHcLT7ik= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763427079; c=relaxed/simple; bh=P97Bc+5RHWfAXBOfJCvb7Bdf9SK6HWDJUVbNNGzAwjA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=s6EIBdsM6yhiBQ3UGhO491xKZdld1oIgbh9ZSXC037yRQr5cCqSjDDimUwaePjDgzJZ1KfFUkOH4H8YunVXGGLEzcZKBPQ2YjnRNn3TqBL0LcAJsK5vOIvQD/NiGjOLSLUvEa/I0VBpUdb77zh6PNys0Cg7RvkBBn4TT8rXNpCc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qnDjfK3V; 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="qnDjfK3V" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 657FBC19425; Tue, 18 Nov 2025 00:51:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763427078; bh=P97Bc+5RHWfAXBOfJCvb7Bdf9SK6HWDJUVbNNGzAwjA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qnDjfK3VJgSksrVPwA3G60tXWU7vRHNLrPuIz6+ab+8OuDBDfJ6nmwV6c9cjMVdLD LZCw/N888rLqP8G1mavAtBcqLxldk+9jXWFFN8IzXf1ripj1rx3ciNvWh8bVaPpM6F OJV6iV4crVEK3lItw9ugkMEVLiIbcj0pS4KFjcVJwYKSljvM+0ooQd0sqHIzJ5I7OR ELMicc+f+d9wnSLUl/FCUm/cORCeousRgJ0tH1vg+IOylls+Arw0KX0s92ow/wob/T Gz6iG1y44yugepSVldMI1OLWM1CE0jttz8GLpe0sfyJ3SwkRMnCdUWQlKouapuU4bk RX4JzBqSY1tHQ== 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 v2 10/15] gpio: pch: Use modern PM macros Date: Tue, 18 Nov 2025 08:32:24 +0800 Message-ID: <20251118003229.26636-11-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251118003229.26636-1-jszhang@kernel.org> References: <20251118003229.26636-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused Signed-off-by: Jisheng Zhang Acked-by: Andy Shevchenko Acked-by: Linus Walleij --- drivers/gpio/gpio-pch.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpio/gpio-pch.c b/drivers/gpio/gpio-pch.c index 9925687e05fb..4ffa0955a9e3 100644 --- a/drivers/gpio/gpio-pch.c +++ b/drivers/gpio/gpio-pch.c @@ -171,7 +171,7 @@ static int pch_gpio_direction_input(struct gpio_chip *g= pio, unsigned int nr) /* * Save register configuration and disable interrupts. */ -static void __maybe_unused pch_gpio_save_reg_conf(struct pch_gpio *chip) +static void pch_gpio_save_reg_conf(struct pch_gpio *chip) { chip->pch_gpio_reg.ien_reg =3D ioread32(&chip->reg->ien); chip->pch_gpio_reg.imask_reg =3D ioread32(&chip->reg->imask); @@ -187,7 +187,7 @@ static void __maybe_unused pch_gpio_save_reg_conf(struc= t pch_gpio *chip) /* * This function restores the register configuration of the GPIO device. */ -static void __maybe_unused pch_gpio_restore_reg_conf(struct pch_gpio *chip) +static void pch_gpio_restore_reg_conf(struct pch_gpio *chip) { iowrite32(chip->pch_gpio_reg.ien_reg, &chip->reg->ien); iowrite32(chip->pch_gpio_reg.imask_reg, &chip->reg->imask); @@ -402,7 +402,7 @@ static int pch_gpio_probe(struct pci_dev *pdev, return pch_gpio_alloc_generic_chip(chip, irq_base, gpio_pins[chip->ioh]); } =20 -static int __maybe_unused pch_gpio_suspend(struct device *dev) +static int pch_gpio_suspend(struct device *dev) { struct pch_gpio *chip =3D dev_get_drvdata(dev); unsigned long flags; @@ -414,7 +414,7 @@ static int __maybe_unused pch_gpio_suspend(struct devic= e *dev) return 0; } =20 -static int __maybe_unused pch_gpio_resume(struct device *dev) +static int pch_gpio_resume(struct device *dev) { struct pch_gpio *chip =3D dev_get_drvdata(dev); unsigned long flags; @@ -428,7 +428,7 @@ static int __maybe_unused pch_gpio_resume(struct device= *dev) return 0; } =20 -static SIMPLE_DEV_PM_OPS(pch_gpio_pm_ops, pch_gpio_suspend, pch_gpio_resum= e); +static DEFINE_SIMPLE_DEV_PM_OPS(pch_gpio_pm_ops, pch_gpio_suspend, pch_gpi= o_resume); =20 static const struct pci_device_id pch_gpio_pcidev_id[] =3D { { PCI_DEVICE_DATA(INTEL, EG20T_PCH, INTEL_EG20T_PCH) }, @@ -444,7 +444,7 @@ static struct pci_driver pch_gpio_driver =3D { .id_table =3D pch_gpio_pcidev_id, .probe =3D pch_gpio_probe, .driver =3D { - .pm =3D &pch_gpio_pm_ops, + .pm =3D pm_sleep_ptr(&pch_gpio_pm_ops), }, }; =20 --=20 2.51.0 From nobody Tue Dec 2 02:52:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 260A6320CC0; Tue, 18 Nov 2025 00:51:23 +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=1763427084; cv=none; b=aBLw55x2wyvHpjNaYGKaLfTbDFi9jkdJquvamCsaFfDjFekhtChFrVM0PfKbTWVbAYJBQL9cosVuOJ4OR+m932uvnFwzStXKVW3t+F1nku5AafLMXVIZO9d6FzkUUd6Tjd+kH7ouGIcD4b2ltumNps6tWypaNbXmY2xTDDifo28= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763427084; c=relaxed/simple; bh=El1hxWSbR3GmHln8ZOHlWcFS/7CJ8C4SvNQbzWmhhGI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rlRjADFwPle7zflYPTemQ9v3+fqFiDK1E3UnqhrdkN0jq2qcTCDRGTJGNm7KYr5zIP2Yawjz6J+afV0vSN1crRdQwrmsdUGkGiDJtUgQsgCigCrcvYRwG5Sohp5Decx67KR/I/z54AufCU2EE4C10I5WZhRhDIko/aRPIgk0FUE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tQHIY8FF; 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="tQHIY8FF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BDD7DC2BCB7; Tue, 18 Nov 2025 00:51:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763427083; bh=El1hxWSbR3GmHln8ZOHlWcFS/7CJ8C4SvNQbzWmhhGI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tQHIY8FFl8C33JofqotXTXmXAkvXecRsBuM5it5qqHEY8LkeUlIvcaPDvBLNhEC8H uDOc8UUG/9giAms/keb8FL9uDAsYB6TePrEYiAMjXavV1YpUlUPjbFS+XsjfnVL7Fl iUhnJ+NiRqA+pXKy/rFCeqMRijwh4Nd0IH5OzYLFohggimMRfR7moisDSpC3mX1/t4 Xb+aN17DupfhOwJXjAZ6COlTl3ykgMVYUZP1KbgtHxM2XZW3z1rbxlSakEFqv3ffl6 dlSdq5KrVnW4Jep0O70GPyFMiqTZnJ2eWwh9uimKljHuedy9Ni3ci4HwUw4RSHW8Fw U7mf4XQDtp3dA== 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 v2 11/15] gpio: tqmx86: Use modern PM macros Date: Tue, 18 Nov 2025 08:32:25 +0800 Message-ID: <20251118003229.26636-12-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251118003229.26636-1-jszhang@kernel.org> References: <20251118003229.26636-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused Signed-off-by: Jisheng Zhang Acked-by: Linus Walleij --- drivers/gpio/gpio-tqmx86.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpio/gpio-tqmx86.c b/drivers/gpio/gpio-tqmx86.c index 27dd09273292..d79f515137a5 100644 --- a/drivers/gpio/gpio-tqmx86.c +++ b/drivers/gpio/gpio-tqmx86.c @@ -279,19 +279,18 @@ static void tqmx86_gpio_irq_handler(struct irq_desc *= desc) } =20 /* Minimal runtime PM is needed by the IRQ subsystem */ -static int __maybe_unused tqmx86_gpio_runtime_suspend(struct device *dev) +static int tqmx86_gpio_runtime_suspend(struct device *dev) { return 0; } =20 -static int __maybe_unused tqmx86_gpio_runtime_resume(struct device *dev) +static int tqmx86_gpio_runtime_resume(struct device *dev) { return 0; } =20 static const struct dev_pm_ops tqmx86_gpio_dev_pm_ops =3D { - SET_RUNTIME_PM_OPS(tqmx86_gpio_runtime_suspend, - tqmx86_gpio_runtime_resume, NULL) + RUNTIME_PM_OPS(tqmx86_gpio_runtime_suspend, tqmx86_gpio_runtime_resume, N= ULL) }; =20 static void tqmx86_init_irq_valid_mask(struct gpio_chip *chip, @@ -425,7 +424,7 @@ static int tqmx86_gpio_probe(struct platform_device *pd= ev) static struct platform_driver tqmx86_gpio_driver =3D { .driver =3D { .name =3D "tqmx86-gpio", - .pm =3D &tqmx86_gpio_dev_pm_ops, + .pm =3D pm_sleep_ptr(&tqmx86_gpio_dev_pm_ops), }, .probe =3D tqmx86_gpio_probe, }; --=20 2.51.0 From nobody Tue Dec 2 02:52:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A35E280A5C; Tue, 18 Nov 2025 00: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=1763427089; cv=none; b=boxoL5LHdeCu+mULy5wBU4p2jMgjdHVwOEiK6LZ0hV4piWiw3ngVadF+cnfuc80PT7s1l18tuGnse+d4evgTFs4lPxwyJwE21wNk1rsBfBNPLq18f2tSl7g+iFGb9fcUcguBaIUwLgQLdWjQkbMerLINkKmeb2hlnWHHOmMGVOE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763427089; c=relaxed/simple; bh=VPRuMvDGj7ds9h4LXc+zNbk2IceZVhyaJoduENnSGiE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UT2DQFtea+BqyU/CWeP2ZqZdnJw95uSz+hC5qDcZ1xHed0NFHYe9pQk03TgaEJ3UXPc13yYGmYhXcfTzOHnpNlPr0KV+3TJV0SVx2GiEFAZDFLFcANY3WO0Q4S0ir8ElNT78apQEJ2oFqRw8cOBdV4c/x+Wm8fTc/MlTq7TxkXo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fSDicQY2; 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="fSDicQY2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09793C2BCC7; Tue, 18 Nov 2025 00:51:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763427088; bh=VPRuMvDGj7ds9h4LXc+zNbk2IceZVhyaJoduENnSGiE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fSDicQY2z7Tn6m96WCY5+zbuY2fv5IxP19yHIjp5HSGY7UT+ztJiObDpY/da70mTo FcoP+CDp1deilWwXcGLrKXUZal1ZWAKf/95OXLDZvxwsC/kFsjMH3wNk91ijSaYY+d lxUzR3DmDN+scmGAr1ipC6oBCDOc6T8f5pd/i3MQejXsf9oTPTkTL8WRfcE96RIKhE NUZVoGLKwHB4MwGUx0+Go9Kv0oAcpapWHKyqBSl9Ax/5Bg5DFlTP/j/GmUyZ1yj6dX O76V4Fv+UALyEkwOcQttDHugvYiKE5IU75ykb0SYstiWwpHEBRnHCQVLan76StYWR6 YGn9hKcG4Cf4w== 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 v2 12/15] gpio: uniphier: Use modern PM macros Date: Tue, 18 Nov 2025 08:32:26 +0800 Message-ID: <20251118003229.26636-13-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251118003229.26636-1-jszhang@kernel.org> References: <20251118003229.26636-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused Signed-off-by: Jisheng Zhang Acked-by: Linus Walleij --- drivers/gpio/gpio-uniphier.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpio/gpio-uniphier.c b/drivers/gpio/gpio-uniphier.c index 197bb1d22b3c..0574dde5b5bb 100644 --- a/drivers/gpio/gpio-uniphier.c +++ b/drivers/gpio/gpio-uniphier.c @@ -426,7 +426,7 @@ static void uniphier_gpio_remove(struct platform_device= *pdev) irq_domain_remove(priv->domain); } =20 -static int __maybe_unused uniphier_gpio_suspend(struct device *dev) +static int uniphier_gpio_suspend(struct device *dev) { struct uniphier_gpio_priv *priv =3D dev_get_drvdata(dev); unsigned int nbanks =3D uniphier_gpio_get_nbanks(priv->chip.ngpio); @@ -448,7 +448,7 @@ static int __maybe_unused uniphier_gpio_suspend(struct = device *dev) return 0; } =20 -static int __maybe_unused uniphier_gpio_resume(struct device *dev) +static int uniphier_gpio_resume(struct device *dev) { struct uniphier_gpio_priv *priv =3D dev_get_drvdata(dev); unsigned int nbanks =3D uniphier_gpio_get_nbanks(priv->chip.ngpio); @@ -473,8 +473,7 @@ static int __maybe_unused uniphier_gpio_resume(struct d= evice *dev) } =20 static const struct dev_pm_ops uniphier_gpio_pm_ops =3D { - SET_LATE_SYSTEM_SLEEP_PM_OPS(uniphier_gpio_suspend, - uniphier_gpio_resume) + LATE_SYSTEM_SLEEP_PM_OPS(uniphier_gpio_suspend, uniphier_gpio_resume) }; =20 static const struct of_device_id uniphier_gpio_match[] =3D { @@ -489,7 +488,7 @@ static struct platform_driver uniphier_gpio_driver =3D { .driver =3D { .name =3D "uniphier-gpio", .of_match_table =3D uniphier_gpio_match, - .pm =3D &uniphier_gpio_pm_ops, + .pm =3D pm_sleep_ptr(&uniphier_gpio_pm_ops), }, }; module_platform_driver(uniphier_gpio_driver); --=20 2.51.0 From nobody Tue Dec 2 02:52:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9795D3277BA; Tue, 18 Nov 2025 00: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=1763427094; cv=none; b=aGqEKvRMwCewh/7mqwodY8bOGzZO+GUQuWyUz4MjRQ22B7KBrmm/nq7XmDpmsAw6bByBO0dKXMnGTeYfqpFdYpCGjdynPnSuCA37Lx6rIZvFdABcPG9PZet4+CKj9Ur/RsBakwT7WT1i8Z8otWx/TAhvBwik3pcbyLRI5sVCL6U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763427094; c=relaxed/simple; bh=abw3WyBlH0LdVJ/qIAAe2kgPCAjhL8NOjxt6Yr6wl4E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i/CwwmpvID4IfmDCpYW1jPBz4b+7s9ybd2fnSiG0hyjFlp2X7C7o3guWUFXl6FkH5E7JjVw2yIPa1s3TZmowoz4ZgA7NWrAdH89TECbVf621oJ/ON1cO/W21Cy7btWD/jYjx6+Z8uQibMNRpf5rtgJy6iNSHbpdjUCw91/rtK5s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Bg1KhUKZ; 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="Bg1KhUKZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60DDCC4CEF5; Tue, 18 Nov 2025 00:51:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763427094; bh=abw3WyBlH0LdVJ/qIAAe2kgPCAjhL8NOjxt6Yr6wl4E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bg1KhUKZpfzoAoxC1bueX15q0RQckG7lKlski2DfUPEs+ldrPVfCF939PKLNUvt/x 4l+cZd0/Ti0jY89zlOIe6iRqVuGcccnXowBvZn3Gd6c63lweOb+MDzU7brSscPOwLe Vyk2XNLFc0cJRdj0T1aHrM/Pxt1xvCSsG+Z7lfgE6m0Lg6i0s4RRUvbiZcUZGkmW46 opDwsuGVAXVUpr5xWevv1r0NAXRPWNGS2VCODXcXnY3bupdbeGoF4uB9/nUA66wxxL SVUYD6yjtoZ+6cb7tvnF1kV0+Ydoy88zC2QIOHnuH4+Z0t4/FPDKzs4ELyy7fNewwO f/6drP/pku9lw== 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 v2 13/15] gpio: xgene: Use modern PM macros Date: Tue, 18 Nov 2025 08:32:27 +0800 Message-ID: <20251118003229.26636-14-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251118003229.26636-1-jszhang@kernel.org> References: <20251118003229.26636-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused Signed-off-by: Jisheng Zhang Acked-by: Linus Walleij --- drivers/gpio/gpio-xgene.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-xgene.c b/drivers/gpio/gpio-xgene.c index 4f627de3f56c..809668449dbe 100644 --- a/drivers/gpio/gpio-xgene.c +++ b/drivers/gpio/gpio-xgene.c @@ -130,7 +130,7 @@ static int xgene_gpio_dir_out(struct gpio_chip *gc, return 0; } =20 -static __maybe_unused int xgene_gpio_suspend(struct device *dev) +static int xgene_gpio_suspend(struct device *dev) { struct xgene_gpio *gpio =3D dev_get_drvdata(dev); unsigned long bank_offset; @@ -143,7 +143,7 @@ static __maybe_unused int xgene_gpio_suspend(struct dev= ice *dev) return 0; } =20 -static __maybe_unused int xgene_gpio_resume(struct device *dev) +static int xgene_gpio_resume(struct device *dev) { struct xgene_gpio *gpio =3D dev_get_drvdata(dev); unsigned long bank_offset; @@ -156,7 +156,7 @@ static __maybe_unused int xgene_gpio_resume(struct devi= ce *dev) return 0; } =20 -static SIMPLE_DEV_PM_OPS(xgene_gpio_pm, xgene_gpio_suspend, xgene_gpio_res= ume); +static DEFINE_SIMPLE_DEV_PM_OPS(xgene_gpio_pm, xgene_gpio_suspend, xgene_g= pio_resume); =20 static int xgene_gpio_probe(struct platform_device *pdev) { @@ -204,7 +204,7 @@ static struct platform_driver xgene_gpio_driver =3D { .name =3D "xgene-gpio", .of_match_table =3D xgene_gpio_of_match, .acpi_match_table =3D ACPI_PTR(xgene_gpio_acpi_match), - .pm =3D &xgene_gpio_pm, + .pm =3D pm_sleep_ptr(&xgene_gpio_pm), }, .probe =3D xgene_gpio_probe, }; --=20 2.51.0 From nobody Tue Dec 2 02:52:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 42AC31CEAC2; Tue, 18 Nov 2025 00:51:39 +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=1763427100; cv=none; b=grxBKOOfG4TdC/s4XGA/LPTQqpzNln8Okw123sPbFKTHdMwVMCbTxs2JQg8vjvw9MWnxSNnXMgj3GZdgskbaRWZkquiIAW8f73bq0Leg7UJ0Y47AkjWuwKTQWVGB2+5iIL8a7nOgO4uPbzlL2dBSjCc9Ch6HTtCqQmh/OJ5mZ7I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763427100; c=relaxed/simple; bh=sgcrLnGm3+Bbp+1Awn9kwG362Rqp8d/CDhH6WRqtT+E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HX3rn4wUjsNJG2kl7/ORrBOlpev7GeYSt1gpFbmKKAKFC82B5CzFAU7O85wT/Z6zoBlu31eHjYrRNBxS58UKkSp5qMfMNgMWlG56bkhTOGt4VbkT+R9GdC5dmtE0rHw5lPRxYW8yoRzhEvIPVf9Hn7KedLf6sT+xDpzgr7MbQ5g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IsWzXRyC; 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="IsWzXRyC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC583C2BCC9; Tue, 18 Nov 2025 00:51:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763427099; bh=sgcrLnGm3+Bbp+1Awn9kwG362Rqp8d/CDhH6WRqtT+E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IsWzXRyCK9isjIMpLbbmO/Hhm+emJSuG0Hxpvdr2a2shuyiUk4fuGzYDAmY3no8mL TF0A2V/cJTgHCyafPL25WX7NYstNN2xMxyF98tN9U7oUkTgqqCROSFsCvyxW1KxwlE 14+MwomUh0aLK6/A6OtAZOcpM96yMt+Msa0HYrOaDjuV+jlvezjD6Ey7YzXp/UkvRM r7VTcA1EzYQaRSLvMB/EoUCm4Y7vLyVaxqvLjup6m10NzHWWGWx4b3n0GNX29Y2qZ9 CYW8FTWzLTI4UpEKejX1hBcdDAH0bJ9aX6pnefslUTO6Z1/K3YQfyRe3zFuGgUYyKv GAi5IApyFLJEw== 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 v2 14/15] gpio: xilinx: Use modern PM macros Date: Tue, 18 Nov 2025 08:32:28 +0800 Message-ID: <20251118003229.26636-15-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251118003229.26636-1-jszhang@kernel.org> References: <20251118003229.26636-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused Signed-off-by: Jisheng Zhang Acked-by: Linus Walleij --- drivers/gpio/gpio-xilinx.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c index 83675ac81077..be4b4d730547 100644 --- a/drivers/gpio/gpio-xilinx.c +++ b/drivers/gpio/gpio-xilinx.c @@ -286,7 +286,7 @@ static void xgpio_free(struct gpio_chip *chip, unsigned= int offset) pm_runtime_put(chip->parent); } =20 -static int __maybe_unused xgpio_suspend(struct device *dev) +static int xgpio_suspend(struct device *dev) { struct xgpio_instance *gpio =3D dev_get_drvdata(dev); struct irq_data *data =3D irq_get_irq_data(gpio->irq); @@ -327,7 +327,7 @@ static void xgpio_irq_ack(struct irq_data *irq_data) { } =20 -static int __maybe_unused xgpio_resume(struct device *dev) +static int xgpio_resume(struct device *dev) { struct xgpio_instance *gpio =3D dev_get_drvdata(dev); struct irq_data *data =3D irq_get_irq_data(gpio->irq); @@ -343,7 +343,7 @@ static int __maybe_unused xgpio_resume(struct device *d= ev) return 0; } =20 -static int __maybe_unused xgpio_runtime_suspend(struct device *dev) +static int xgpio_runtime_suspend(struct device *dev) { struct xgpio_instance *gpio =3D dev_get_drvdata(dev); =20 @@ -352,7 +352,7 @@ static int __maybe_unused xgpio_runtime_suspend(struct = device *dev) return 0; } =20 -static int __maybe_unused xgpio_runtime_resume(struct device *dev) +static int xgpio_runtime_resume(struct device *dev) { struct xgpio_instance *gpio =3D dev_get_drvdata(dev); =20 @@ -360,9 +360,8 @@ static int __maybe_unused xgpio_runtime_resume(struct d= evice *dev) } =20 static const struct dev_pm_ops xgpio_dev_pm_ops =3D { - SET_SYSTEM_SLEEP_PM_OPS(xgpio_suspend, xgpio_resume) - SET_RUNTIME_PM_OPS(xgpio_runtime_suspend, - xgpio_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(xgpio_suspend, xgpio_resume) + RUNTIME_PM_OPS(xgpio_runtime_suspend, xgpio_runtime_resume, NULL) }; =20 /** @@ -682,7 +681,7 @@ static struct platform_driver xgpio_plat_driver =3D { .driver =3D { .name =3D "gpio-xilinx", .of_match_table =3D xgpio_of_match, - .pm =3D &xgpio_dev_pm_ops, + .pm =3D pm_ptr(&xgpio_dev_pm_ops), }, }; =20 --=20 2.51.0 From nobody Tue Dec 2 02:52:29 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E0E22FA0DD; Tue, 18 Nov 2025 00:51:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763427105; cv=none; b=FpgIAEid7QebG0dX0eX3gheAVv/ucHE09GnhGRguDL701RgwihjofyO5DnygET0n6em5NqV1c68foHMQtmSn232ISgOjP2s8Sg3zBsFi+MN0KZ5ZkDUIzlj5MsNKkegE/H9IibThpg2Sm4BT4pwUmmVeTGGhxNb/TVEvmlpuQfQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763427105; c=relaxed/simple; bh=FEK010iEOZpE1vC5lN9I/F/j5Wfem9fU26SaGIIbC5U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZiCItMovVUBGUM1RA4Kz6BSimcqoiOf/UVM7apQhJ6jwK05aZjTrKs2Qbe3DH61rWCOf64T65w396qMHOdLerA5ePa154MAi1k3oSNu4mc1NC58RB2L4lUIZ4ybw58mUAKTTbhNGsU2AXUhRcLRQfK6YU2GbxCglppedzmacDa4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=a3/V9coc; 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="a3/V9coc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09303C116B1; Tue, 18 Nov 2025 00:51:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763427104; bh=FEK010iEOZpE1vC5lN9I/F/j5Wfem9fU26SaGIIbC5U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a3/V9coc2bW6juf3h/XwPfkdiNfDKVgkLi8Gs2jaoUFWAdZzEd4gzUrMNhUwaZl5L z9rBmyrAGTI7TZl0sKobAaKKqDNqMtSf0uoLQSEVOay2YrTsIn6cPksc6rWm9CXtdZ QNaAs1gEzsuo/CSspc8/UqBpZVDQrevXIwtq26+RFr+J86q40KxbD54ZBMYpAFz9L1 Ipq35KA2QMx6OlvmijDpnH5Oa8SDVS0ByCnskVeS62XPdJUg62Vn8dWrDpHWOCF2/J BjwwK2bJM7FeKxN5+4Fe9kktZZavXITLk9R2l78QUd5R2nPABw78MdZD3h+VX/u77d ROKdh49O9xGog== 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 v2 15/15] gpio: zynq: Use modern PM macros Date: Tue, 18 Nov 2025 08:32:29 +0800 Message-ID: <20251118003229.26636-16-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251118003229.26636-1-jszhang@kernel.org> References: <20251118003229.26636-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused Signed-off-by: Jisheng Zhang Acked-by: Linus Walleij --- drivers/gpio/gpio-zynq.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c index 0ffd76e8951f..97780c57ab56 100644 --- a/drivers/gpio/gpio-zynq.c +++ b/drivers/gpio/gpio-zynq.c @@ -735,7 +735,7 @@ static void zynq_gpio_restore_context(struct zynq_gpio = *gpio) } } =20 -static int __maybe_unused zynq_gpio_suspend(struct device *dev) +static int zynq_gpio_suspend(struct device *dev) { struct zynq_gpio *gpio =3D dev_get_drvdata(dev); struct irq_data *data =3D irq_get_irq_data(gpio->irq); @@ -756,7 +756,7 @@ static int __maybe_unused zynq_gpio_suspend(struct devi= ce *dev) return 0; } =20 -static int __maybe_unused zynq_gpio_resume(struct device *dev) +static int zynq_gpio_resume(struct device *dev) { struct zynq_gpio *gpio =3D dev_get_drvdata(dev); struct irq_data *data =3D irq_get_irq_data(gpio->irq); @@ -779,7 +779,7 @@ static int __maybe_unused zynq_gpio_resume(struct devic= e *dev) return 0; } =20 -static int __maybe_unused zynq_gpio_runtime_suspend(struct device *dev) +static int zynq_gpio_runtime_suspend(struct device *dev) { struct zynq_gpio *gpio =3D dev_get_drvdata(dev); =20 @@ -788,7 +788,7 @@ static int __maybe_unused zynq_gpio_runtime_suspend(str= uct device *dev) return 0; } =20 -static int __maybe_unused zynq_gpio_runtime_resume(struct device *dev) +static int zynq_gpio_runtime_resume(struct device *dev) { struct zynq_gpio *gpio =3D dev_get_drvdata(dev); =20 @@ -814,9 +814,8 @@ static void zynq_gpio_free(struct gpio_chip *chip, unsi= gned int offset) } =20 static const struct dev_pm_ops zynq_gpio_dev_pm_ops =3D { - SET_SYSTEM_SLEEP_PM_OPS(zynq_gpio_suspend, zynq_gpio_resume) - SET_RUNTIME_PM_OPS(zynq_gpio_runtime_suspend, - zynq_gpio_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(zynq_gpio_suspend, zynq_gpio_resume) + RUNTIME_PM_OPS(zynq_gpio_runtime_suspend, zynq_gpio_runtime_resume, NULL) }; =20 static const struct zynq_platform_data versal_gpio_def =3D { @@ -1022,7 +1021,7 @@ static void zynq_gpio_remove(struct platform_device *= pdev) static struct platform_driver zynq_gpio_driver =3D { .driver =3D { .name =3D DRIVER_NAME, - .pm =3D &zynq_gpio_dev_pm_ops, + .pm =3D pm_ptr(&zynq_gpio_dev_pm_ops), .of_match_table =3D zynq_gpio_of_match, }, .probe =3D zynq_gpio_probe, --=20 2.51.0