summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorMario Limonciello <mario.limonciello@amd.com>2022-03-17 14:03:01 -0500
committerHans de Goede <hdegoede@redhat.com>2022-03-18 12:02:40 +0100
commit0c2c21a1fa5b7612fa874b08252e06b34aa4e14a (patch)
tree86538c9ca7e34605fce18bc2de1226b330034220 /drivers/platform
parent0d64787e24c6926b60e7d4f07138b9d937925792 (diff)
platform/x86: amd-pmc: Only report STB errors when STB enabled
Currently if STB is disabled but an earlier function reported an error an incorrect error will be emitted about failing to write to STB. Correct this logic error by only showing errors when STB is enabled. Suggested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://lore.kernel.org/r/20220317190301.6818-1-mario.limonciello@amd.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/amd-pmc.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/platform/x86/amd-pmc.c b/drivers/platform/x86/amd-pmc.c
index 7317993cd91b..e9d0dbbb2887 100644
--- a/drivers/platform/x86/amd-pmc.c
+++ b/drivers/platform/x86/amd-pmc.c
@@ -655,10 +655,11 @@ static void amd_pmc_s2idle_prepare(void)
return;
}
- if (enable_stb)
+ if (enable_stb) {
rc = amd_pmc_write_stb(pdev, AMD_PMC_STB_PREDEF);
- if (rc)
- dev_err(pdev->dev, "error writing to STB: %d\n", rc);
+ if (rc)
+ dev_err(pdev->dev, "error writing to STB: %d\n", rc);
+ }
}
static void amd_pmc_s2idle_restore(void)
@@ -679,10 +680,11 @@ static void amd_pmc_s2idle_restore(void)
amd_pmc_idlemask_read(pdev, pdev->dev, NULL);
/* Write data incremented by 1 to distinguish in stb_read */
- if (enable_stb)
+ if (enable_stb) {
rc = amd_pmc_write_stb(pdev, AMD_PMC_STB_PREDEF + 1);
- if (rc)
- dev_err(pdev->dev, "error writing to STB: %d\n", rc);
+ if (rc)
+ dev_err(pdev->dev, "error writing to STB: %d\n", rc);
+ }
/* Notify on failed entry */
amd_pmc_validate_deepest(pdev);