From nobody Sat Oct 4 03:15:55 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 BA9C92D3231; Wed, 20 Aug 2025 15:58: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=1755705492; cv=none; b=ttzlBSTOWtSccItFAdySu88kqgv6PVXp+M7ESyEnsm8japJFsjVSrm6EGYtCae8SN3Ro/jq5IPXBfJ/yScjHgv+aaB1EFgDk0jqrM8eZLvl41fWp3i4+6+OSFZLbwByAPPIvmeejsKYwPDS2AeN+i1XfY/aKqYMJwhqyhAXtmIk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755705492; c=relaxed/simple; bh=2Y6pXY5C3fzYpd9lxWJ0ZagqNozVP0PkFBHNE3P4K2I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XIXmSGkYS4QlumTClusZihVb9/lUdSyd/pjhKpjrOsMVXIMzZK3cZ6yOwLEy5nnhsnI5yh4kPbeuFX5gWPD+V6I1oGLMRWORf7+02ooWDJnt0KTk8w0XKQx2MjrOZ4bUE6yYDumQCC7iYA5HWb4qTMalck40aK7FckiRdj+q1dw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FlWwG/6+; 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="FlWwG/6+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9FFEC4CEEB; Wed, 20 Aug 2025 15:58:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755705492; bh=2Y6pXY5C3fzYpd9lxWJ0ZagqNozVP0PkFBHNE3P4K2I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FlWwG/6+6E1DT25N7XcMNcfSJZkErGpZxNGhz97Dkv1SYq9n3s+mPI6kH9RGSaftL a7RbelbN65r34/f4YunyhYa90/w/doU+dKQf3fCQH7uAX6B2GTu9nGa+ewGno1Qo28 nK+OIuQf9yS+YxHVRakyMtYk1jQj1h6+j5mg8nptG7CbI+TFBgSXmc0wVC3QhqVhmM eS7tfTx/O7R8CoLN/6V5TkBd5GE0GA9wAQ5ByYk9ZO/PsKmp8KMU37kHvKWFhNMK8i 4UJ2qtuAF3fJGjjMxGTVOAXXgJJOz24Q1xXCja9lnFCU38V3xDatum4KmBnOMF5QNR s/ScKIGQmFjJA== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , Linus Walleij , Bartosz Golaszewski , Michael Buesch , 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: Broadcom internal kernel review list , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux@ew.tq-group.com Subject: [PATCH 01/16] gpio: dwapb: Use modern PM macros Date: Wed, 20 Aug 2025 23:40:22 +0800 Message-ID: <20250820154037.22228-2-jszhang@kernel.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250820154037.22228-1-jszhang@kernel.org> References: <20250820154037.22228-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. Signed-off-by: Jisheng Zhang --- drivers/gpio/gpio-dwapb.c | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c index 43b667b41f5d..d831e6c61566 100644 --- a/drivers/gpio/gpio-dwapb.c +++ b/drivers/gpio/gpio-dwapb.c @@ -78,7 +78,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; @@ -91,7 +90,6 @@ struct dwapb_context { u32 int_deb; u32 wake_en; }; -#endif =20 struct dwapb_gpio_port_irqchip { unsigned int nr_irqs; @@ -102,9 +100,7 @@ struct dwapb_gpio_port { struct gpio_chip gc; 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; }; #define to_dwapb_gpio(_gc) \ @@ -357,12 +353,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) @@ -372,9 +367,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, @@ -384,7 +376,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, }; @@ -509,12 +501,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; @@ -746,7 +732,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); @@ -758,7 +743,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); @@ -805,7 +790,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); @@ -832,15 +817,13 @@ 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, dwa= pb_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.50.1 From nobody Sat Oct 4 03:15:55 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 A58E4322A17; Wed, 20 Aug 2025 15:58:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755705501; cv=none; b=mAL4v7SWCmY+O8dTIy5gOsFH1u6L12YXYKBYYCbDa9NMQ1fvSPvgxr0Dx0X49BwAKDosV60YiyopfFnz1A5r6CL2Xkqr+SdzJIBwlTCkS3ix5FYdR7hwQ+5bBq0pMM6ICmGFNrBZGPvezwfpZRq0XNrBD1Qj5Zbrxa4hry3Gqtw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755705501; c=relaxed/simple; bh=aVoXTtsvhaosrLhSRxcZ+cIPb5uQPbIY1uKxiV2Spso=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HTz9WHR/bsLmfSF6PQFeQ0whJJQmRhExItYkywOUhi89MvVG5TiajthFOm69EwIk0fcajID7qmbvSFpAFHSTMbEWumPoDDEoEO7UfTNd8CWzdsQ5RCD80llc3r+PP0AKblvLaJXbYAqC5g4nvEmL8JhtKkom36B81UYsyN7tsbw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=O5dcz1Uq; 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="O5dcz1Uq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE431C4CEE7; Wed, 20 Aug 2025 15:58:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755705501; bh=aVoXTtsvhaosrLhSRxcZ+cIPb5uQPbIY1uKxiV2Spso=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O5dcz1UqdHbjUg+r49tsZneSmpjTus6c2ZMTVa6W0KwZVA5b79wV7LOJ75uiA169H msIA1UfdWjOghB/pUnOWYZwlXT2mcW3kZkjfBfhfmMfcbfolYAPP7uLJQZsTWmnglh Gs/nVyMG5uu+3FmwGulG9MRwKFh3OUZ90435U0exhAdH/XwG+3sOBzuEiHrWqk98iq 5vGvfHlI/2Cgo4W9zTkHE+wFbbC3ubVY549drBLDNvWIQimT/X01FQxT3o48souftF jfMm36jradpBwtN3tCsXpj2UMh4XPZTrUpAoHQepieIewDZ2GAnSrAaV0R5jsHrjN/ HY0MNLBPLnGOw== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , Linus Walleij , Bartosz Golaszewski , Michael Buesch , 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: Broadcom internal kernel review list , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux@ew.tq-group.com Subject: [PATCH 02/16] gpio: brcmstb: Use modern PM macros Date: Wed, 20 Aug 2025 23:40:23 +0800 Message-ID: <20250820154037.22228-3-jszhang@kernel.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250820154037.22228-1-jszhang@kernel.org> References: <20250820154037.22228-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 --- 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 e29a9589b3cc..0ca3e0d8aa46 100644 --- a/drivers/gpio/gpio-brcmstb.c +++ b/drivers/gpio/gpio-brcmstb.c @@ -534,7 +534,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) { @@ -573,14 +572,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) @@ -747,7 +741,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.50.1 From nobody Sat Oct 4 03:15:55 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 4B5C1322A35; Wed, 20 Aug 2025 15:58:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755705509; cv=none; b=gVKLVVZ111AjDDFrCf3iTn2qVZNYYi4WtLEm9iJ+41gZ+nhJnPedHJPlwRtCOBqjRHqRqanFkqqWs2H7zM/7rfwfHp6+Q13lUwzvz3OLC1PEtf/ONVmdnXsfG42xf/hcuDVD0OjXJnZHtDro5b+432nGGyNqJJ4npRgbFVcg/6k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755705509; c=relaxed/simple; bh=uoSbjGAjNpOfd1OcdZRXRKGUEQEMmIyMXjnKacIc5oM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=E1eCQzhrL+CaHFuD/f/j2uD37/Ztg9agzPzao1IcryF1W6OJBIa4SJXkRi/1sQLbLzf4UahytBqUG6hwax78Hq2TPi1UJUQxP4gb6WVSE/ccWTvKewsJkQdq56Af8/aZf7KHoaAOtrxzfIPCC+8ifDZWyXw6jhGhcKxqKO0gjGY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RMarVKiB; 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="RMarVKiB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 022F5C4AF0B; Wed, 20 Aug 2025 15:58:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755705508; bh=uoSbjGAjNpOfd1OcdZRXRKGUEQEMmIyMXjnKacIc5oM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RMarVKiBdQIuLgKwPfD13No3DlA+Kc8jorgjnuRyCKP94YwgFFJt2Lr7Aa0N1fTzV dRXrmIDwFF7WhmpixyqE3PLfYw5Ivct5fOm18+3VH0JhK2U/77LVg3UhuAdYZ5BDBV CpKOAuqIWVz8Zn54RxbTBPQgEtD0+LZOfeBgwwWxEKXS2JPjINTAUuZVd4TL46i8Wz YOoqhHtUo6AR43QkZ76fx4NljkrzsTx1kNCvxo+3TBykmi/4kRsYAEGxmuebwiSDZS Fyx17aG/S9b316OQKH13qhuoWGpsmO0IwWeZYe3hlrE+/sjsjEzIJjRMPpDjL5jTO/ zV13/GtnO1/HQ== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , Linus Walleij , Bartosz Golaszewski , Michael Buesch , 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: Broadcom internal kernel review list , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux@ew.tq-group.com Subject: [PATCH 03/16] gpio: bt8xx: Use modern PM macros Date: Wed, 20 Aug 2025 23:40:24 +0800 Message-ID: <20250820154037.22228-4-jszhang@kernel.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250820154037.22228-1-jszhang@kernel.org> References: <20250820154037.22228-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: Michael B=C3=BCsch --- drivers/gpio/gpio-bt8xx.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/gpio/gpio-bt8xx.c b/drivers/gpio/gpio-bt8xx.c index 05401da03ca3..5e120c4dfea5 100644 --- a/drivers/gpio/gpio-bt8xx.c +++ b/drivers/gpio/gpio-bt8xx.c @@ -52,10 +52,8 @@ struct bt8xxgpio { struct pci_dev *pdev; struct gpio_chip gpio; =20 -#ifdef CONFIG_PM u32 saved_outen; u32 saved_data; -#endif }; =20 #define bgwrite(dat, adr) writel((dat), bg->mmio+(adr)) @@ -224,7 +222,6 @@ static void bt8xxgpio_remove(struct pci_dev *pdev) pci_disable_device(pdev); } =20 -#ifdef CONFIG_PM static int bt8xxgpio_suspend(struct pci_dev *pdev, pm_message_t state) { struct bt8xxgpio *bg =3D pci_get_drvdata(pdev); @@ -267,10 +264,6 @@ static int bt8xxgpio_resume(struct pci_dev *pdev) =20 return 0; } -#else -#define bt8xxgpio_suspend NULL -#define bt8xxgpio_resume NULL -#endif /* CONFIG_PM */ =20 static const struct pci_device_id bt8xxgpio_pci_tbl[] =3D { { PCI_DEVICE(PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT848) }, @@ -286,8 +279,8 @@ static struct pci_driver bt8xxgpio_pci_driver =3D { .id_table =3D bt8xxgpio_pci_tbl, .probe =3D bt8xxgpio_probe, .remove =3D bt8xxgpio_remove, - .suspend =3D bt8xxgpio_suspend, - .resume =3D bt8xxgpio_resume, + .suspend =3D pm_ptr(bt8xxgpio_suspend), + .resume =3D pm_ptr(bt8xxgpio_resume), }; =20 module_pci_driver(bt8xxgpio_pci_driver); --=20 2.50.1 From nobody Sat Oct 4 03:15:55 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 9F497322552; Wed, 20 Aug 2025 15:58:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755705520; cv=none; b=siB/2D4Mx/QP+JUgKxekiD27golT+I5r0dNcdtoxUnyCXSYXaxJ6jmLyIYjEfqb4gRANbRUWzGGphiIMqGsQBVYpNYpkbUqxU0yhtMTA7QSJxPdQXGiYskFFI9Ba5JPXqIjuB1L7KnL5mWUWj5K/tGZwmj0zsyP8qEhij7gWBC0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755705520; c=relaxed/simple; bh=82OKclnpvuD5JTVMrBqlAJu0EBMZWMFAgygO3iLIMjQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bGPHapNOK3U2sNXNG0Gu0m17A4qvMc77RE2j8ggDt8eIh02sSLfjR310j2ul7n07PJJ2m2H+0+bL1etyBdABGzr4srW5b0pmimnxS6OrIKC++NWxIQgP4S8o+D6b7hvZTqNynxkIjYifgHbuO43H8CYWluaO6IAI5nttzvJaooI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=htY+Xgu3; 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="htY+Xgu3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AFC37C4CEE7; Wed, 20 Aug 2025 15:58:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755705518; bh=82OKclnpvuD5JTVMrBqlAJu0EBMZWMFAgygO3iLIMjQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=htY+Xgu35L1eDvFMvjtOBm4WrBQpGOHDGbBCSSz6VdfPGoP9FdppScKn94yuWQWag 1nNHhyJZJBhB8YC9TiUgrNmv2Dz/nQiD5UQ/juQKuaoFRifSJe9j71xvaVmwSER2wE Pow7aULI8LhAjCa6XUMRQLEzhiE0JUn8GcgihXpumV+9KzYBd7djpWdsyIuOehSLDn eBTYEV0oxpOPvrzqe6qj9PbGVPnTkLDG3VV+G2eHscgFqE0AzVXc8CSDwB/4v6oEoy LXnd8KjWiupyx2Gk4Bm9p+mReDUnitRD7oWYgQNhnU9kEdq8vX73kLKIelw3+g/c8p kO1wuvXmMNwCA== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , Linus Walleij , Bartosz Golaszewski , Michael Buesch , 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: Broadcom internal kernel review list , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux@ew.tq-group.com Subject: [PATCH 04/16] gpio: htc-egpio: Use modern PM macros Date: Wed, 20 Aug 2025 23:40:25 +0800 Message-ID: <20250820154037.22228-5-jszhang@kernel.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250820154037.22228-1-jszhang@kernel.org> References: <20250820154037.22228-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 --- 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.50.1 From nobody Sat Oct 4 03:15:55 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 63F5F322552; Wed, 20 Aug 2025 15:58: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=1755705524; cv=none; b=mhEMulAEZuHlLxYtn4xHUDRpxzIccjctZKp7VQ1ox8CdRWNTDkUNkqhIfuzcNMDRn7ql7MwQpk+fox+E+PZbf+Fo7wOzFJ2jZW/FTZieNsXKEBG4SCTAXAY6Xo5Zw4Yg/MyxPn5pkZu4xzKn9E5nveESSd8C6ytOndxSTlI3Oi0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755705524; c=relaxed/simple; bh=eaC5Mndp+PmBWbuGuWerLDsOlSXZFVRbJRhuoDO7Lrw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=h4y6UhOXjDyrO/ao5f5FJogsPSJnr3cv5UXxaWPRYJQW/0CEcPADtL4Kekk/aWCMzo2yppFfmmfWULhd+fApCQLhdrV+zQuAl72fBkLUC/lpE5TZBgDSOICGUV//0mCKR5xZM00NIxDa3ZE/3sFT/7B60U92lu8Pp7S605iM/vA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AZTEIJLx; 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="AZTEIJLx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A8E4C4CEEB; Wed, 20 Aug 2025 15:58:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755705523; bh=eaC5Mndp+PmBWbuGuWerLDsOlSXZFVRbJRhuoDO7Lrw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AZTEIJLxD4mBWLOWCTkpbDA7AfdLuBY2oOhqxRG24Ahper15tdfkkifUydndnRl7U 6GgLJii/FLsxDEqhzyfHOOvyvhqP/erXCl5oNohAmqMMy3Jq+1bSjf7vMHQkpJrJJ0 aR0DyGZji2JrEIlOyiIN6jku3VK4nqWzrOf1NXGJFG6s48iQw5XkrZr6ywMvoOTmJE dz3Kzn8oHgpivKyv0FEXJ+bNUDxYdewAmJapOU5jOnk12AFLrwuy/OqA7MtHaRRdeI jeqPxjB5K4XeI4nCC6MHEONj0CP9b55ImpQ+3cZkl9wCQbpWuA/vi6KmP+Esq/Dlyk VUHt0Cx703AKQ== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , Linus Walleij , Bartosz Golaszewski , Michael Buesch , 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: Broadcom internal kernel review list , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux@ew.tq-group.com Subject: [PATCH 05/16] gpio: pl061: Use modern PM macros Date: Wed, 20 Aug 2025 23:40:26 +0800 Message-ID: <20250820154037.22228-6-jszhang@kernel.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250820154037.22228-1-jszhang@kernel.org> References: <20250820154037.22228-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 --- 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.50.1 From nobody Sat Oct 4 03:15:55 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 23170242D72; Wed, 20 Aug 2025 15:58: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=1755705535; cv=none; b=PRCVKQlNd8Das6EcM8WvwQ/DqlYMa3YgwfWiuMeG4xOQ112X5pAI3e1KIvpvOx0IOz/Fe8yjAii3c+5urffkYevehui7fEvREWwHtlzIF7MEHvavaw2Km/uyO4WD1CDU9vPaR1IL09D+n2wWp48wWKJVYu8zzNoxuP98RnqUj1A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755705535; c=relaxed/simple; bh=oPqtKgFreHnLsUNC2EY7WHHjaSeINUT8RuOawyyZA5A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TG2bExloS7Tpys41XqvG//pMlVoqDW64gTi0Pomqyt5nRAOOUbr4pZxI+Rvt8rP+cM1yROqbdUQMD0bPXv3+q/vAmG7n9O5th5+eco/qRZoIKFXHAM48HvnZsVmaaJF/T7q39EYzDTKJNKTIfdPqqXf6ZcQj07FtFKGmiN1vuZY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZkZkH2wB; 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="ZkZkH2wB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D5B3C4CEE7; Wed, 20 Aug 2025 15:58:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755705534; bh=oPqtKgFreHnLsUNC2EY7WHHjaSeINUT8RuOawyyZA5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZkZkH2wBzqw6wGRB5skSUnmXedvk5OgGjsCW4k/UVKgQeWK0RTDu9YWTYizL1nPYJ 9p8wx1jNTci75I8/TYE8CTalbUKTpEjcCd2XrPATbUF6Kb/UKgAWjI1yHjxQcwR4Fk rX7DSnyqpSpZK4wgXRuNQsF3ovroyfQAlvVZBbQlJbTVZmEINAktLdEu67Fm64/qri hA6fxX60L/MyI5tf+uiZd6T+mpUFLHUuoyIM1ZGvCAAYGmRrd2JoLS9sb5KOriWcUC OPTc2NxJcQz33eQkssFTNCFZabFQphaTjjO36jRIcLoqD1Abgvi7dMw0JEAC10xN2R 2HWvFsB4wrA9A== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , Linus Walleij , Bartosz Golaszewski , Michael Buesch , 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: Broadcom internal kernel review list , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux@ew.tq-group.com Subject: [PATCH 06/16] gpio: pxa: Use modern PM macros Date: Wed, 20 Aug 2025 23:40:27 +0800 Message-ID: <20250820154037.22228-7-jszhang@kernel.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250820154037.22228-1-jszhang@kernel.org> References: <20250820154037.22228-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 --- 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.50.1 From nobody Sat Oct 4 03:15:55 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 92D8C264F81; Wed, 20 Aug 2025 15:59:00 +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=1755705540; cv=none; b=gf5EJeriBk0VFaAm8h4Gxe3PZQg6c7V1C00OHTxJWZjaqmgLZxPUDuMQkN0SdUf9xTAvyKLN4xOqw24K1YO8AGfh9PTI/wQuROhI1rUtkDUSOfhMBAuL161cvdGZ/3OkpgrkpHVCLcA2UkbhGsmet7MSNRB6C8zd970h7zQeWa4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755705540; c=relaxed/simple; bh=3yUWsIxkW8qzK5gi9AtNqttGslx05/6Cqkuua0jSepg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PbooSCxmKlTp//ri1nSiBgG2oa19OTsS1Wp8r9MEkxDf7DEyIWw1J4QplmyTf9SwzxjFSYUgqShidoAmXyhTi6ggyTS6JsUTgC2yJFtoZrOtJYgVzGnGbCBXpOExuX9sAmv1z9kYN4FBdAVDs+FBm6rZlq6ycgW18iiPXFOG6UA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mpYjeVFf; 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="mpYjeVFf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C750C113CF; Wed, 20 Aug 2025 15:58:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755705540; bh=3yUWsIxkW8qzK5gi9AtNqttGslx05/6Cqkuua0jSepg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mpYjeVFfuND3nz/WtpBTs8CSNdLRsPHIRLDTMSdozP6kGI7Gtj25iygIgYRBwNaOy /eKLo8WA/gRRvPpPhXSW5HqgLCSjc0ps4UnjzhG3QfHczjUKspCgyEMwKnun6TvDry DBRCmmREWc5H3yzP+h5pvCybcFMarNnofKhZN3hseLT8fXyUAY5b0NlEjRRiDR8Lot zu90HmaZzx4aBrRKQvll0EAXNnLL87M9gS+x4iLJVT7TFdV96bdWxtdEC3DRdC4Ixl oQFdP5ggs5YAQDagfjoKx5dlrlHvLITjd1QiuYBR9OQG63j44YXO4b0rlK1L/vT6yR nsd6hJIUhxcCA== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , Linus Walleij , Bartosz Golaszewski , Michael Buesch , 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: Broadcom internal kernel review list , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux@ew.tq-group.com Subject: [PATCH 07/16] gpio: ml-ioh: Use modern PM macros Date: Wed, 20 Aug 2025 23:40:28 +0800 Message-ID: <20250820154037.22228-8-jszhang@kernel.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250820154037.22228-1-jszhang@kernel.org> References: <20250820154037.22228-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 --- 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.50.1 From nobody Sat Oct 4 03:15:55 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 6CBEB1DDC33; Wed, 20 Aug 2025 15:59:09 +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=1755705549; cv=none; b=gwwoH0SBbzOUKuQu5wHZW9XGencxGt2jb/v7RKr4XfFjL14p72Bq9+PIdDBOXteiSq1hSI18A/f/NygW+VnqsbyOnOWFAyyUQHfDEaX1aZvgQC9KkFTBxwkWcghR911HmsjJJafZel95ltLhDjQ/och0IlSDCnikezU/V/8tGNs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755705549; c=relaxed/simple; bh=Btlz6e0m5nsKlm/WiyEAFlAcvcNJrm4cKvgRCdFu898=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MO5h+ZW2WIariK+Ogs0TPETIhntHoHHtUl88B7AQfXyA7H+hvfiHujaJ3Z72MGCrvJrKuRA/iGF4GIasej6wCz7cRX3rtiZyyh1Qjtq6QUCE0Tcmoq4qkDiMx2z5TI/7qsDOzIXl0a40NR+iOQy3SCvmmwLaX344Z7TM4wiM1EM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=o+AdY+vS; 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="o+AdY+vS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3910C113CF; Wed, 20 Aug 2025 15:59:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755705549; bh=Btlz6e0m5nsKlm/WiyEAFlAcvcNJrm4cKvgRCdFu898=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o+AdY+vSvwyhTwbI+H/jBNGpY/E2Hr5ZSVxwGBXnxBEFEuDsow2eYFvlsqpt9IH9g zvyQ15X8ZGKGKYB7FscQFyKkuDtOjArVt4P0P6Gz6rX948+V6pcRpZuVhkhWHrgM1t 3JKzVMhpLw/vJElHd1AdUcQ8jJyyyR4qPNAvjt3tLpevr4hsB5HwY2OCBLCWMach9Z pnnwsJiqM6t/jEqjjplonyMNDpkqHKQRRyGLFDBfUoZUoPQYcmhU5GIrM7woNaXJE8 RKS+D70JGCQhMMf3lK/yJZ44b9bih3xnrzO1rQqzaIyaIgUHxwXqFtdpbcU5Y6lWWK s4eMWm/x63W7g== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , Linus Walleij , Bartosz Golaszewski , Michael Buesch , 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: Broadcom internal kernel review list , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux@ew.tq-group.com Subject: [PATCH 08/16] gpio: mlxbf2: Use modern PM macros Date: Wed, 20 Aug 2025 23:40:29 +0800 Message-ID: <20250820154037.22228-9-jszhang@kernel.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250820154037.22228-1-jszhang@kernel.org> References: <20250820154037.22228-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 --- 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 390f2e74a9d8..f3112d949195 100644 --- a/drivers/gpio/gpio-mlxbf2.c +++ b/drivers/gpio/gpio-mlxbf2.c @@ -431,7 +431,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 @@ -443,7 +443,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 @@ -454,7 +454,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 }, @@ -466,7 +466,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.50.1 From nobody Sat Oct 4 03:15:55 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 A1C161DDC33; Wed, 20 Aug 2025 15:59:15 +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=1755705556; cv=none; b=BBJBwn7eC3Y4YtqAKGxufAGFwJAZiGzTr9aRbW5cfa6IK7TzuDv0Br1bHiR5su5a5ftRW0LolbZoMKXV/dtXjdGxjVDZBDjFJKT/AJQLxwomZb3d7SONtL0iPEhsIiswPBgvTIrGS+wWRoVhjKPQ3NuegUqWedZKC2joyqXzDAA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755705556; c=relaxed/simple; bh=wkl4DXPPdGwmHjimbd9ZFWcVgpEJQkpRzejBsRDeBw4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N9qdQvQwrJmy/nDfxX2sQqZCOVP5pMk2yZnkdNJ9Adkip3GBJjMAozGYRmXEmOFZRLrk/P9zPHFhmOd3cBN9pAj+6p4B7U+hkcRJWA1H0heaBEp4Yseh98B2nQkYyRiBzkd5toqdkEiaZmcGV3BkcHeMxE2PWBd8Qd8N1bbXHpQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lRolVLcS; 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="lRolVLcS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE8D6C113CF; Wed, 20 Aug 2025 15:59:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755705555; bh=wkl4DXPPdGwmHjimbd9ZFWcVgpEJQkpRzejBsRDeBw4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lRolVLcSW27Lqstu8xK9aeo87ZQJtYgMERie+2UpOGzDIPFx0bF+4GS+xp8Dc1wye 9DaZNaKDAKiaUA1GcDQ6UjSqGibiSuhyP1PLCGKhXIYTqVeTk/DOolMnOiwZ1KeyVq UwK+SMLr3PYFku2bBy5XTe5VPJN6f24dasxmWRBzkuuCXEZXYdW8GGjKCH4afscL5G WFpfzcxqS7I3zp1pRUFNgWDeWMCYUC3c9Hl6QmnFGjMMOz8n7vINvyIFveF028/cTY IOplQneAIXen6mstXfM9HCoVSnTx6PfN5WgKHaI/mWezld00EcjYVo5mj2GMQlmLBr IlAORuM1lQFfA== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , Linus Walleij , Bartosz Golaszewski , Michael Buesch , 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: Broadcom internal kernel review list , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux@ew.tq-group.com Subject: [PATCH 09/16] gpio: msc313: Use modern PM macros Date: Wed, 20 Aug 2025 23:40:30 +0800 Message-ID: <20250820154037.22228-10-jszhang@kernel.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250820154037.22228-1-jszhang@kernel.org> References: <20250820154037.22228-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 --- 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.50.1 From nobody Sat Oct 4 03:15:55 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 B3A81322C7B; Wed, 20 Aug 2025 15:59:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755705561; cv=none; b=h5vU/aBP13/TOrH85e7M8oMFx1X9bPjNs2EI/QX6bTh7qOnVHuP6oqebS1QFd5MyDWBLTBzSw5qLoo1xX4O0tZ3WDWZ2K5yKZjQwEGfR76bRP+l0En3Igxsh46VmBRf0MpN3InciyaPyll/oBPaffpmDbxGuBnIhffynprPvaQk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755705561; c=relaxed/simple; bh=yEJaUBUTN4hvB89PLKjHtmlEyvDkPTpFPCPmwYFo0u0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HgmqypVLxMmJzItHd1enxV345DCp3+O/Jb1lLErmkFAld5A2rw2z2As7oXy62hWg3/0C2pY4sfVpMD1ALeQrjTaUYXGL7yQvhkI+Gv100Sh57UGhwv4xj55pEaYZAY6dftpD16axoWLl9juQqegpm2kAiEZX3HVVSX9C9n6e5QI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PAKxbBRB; 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="PAKxbBRB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 924A4C4CEE7; Wed, 20 Aug 2025 15:59:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755705561; bh=yEJaUBUTN4hvB89PLKjHtmlEyvDkPTpFPCPmwYFo0u0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PAKxbBRB6y4MiWqzIC9/IKG063AAn4UisoWj+NW5+PKN4Lnw3RS8OyyQlPQJA71G+ uWhLx9dX47v9vzCZ0QL4gY/Dey+ZH1Xx+lLxKPj5NOMYmVw0LturTgVTb63dqpyn7T lwOkC1McWsbh9PKkhwtRcLEeqG8k6c1X2LjLLlq+vdTzgXj2SRO6IpwmtmhN65XFz/ GFGPNKvbKDtfEWu3qjr4StyrDgGCE4cHt8PYxrAjSwFFcTG/IlLvTcP52gyP7vb14R zoY6H1o63UnUewYeBa/7fWYAnVufHicPVrF0uk/qAYxgqrgjgYRT0o0TH/578PVC2r uDeVI8e2mGGlA== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , Linus Walleij , Bartosz Golaszewski , Michael Buesch , 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: Broadcom internal kernel review list , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux@ew.tq-group.com Subject: [PATCH 10/16] gpio: omap: Use modern PM macros Date: Wed, 20 Aug 2025 23:40:31 +0800 Message-ID: <20250820154037.22228-11-jszhang@kernel.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250820154037.22228-1-jszhang@kernel.org> References: <20250820154037.22228-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 --- 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.50.1 From nobody Sat Oct 4 03:15:55 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 85B75322766; Wed, 20 Aug 2025 15:59: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=1755705569; cv=none; b=AZp3VhpTiLfamYsKq+70/EOgLib5JyRFx6ZdPkY7bdinL6nziXJWML6bUl5N4I7Ed9tUSXscENZheecL5Y5thI5CHlcvX4IEkMWMAhhUxBU/cig3U3FJoF3ad7yX5OhZW7I474P7NdJ0Q78DQgkRISNHTF55V+XyOt6f2iuEBf4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755705569; c=relaxed/simple; bh=Y36HuswNodbrKyVb7di2itIAsIENlff5yeL0ohIKL+c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nRK8++pMnvCR+oUXQJfjSYgYYSJGu6U6/+Y94Hl+QIaYo8rL2ZSBSLGUhyORX6FhPLhYvJ0SKtI6AESVx3U/aebVk0sFMbC0wk5sdBzEsQ6NrbESo69MFLxPRg6vnBf5v55fkweKZRy9sZWBb9+hFL2HtdvwTaOOazCmpa6wr6g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dhnIqRFb; 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="dhnIqRFb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C13C7C4CEEB; Wed, 20 Aug 2025 15:59:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755705569; bh=Y36HuswNodbrKyVb7di2itIAsIENlff5yeL0ohIKL+c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dhnIqRFbolFKv669g/NhMWBFRHr/HWpQODcjF/txYp2sHqjmyPE+idjqIBAmjca28 g8JbQObc+iVBY4jupekGiywCUR6Jsa7Kr4b8rzbcsUWiMkuK8dHObBKor1ThgtfsZo ZPbooLJ6ONssJHGvDUC1BJxKjvYjjVCZcvFeUFKaZ9JfgfJ82Iyg/dUO+DcoRuq526 62TCon+/GRMSRZWRGCCTmFi1bHBY+1soNPeSq9t/3aohhWz8+58o7ce9xumqlRUMm+ 659LoLVxp+YgMM15sJbMO1BS7EIiJKHCKhFXSHa0LeLpBk3StrPq3kLScaHxkM10w7 c4pDUY86uymLg== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , Linus Walleij , Bartosz Golaszewski , Michael Buesch , 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: Broadcom internal kernel review list , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux@ew.tq-group.com Subject: [PATCH 11/16] gpio: pch: Use modern PM macros Date: Wed, 20 Aug 2025 23:40:32 +0800 Message-ID: <20250820154037.22228-12-jszhang@kernel.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250820154037.22228-1-jszhang@kernel.org> References: <20250820154037.22228-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 --- 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.50.1 From nobody Sat Oct 4 03:15:55 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 87DD0322766; Wed, 20 Aug 2025 15:59:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755705577; cv=none; b=UmK9hrIwPVshJhp9MaB1a21F12MW3ueRtNEDJlcNECbFOK2dNOZcY2hqghA5N/pUsnSwZRo1XgBtLG8TB85jp+XAdmwHqcDs7wsSFQrYnKoJbnB4yYPYKCR7v6OrjJPH3ENohvo0oWc8ai1pGOwMTsD5/RyIY+czUsmNTw4cLCU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755705577; c=relaxed/simple; bh=Umn5vwhGD2cJbBze7Y+K5YYl5ku0sduec7+7WcHtJDE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kP2gEPr8iGwjG0DXPpzZcOG7N9PMeoefC5uXmJemGc3NMF5FVw5wV/9V338BpaNg74J9fLAyb5VzkBYcWUtr6SM1WBoKZAk8GEmY6pmTUHCDHK0kGY6lhOw3KQIwTBUEnNlH+DIUuum6luMa5ji02+krH+Gidz5DErMsVJZKCd0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YJB7FAyJ; 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="YJB7FAyJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D717AC116C6; Wed, 20 Aug 2025 15:59:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755705576; bh=Umn5vwhGD2cJbBze7Y+K5YYl5ku0sduec7+7WcHtJDE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YJB7FAyJmFIy/7bU6Y6i71u2o8MXfowgFrIDXqIk6YPIU/lj6nyoRUOXhv3daXST0 1WRNZLp8D+8M12Ww6v0xaiKqbZ63Ay2gkgmI4XLJImrTQ58j1Ktr1AV/0XU7MPpyWO bIUUL54nRyeY4an1pQCOq2T+0U2v+YdeUlvRUC0gRRY5tcz7O9RNA83vs1smq6pTtb A2BvVA9odZs4EQO3oT9BnUBbeydgFtP9ND05ez31VZ7aI67jCIPD03JgP/shTTLQcv BODBh4bhLBUxCtWuwnlTENxKEq9nErah3SNyaWQaaC5wifuk5ZY5pBZ1a9928FT/RG MVIS2LTeazW6w== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , Linus Walleij , Bartosz Golaszewski , Michael Buesch , 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: Broadcom internal kernel review list , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux@ew.tq-group.com Subject: [PATCH 12/16] gpio: tqmx86: Use modern PM macros Date: Wed, 20 Aug 2025 23:40:33 +0800 Message-ID: <20250820154037.22228-13-jszhang@kernel.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250820154037.22228-1-jszhang@kernel.org> References: <20250820154037.22228-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 --- 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.50.1 From nobody Sat Oct 4 03:15:55 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 86D6F322769; Wed, 20 Aug 2025 15:59: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=1755705584; cv=none; b=PJvmvHEHz0G0wD+HFVZcvBaPRODEgZQAn76VfxYIOX4z+/lVbw7DlWm9Zfc8g+/+dCMiK6Q6eIt80Z3gB86sWg1a5A+jtMs6r8kpRHUbauYUTSGvgmSdFM1mGeViY10aFd/KYz6FTSa/tcZs4Vybx8ms1bROBW8D7Uu02MN3Opk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755705584; c=relaxed/simple; bh=fUBvkDoKUMnEXdyxqRdGgiK6Oe8z9HAnOskAEd9VzaI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=h75jsQThYTg+agnq1xg0uLN31XRi9RBt/tA4EIOd0HxDedqsn1OBKMXnk2Ja0leE/kAuLNzWPT/Y6C+UCjwnILGmXwPh9TKDtxjkJ4wugE6VS+uoOYOoBPzy08m250lOfToLD7FDFj9vHjFiR+uDRBn4VJfiimsKzClhpGU4lGU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FZfBAqZm; 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="FZfBAqZm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C6A1C4CEEB; Wed, 20 Aug 2025 15:59:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755705584; bh=fUBvkDoKUMnEXdyxqRdGgiK6Oe8z9HAnOskAEd9VzaI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FZfBAqZmnAwyBbNiE+SqetenHZ5sUFd97H2/FDMlumLzSMvbRqWlBnuL0CrSepOK5 6O1ytuAIBK9CRmm6QXXx+Y8gCd9RjymlHLkdxe5ZQHcKwxkQ87SGLJ3qu47fP85Xyg MXuvZ1P+DngqxQSER5BC8Tt6VDl/iPZ/TjNoE5bxGQb6flAc6Xt6BHuQ4G2OoHByTP kvfKPf7i0xIxk3wR26V3zTAhbBZ/WV+WVHJieJCZ27NJunAiD9WzAkHSsBSFsFON9J I1IjlxobIGpgU8PV4fwN0lPy1nqS5Ydoo50mC3sn0NHsvn+T7N8AbL4gGf5xH6pHAD Fruq0nsVVs6Zg== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , Linus Walleij , Bartosz Golaszewski , Michael Buesch , 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: Broadcom internal kernel review list , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux@ew.tq-group.com Subject: [PATCH 13/16] gpio: uniphier: Use modern PM macros Date: Wed, 20 Aug 2025 23:40:34 +0800 Message-ID: <20250820154037.22228-14-jszhang@kernel.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250820154037.22228-1-jszhang@kernel.org> References: <20250820154037.22228-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 --- 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.50.1 From nobody Sat Oct 4 03:15:55 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 AD1C7322A30; Wed, 20 Aug 2025 15:59: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=1755705590; cv=none; b=YekFcj9lrR6ZoYwZNTrN9AJgNQyxjBspXJ33CQwG/6GR7LJ/USgrnkb+SDLXA9IPwTzjVyf06AUH7oqRmlUm14r+xS1/El3twfS5IFsI1tbd8O48UP6uZRUR07nuVrgRNslhX5Q39mXd4jqGORMcfW46K+L60Se57IkTvjtyyV8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755705590; c=relaxed/simple; bh=Vtm9o+lfZgJz6qZfo2+Y/aRAO42PD5GrpWRB3GXupms=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KYq+/xc7VAujNhEo1Mx47F87bB45bDVBU1xf51/mqYfWShB7WVDfKqsZqK5RKmDkJMtMtEPngSXt+deDZTK8lxWHeScs6Aa5irSX946w2k54XeO6d3ZQ3IJidoYuNKdDn1qRxbAdn9Yy/9HpnxC5Wa9tJpjSNEHStrreuYalU3A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lnwdob8u; 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="lnwdob8u" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80B94C4CEE7; Wed, 20 Aug 2025 15:59:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755705590; bh=Vtm9o+lfZgJz6qZfo2+Y/aRAO42PD5GrpWRB3GXupms=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lnwdob8u7vTynCCY08iaw4u+A4csAK/+9v91WXwx5pSJS8RKa0s+gVtJFFqJoV8nG ecYTWvN2zxAoRrBS/8BbfeXhlTLj9MspmzIISHJR7TcpJL1eEIFI7IvKnaIqBQ8o7d hbtWG08gwGGYa/3wyniAqDLfJwt65LifrNeDftfn+f/qnFyyw8ZZbSAlGQJc3ZhFA2 BMOlcJXpD5fy6el5tb/e+AJMspA32ZnIifuz9EcfPc4oK/UvmRzBgiXE4fsEmLtDk1 YpDpsC7MmWrUYU8Lt1rzJLdNJOMpqZV6CQ24lsFProTU8+aFDTnZ1sfm0F5TjDIm2k mDtth6r6t+rMQ== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , Linus Walleij , Bartosz Golaszewski , Michael Buesch , 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: Broadcom internal kernel review list , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux@ew.tq-group.com Subject: [PATCH 14/16] gpio: xgene: Use modern PM macros Date: Wed, 20 Aug 2025 23:40:35 +0800 Message-ID: <20250820154037.22228-15-jszhang@kernel.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250820154037.22228-1-jszhang@kernel.org> References: <20250820154037.22228-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 --- 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.50.1 From nobody Sat Oct 4 03:15:55 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 B50832E8B60; Wed, 20 Aug 2025 15:59:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755705595; cv=none; b=Z58P34j/VSF/pXgvx+FH8GV9mIaycx3bV8i033rcbeticrf3i9s+/LCr2jVTZJ5Ck+rkm1F/j4ktucxcoBG9r2A4MI7NiwUsL3b/XHSMihWrzrEb0Ah9EUSzgTxRX4ZLWNAz571tkRqvIbpMzMHXGm53me5HtzpsbDYu45ttlAY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755705595; c=relaxed/simple; bh=uil8ZdRjg4HFrRJeLS26HOwIZusTXb+xLTXvjBw8om4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RkyRHMkRRWmxw5acWopkrbqy/RMhOOa1p729vhz3IXXWmDFqOfsqTV1IrSLgnm80SWnQ7Evz/FIuodnM+JfYmDkLfmkIXPBbyLo4tGj9TgT1we8RShD2xpUFP+ARdpUOkz3Ec8NZa7xIvRTqaMADeAFXoaoT3A5BJtkAl9nKip4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Dzj53rDi; 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="Dzj53rDi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF6C9C4CEEB; Wed, 20 Aug 2025 15:59:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755705595; bh=uil8ZdRjg4HFrRJeLS26HOwIZusTXb+xLTXvjBw8om4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dzj53rDiYwXvWskMsVLAaz4vmIFVf5W8xckeEZ/ZahMIv02o2UU7KMUO1IFwTJ21x dYKdxngWr8sb8tXV99EgmwY4Hz+YlETAlMEZK3dOtrep5IqwjmN5a2RkHW8WO9jfwh 7JvN4FO8LwSH+CFm8JT2ye+XZyUyDIPtOOLw3T5dgzB8+PoVvFf/Oeu7GvDz5U0/3d evfCspyI87F/IjzqI6GVaWniR1G3ldgqEic1CCSWGnnV9xxODKFnt+7FTtdJdX/Upi AOlfN8Kg8GgB02PXRlz41Mfk0i7qGaQvitlyERI1biLUhbsEG16QjlsiIoizFRQHz3 o/eGiYnrQoJFg== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , Linus Walleij , Bartosz Golaszewski , Michael Buesch , 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: Broadcom internal kernel review list , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux@ew.tq-group.com Subject: [PATCH 15/16] gpio: xilinx: Use modern PM macros Date: Wed, 20 Aug 2025 23:40:36 +0800 Message-ID: <20250820154037.22228-16-jszhang@kernel.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250820154037.22228-1-jszhang@kernel.org> References: <20250820154037.22228-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 --- 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.50.1 From nobody Sat Oct 4 03:15:55 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 191F432A3CB; Wed, 20 Aug 2025 16:00:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755705601; cv=none; b=hYRy4f2r4u0OLDX/8LokgTzXMJqpiy6UiGhxcH63WunIDeQkUOtfppX1s2fbNpFK41SCwKhWQJO6x0ak9uGHLTtP4/yqLBHvl8+rbcVqQ2urK1Ey2tu0HlD8VlR+5IS1sVIQVQAlShM3cRVYBflfn2icyQVL/Kd7BgMhTg2Boo8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755705601; c=relaxed/simple; bh=wHFSb1bZtvy7bJwCvAN3VtGhrtPRA/Tjh7espCXZR84=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uJmYyZb0FfyAozM7ZJnQY8iP29oLQod39S5oEUvUM1hawvp65QAJbeB4GlslzFeg4UZUZC43TSe1qblP93pG3Q8iDPWYxHuj6YCDeqA1UDs5T6L/aUhOAF3hBS+QK7Hw3N5LUdP5Ua15KnmH+l7I/CivsTknsVpSXBH5gAVpTdU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=A1sKxQm4; 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="A1sKxQm4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BCC87C113CF; Wed, 20 Aug 2025 15:59:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755705601; bh=wHFSb1bZtvy7bJwCvAN3VtGhrtPRA/Tjh7espCXZR84=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A1sKxQm4nmw0y+QfAPmizFtp5StLPVSaHQs2YUdgSuKtb0JX9Yqz37sysmxQXXHkd ogZDk5qk+AnPG11QIyxzoR8vmdf7YMQTPahlUHgCY36vTxs51tt+L2vt7d5EibjDkE +bytGQuuA6MOCwxhIonHm91Nh7rk/DSp1G7kiSWlaY2EVPZjWU+7m2i+y4z3f9wxbR N/uHminvOxv+A+IQh1yPUuMF3MlSK7mHOz2e0mweJCsgAUrqbDNIH5xr29Jo38bGiL f7jhTqKBYlUr7kzKAAevbYivp84HhTqfyjbR83fGHH7I6d5SO/PeN6IF6N93WEEC1L QHkplLgY/1j+g== From: Jisheng Zhang To: Doug Berger , Florian Fainelli , Linus Walleij , Bartosz Golaszewski , Michael Buesch , 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: Broadcom internal kernel review list , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux@ew.tq-group.com Subject: [PATCH 16/16] gpio: zynq: Use modern PM macros Date: Wed, 20 Aug 2025 23:40:37 +0800 Message-ID: <20250820154037.22228-17-jszhang@kernel.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250820154037.22228-1-jszhang@kernel.org> References: <20250820154037.22228-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 --- 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.50.1