linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] pinctrl: at91-pio4: remove #ifdef CONFIG_PM_SLEEP
@ 2022-07-04 10:12 Claudiu Beznea
  2022-07-04 10:12 ` [PATCH 2/2] pinctrl: at91: remove #ifdef CONFIG_PM Claudiu Beznea
  2022-07-11 11:52 ` [PATCH 1/2] pinctrl: at91-pio4: remove #ifdef CONFIG_PM_SLEEP Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Claudiu Beznea @ 2022-07-04 10:12 UTC (permalink / raw)
  To: ludovic.desroches, linus.walleij, nicolas.ferre, alexandre.belloni
  Cc: linux-arm-kernel, linux-gpio, linux-kernel, Claudiu Beznea

Remove #ifdef CONFIG_PM_SLEEP and use pm_sleep_ptr() macro instead.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 drivers/pinctrl/pinctrl-at91-pio4.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c
index 517f2a6330ad..82b921fd630d 100644
--- a/drivers/pinctrl/pinctrl-at91-pio4.c
+++ b/drivers/pinctrl/pinctrl-at91-pio4.c
@@ -237,8 +237,6 @@ static void atmel_gpio_irq_unmask(struct irq_data *d)
 			 BIT(pin->line));
 }
 
-#ifdef CONFIG_PM_SLEEP
-
 static int atmel_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
 {
 	struct atmel_pioctrl *atmel_pioctrl = irq_data_get_irq_chip_data(d);
@@ -255,9 +253,6 @@ static int atmel_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
 
 	return 0;
 }
-#else
-#define atmel_gpio_irq_set_wake NULL
-#endif /* CONFIG_PM_SLEEP */
 
 static struct irq_chip atmel_gpio_irq_chip = {
 	.name		= "GPIO",
@@ -265,7 +260,7 @@ static struct irq_chip atmel_gpio_irq_chip = {
 	.irq_mask	= atmel_gpio_irq_mask,
 	.irq_unmask	= atmel_gpio_irq_unmask,
 	.irq_set_type	= atmel_gpio_irq_set_type,
-	.irq_set_wake	= atmel_gpio_irq_set_wake,
+	.irq_set_wake	= pm_sleep_ptr(atmel_gpio_irq_set_wake),
 };
 
 static int atmel_gpio_to_irq(struct gpio_chip *chip, unsigned int offset)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] pinctrl: at91: remove #ifdef CONFIG_PM
  2022-07-04 10:12 [PATCH 1/2] pinctrl: at91-pio4: remove #ifdef CONFIG_PM_SLEEP Claudiu Beznea
@ 2022-07-04 10:12 ` Claudiu Beznea
  2022-07-11 11:52 ` [PATCH 1/2] pinctrl: at91-pio4: remove #ifdef CONFIG_PM_SLEEP Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Claudiu Beznea @ 2022-07-04 10:12 UTC (permalink / raw)
  To: ludovic.desroches, linus.walleij, nicolas.ferre, alexandre.belloni
  Cc: linux-arm-kernel, linux-gpio, linux-kernel, Claudiu Beznea

Remove #ifdef CONFIG_PM and use pm_ptr() macro instead.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 drivers/pinctrl/pinctrl-at91.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index d91a010e65f5..5e3a2f4c2bb6 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -1615,8 +1615,6 @@ static void gpio_irq_ack(struct irq_data *d)
 	/* the interrupt is already cleared before by reading ISR */
 }
 
-#ifdef CONFIG_PM
-
 static u32 wakeups[MAX_GPIO_BANKS];
 static u32 backups[MAX_GPIO_BANKS];
 
@@ -1683,10 +1681,6 @@ void at91_pinctrl_gpio_resume(void)
 	}
 }
 
-#else
-#define gpio_irq_set_wake	NULL
-#endif /* CONFIG_PM */
-
 static void gpio_irq_handler(struct irq_desc *desc)
 {
 	struct irq_chip *chip = irq_desc_get_chip(desc);
@@ -1741,7 +1735,7 @@ static int at91_gpio_of_irq_setup(struct platform_device *pdev,
 	gpio_irqchip->irq_disable = gpio_irq_mask;
 	gpio_irqchip->irq_mask = gpio_irq_mask;
 	gpio_irqchip->irq_unmask = gpio_irq_unmask;
-	gpio_irqchip->irq_set_wake = gpio_irq_set_wake;
+	gpio_irqchip->irq_set_wake = pm_ptr(gpio_irq_set_wake);
 	gpio_irqchip->irq_set_type = at91_gpio->ops->irq_type;
 
 	/* Disable irqs of this PIO controller */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] pinctrl: at91-pio4: remove #ifdef CONFIG_PM_SLEEP
  2022-07-04 10:12 [PATCH 1/2] pinctrl: at91-pio4: remove #ifdef CONFIG_PM_SLEEP Claudiu Beznea
  2022-07-04 10:12 ` [PATCH 2/2] pinctrl: at91: remove #ifdef CONFIG_PM Claudiu Beznea
@ 2022-07-11 11:52 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2022-07-11 11:52 UTC (permalink / raw)
  To: Claudiu Beznea
  Cc: ludovic.desroches, nicolas.ferre, alexandre.belloni,
	linux-arm-kernel, linux-gpio, linux-kernel

On Mon, Jul 4, 2022 at 12:10 PM Claudiu Beznea
<claudiu.beznea@microchip.com> wrote:

> Remove #ifdef CONFIG_PM_SLEEP and use pm_sleep_ptr() macro instead.
>
> Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>

Both patches applied!

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-11 11:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-04 10:12 [PATCH 1/2] pinctrl: at91-pio4: remove #ifdef CONFIG_PM_SLEEP Claudiu Beznea
2022-07-04 10:12 ` [PATCH 2/2] pinctrl: at91: remove #ifdef CONFIG_PM Claudiu Beznea
2022-07-11 11:52 ` [PATCH 1/2] pinctrl: at91-pio4: remove #ifdef CONFIG_PM_SLEEP Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).