Skip to contentSkip to conversation

pinctrl: amd: Fix use of undeclared identifier 'pinctrl_amd_s2idle_dev_ops'

PATCH Superseded Mario Limonciello 3 participants 4 messages Apr 9, 2025 – Apr 10, 2025

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: amd: Fix use of undeclared identifier 'pinctrl_amd_s2idle_dev_ops'

From: Mario Limonciello <[email protected]>

pinctrl_amd_s2idle_dev_ops is hidden under both CONFIG_ACPI and CONFIG_PM_SLEEP so the functions that use it need the same scope.

Adjust checks to look for both.

---
 drivers/pinctrl/pinctrl-amd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pinctrl/pinctrl-amd.c +2 -2
index b6fafed79b289..472a5aed4cd05 100644
@@ -1209,7 +1209,7 @@ static int amd_gpio_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, gpio_dev);
 	acpi_register_wakeup_handler(gpio_dev->irq, amd_gpio_check_wake, gpio_dev);
-#ifdef CONFIG_ACPI
+#if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP)
 	acpi_register_lps0_dev(&pinctrl_amd_s2idle_dev_ops);
 #endif
 
@@ -1230,7 +1230,7 @@ static void amd_gpio_remove(struct platform_device *pdev)
 
 	gpiochip_remove(&gpio_dev->gc);
 	acpi_unregister_wakeup_handler(amd_gpio_check_wake, gpio_dev);
-#ifdef CONFIG_ACPI
+#if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP)
 	acpi_unregister_lps0_dev(&pinctrl_amd_s2idle_dev_ops);
 #endif
 }
Signature · 1 line
2.43.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Mario Limonciello

From: Mario Limonciello <[email protected]>

pinctrl_amd_s2idle_dev_ops is hidden under both CONFIG_ACPI and CONFIG_PM_SLEEP so the functions that use it need the same scope.

Adjust checks to look for both.

Looks good to me.

#2 lore raw
In reply to Mario Limonciello
Quoted 5 lines · Mario Limonciello

From: Mario Limonciello <[email protected]>

pinctrl_amd_s2idle_dev_ops is hidden under both CONFIG_ACPI and CONFIG_PM_SLEEP so the functions that use it need the same scope.

Shouldn't this be CONFIG_SUSPEND given what's going on in acpi.h?

Also, there is one more report regarding pinctrl_dev being unused:

https://lore.kernel.org/linux-acpi/[email protected]/T/#u

Any chance to address all of this in one patch?

Quoted 35 lines

Adjust checks to look for both.

---
 drivers/pinctrl/pinctrl-amd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pinctrl/pinctrl-amd.c +2 -3
index b6fafed79b289..472a5aed4cd05 100644
@@ -1209,7 +1209,7 @@ static int amd_gpio_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, gpio_dev);
        acpi_register_wakeup_handler(gpio_dev->irq, amd_gpio_check_wake, gpio_dev);
-#ifdef CONFIG_ACPI
+#if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP)
        acpi_register_lps0_dev(&pinctrl_amd_s2idle_dev_ops);
 #endif
 
@@ -1230,7 +1230,7 @@ static void amd_gpio_remove(struct platform_device *pdev)
 
        gpiochip_remove(&gpio_dev->gc);
        acpi_unregister_wakeup_handler(amd_gpio_check_wake, gpio_dev);
-#ifdef CONFIG_ACPI
+#if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP)
        acpi_unregister_lps0_dev(&pinctrl_amd_s2idle_dev_ops);
 #endif
 }
--

2.43.0

#3 lore raw
Quoted 8 lines · Rafael J. Wysocki
Quoted 5 lines · Mario Limonciello

From: Mario Limonciello <[email protected]>

pinctrl_amd_s2idle_dev_ops is hidden under both CONFIG_ACPI and CONFIG_PM_SLEEP so the functions that use it need the same scope.

Shouldn't this be CONFIG_SUSPEND given what's going on in acpi.h?

Really - I think we probably should change all of pinctrl-amd.c to use CONFIG_SUSPEND.

Quoted 6 lines

Also, there is one more report regarding pinctrl_dev being unused:

https://lore.kernel.org/linux-acpi/[email protected]/T/#u

Any chance to address all of this in one patch?

Sure; I'll spin again and get something out to cover both cases soon.

Quoted 36 lines
Quoted 36 lines

Adjust checks to look for both.

---
  drivers/pinctrl/pinctrl-amd.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pinctrl/pinctrl-amd.c +2 -3
index b6fafed79b289..472a5aed4cd05 100644
@@ -1209,7 +1209,7 @@ static int amd_gpio_probe(struct platform_device *pdev)
 
         platform_set_drvdata(pdev, gpio_dev);
         acpi_register_wakeup_handler(gpio_dev->irq, amd_gpio_check_wake, gpio_dev);
-#ifdef CONFIG_ACPI
+#if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP)
         acpi_register_lps0_dev(&pinctrl_amd_s2idle_dev_ops);
  #endif
 
@@ -1230,7 +1230,7 @@ static void amd_gpio_remove(struct platform_device *pdev)
 
         gpiochip_remove(&gpio_dev->gc);
         acpi_unregister_wakeup_handler(amd_gpio_check_wake, gpio_dev);
-#ifdef CONFIG_ACPI
+#if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP)
         acpi_unregister_lps0_dev(&pinctrl_amd_s2idle_dev_ops);
  #endif
  }
--

2.43.0