From: Mario Limonciello <mario.limonciello@amd.com>
To: <hdegoede@redhat.com>, <Shyam-sundar.S-k@amd.com>
Cc: <bhelgaas@google.com>, <platform-driver-x86@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <iain@orangesquash.org.uk>,
Mario Limonciello <mario.limonciello@amd.com>
Subject: [PATCH v15 1/2] platform/x86/amd: pmc: Adjust workarounds to be part of a switch/case
Date: Sun, 27 Aug 2023 23:28:18 -0500 [thread overview]
Message-ID: <20230828042819.47013-1-mario.limonciello@amd.com> (raw)
To allow introducing additional workarounds more cleanly for other
platforms change the if block into a switch/case.
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
drivers/platform/x86/amd/pmc/pmc.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c
index c1e788b67a74..eb2a4263814c 100644
--- a/drivers/platform/x86/amd/pmc/pmc.c
+++ b/drivers/platform/x86/amd/pmc/pmc.c
@@ -884,17 +884,20 @@ static struct acpi_s2idle_dev_ops amd_pmc_s2idle_dev_ops = {
static int amd_pmc_suspend_handler(struct device *dev)
{
struct amd_pmc_dev *pdev = dev_get_drvdata(dev);
+ int rc = 0;
- if (pdev->cpu_id == AMD_CPU_ID_CZN && !disable_workarounds) {
- int rc = amd_pmc_czn_wa_irq1(pdev);
+ if (disable_workarounds)
+ return 0;
- if (rc) {
- dev_err(pdev->dev, "failed to adjust keyboard wakeup: %d\n", rc);
- return rc;
- }
+ switch (pdev->cpu_id) {
+ case AMD_CPU_ID_CZN:
+ rc = amd_pmc_czn_wa_irq1(pdev);
+ break;
+ default:
+ break;
}
- return 0;
+ return rc;
}
static DEFINE_SIMPLE_DEV_PM_OPS(amd_pmc_pm, amd_pmc_suspend_handler, NULL);
base-commit: 4dbd6e61adc7e52dd1c9165f0ccaa90806611e40
--
2.34.1
next reply other threads:[~2023-08-28 4:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-28 4:28 Mario Limonciello [this message]
2023-08-28 4:28 ` [PATCH v15 2/2] platform/x86/amd: pmc: Don't let PCIe root ports go into D3 Mario Limonciello
2023-08-28 9:19 ` Hans de Goede
2023-08-28 15:15 ` Mario Limonciello
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=20230828042819.47013-1-mario.limonciello@amd.com \
--to=mario.limonciello@amd.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=bhelgaas@google.com \
--cc=hdegoede@redhat.com \
--cc=iain@orangesquash.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
/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
all inboxes | Powered by JetHome®