Skip to content

Commit b841c1d

Browse files
superm1rafaeljw
authored andcommitted
pinctrl: amd: Fix use of undeclared identifier 'pinctrl_amd_s2idle_dev_ops'
`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, and while updating make it CONFIG_SUSPEND instead as that's what the ACPI header uses. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Mario Limonciello <[email protected]> Acked-by: Linus Walleij <[email protected]> Link: https://patch.msgid.link/[email protected] [ rjw: Add missing #ifdef/#endif block ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 179db19 commit b841c1d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

drivers/pinctrl/pinctrl-amd.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@
3737
#include "pinctrl-utils.h"
3838
#include "pinctrl-amd.h"
3939

40+
#ifdef CONFIG_SUSPEND
4041
static struct amd_gpio *pinctrl_dev;
42+
#endif
4143

4244
static int amd_gpio_get_direction(struct gpio_chip *gc, unsigned offset)
4345
{
@@ -892,7 +894,7 @@ static void amd_gpio_irq_init(struct amd_gpio *gpio_dev)
892894
}
893895
}
894896

895-
#ifdef CONFIG_PM_SLEEP
897+
#ifdef CONFIG_SUSPEND
896898
static bool amd_gpio_should_save(struct amd_gpio *gpio_dev, unsigned int pin)
897899
{
898900
const struct pin_desc *pd = pin_desc_get(gpio_dev->pctrl, pin);
@@ -969,7 +971,9 @@ static int amd_gpio_suspend_hibernate_common(struct device *dev, bool is_suspend
969971

970972
static int amd_gpio_suspend(struct device *dev)
971973
{
974+
#ifdef CONFIG_SUSPEND
972975
pinctrl_dev = dev_get_drvdata(dev);
976+
#endif
973977
return amd_gpio_suspend_hibernate_common(dev, true);
974978
}
975979

@@ -1143,7 +1147,7 @@ static int amd_gpio_probe(struct platform_device *pdev)
11431147
if (gpio_dev->irq < 0)
11441148
return gpio_dev->irq;
11451149

1146-
#ifdef CONFIG_PM_SLEEP
1150+
#ifdef CONFIG_SUSPEND
11471151
gpio_dev->saved_regs = devm_kcalloc(&pdev->dev, amd_pinctrl_desc.npins,
11481152
sizeof(*gpio_dev->saved_regs),
11491153
GFP_KERNEL);
@@ -1209,7 +1213,7 @@ static int amd_gpio_probe(struct platform_device *pdev)
12091213

12101214
platform_set_drvdata(pdev, gpio_dev);
12111215
acpi_register_wakeup_handler(gpio_dev->irq, amd_gpio_check_wake, gpio_dev);
1212-
#ifdef CONFIG_ACPI
1216+
#if defined(CONFIG_ACPI) && defined(CONFIG_SUSPEND)
12131217
acpi_register_lps0_dev(&pinctrl_amd_s2idle_dev_ops);
12141218
#endif
12151219

@@ -1230,7 +1234,7 @@ static void amd_gpio_remove(struct platform_device *pdev)
12301234

12311235
gpiochip_remove(&gpio_dev->gc);
12321236
acpi_unregister_wakeup_handler(amd_gpio_check_wake, gpio_dev);
1233-
#ifdef CONFIG_ACPI
1237+
#if defined(CONFIG_ACPI) && defined(CONFIG_SUSPEND)
12341238
acpi_unregister_lps0_dev(&pinctrl_amd_s2idle_dev_ops);
12351239
#endif
12361240
}
@@ -1249,7 +1253,7 @@ static struct platform_driver amd_gpio_driver = {
12491253
.driver = {
12501254
.name = "amd_gpio",
12511255
.acpi_match_table = ACPI_PTR(amd_gpio_acpi_match),
1252-
#ifdef CONFIG_PM_SLEEP
1256+
#ifdef CONFIG_SUSPEND
12531257
.pm = &amd_gpio_pm_ops,
12541258
#endif
12551259
},

0 commit comments

Comments
 (0)