From: Mario Limonciello <superm1@kernel.org>
To: "Rafael J . Wysocki" <rjw@rjwysocki.net>
Cc: Linus Walleij <linus.walleij@linaro.org>,
linux-gpio@vger.kernel.org (open list:PIN CONTROL SUBSYSTEM),
linux-kernel@vger.kernel.org (open list),
linux-acpi@vger.kernel.org,
Basavaraj Natikar <Basavaraj.Natikar@amd.com>,
Shyam Sundar S K <Shyam-sundar.S-k@amd.com>,
Mario Limonciello <mario.limonciello@amd.com>,
kernel test robot <lkp@intel.com>
Subject: [PATCH v2] pinctrl: amd: Fix use of undeclared identifier 'pinctrl_amd_s2idle_dev_ops'
Date: Mon, 14 Apr 2025 15:35:51 -0500 [thread overview]
Message-ID: <20250414203551.779320-1-superm1@kernel.org> (raw)
From: Mario Limonciello <mario.limonciello@amd.com>
`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 <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202504100420.88UPkUTU-lkp@intel.com/
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
v2:
Use CONFIG_SUSPEND instead of CONFIG_PM_SLEEP
---
drivers/pinctrl/pinctrl-amd.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c
index b6fafed79b289..60252830ff410 100644
--- a/drivers/pinctrl/pinctrl-amd.c
+++ b/drivers/pinctrl/pinctrl-amd.c
@@ -37,7 +37,9 @@
#include "pinctrl-utils.h"
#include "pinctrl-amd.h"
+#ifdef CONFIG_SUSPEND
static struct amd_gpio *pinctrl_dev;
+#endif
static int amd_gpio_get_direction(struct gpio_chip *gc, unsigned offset)
{
@@ -892,7 +894,7 @@ static void amd_gpio_irq_init(struct amd_gpio *gpio_dev)
}
}
-#ifdef CONFIG_PM_SLEEP
+#ifdef CONFIG_SUSPEND
static bool amd_gpio_should_save(struct amd_gpio *gpio_dev, unsigned int pin)
{
const struct pin_desc *pd = pin_desc_get(gpio_dev->pctrl, pin);
@@ -1143,7 +1145,7 @@ static int amd_gpio_probe(struct platform_device *pdev)
if (gpio_dev->irq < 0)
return gpio_dev->irq;
-#ifdef CONFIG_PM_SLEEP
+#ifdef CONFIG_SUSPEND
gpio_dev->saved_regs = devm_kcalloc(&pdev->dev, amd_pinctrl_desc.npins,
sizeof(*gpio_dev->saved_regs),
GFP_KERNEL);
@@ -1209,7 +1211,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_SUSPEND)
acpi_register_lps0_dev(&pinctrl_amd_s2idle_dev_ops);
#endif
@@ -1230,7 +1232,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_SUSPEND)
acpi_unregister_lps0_dev(&pinctrl_amd_s2idle_dev_ops);
#endif
}
@@ -1249,7 +1251,7 @@ static struct platform_driver amd_gpio_driver = {
.driver = {
.name = "amd_gpio",
.acpi_match_table = ACPI_PTR(amd_gpio_acpi_match),
-#ifdef CONFIG_PM_SLEEP
+#ifdef CONFIG_SUSPEND
.pm = &amd_gpio_pm_ops,
#endif
},
--
2.43.0
next reply other threads:[~2025-04-14 20:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-14 20:35 Mario Limonciello [this message]
2025-04-15 13:34 ` [PATCH v2] pinctrl: amd: Fix use of undeclared identifier 'pinctrl_amd_s2idle_dev_ops' Linus Walleij
2025-04-15 13:37 ` Mario Limonciello
2025-04-15 13:37 ` Rafael J. Wysocki
2025-04-24 20:07 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250414203551.779320-1-superm1@kernel.org \
--to=superm1@kernel.org \
--cc=Basavaraj.Natikar@amd.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=linus.walleij@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=mario.limonciello@amd.com \
--cc=rjw@rjwysocki.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox