diff options
author | Xi Pardee <xi.pardee@intel.com> | 2024-06-24 23:32:10 +0300 |
---|---|---|
committer | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2024-07-08 10:37:53 +0300 |
commit | 40fdf3f623041eda2a8f825d0ccd4c18f8571ffb (patch) | |
tree | fc399eb5069fc1ab37893542a4f59201b0f8b713 /drivers/platform | |
parent | 4bf1ea3fc914faef37d8c793b7144d4765ff4a00 (diff) | |
download | linux-40fdf3f623041eda2a8f825d0ccd4c18f8571ffb.tar.xz |
platform/x86:intel/pmc: Use the return value of pmc_core_send_msg
Use the return value of pmc_core_send_msg() directly instead of
assigning another code when an error occurs.
Signed-off-by: Xi Pardee <xi.pardee@intel.com>
Link: https://lore.kernel.org/r/20240624203218.2428475-2-xi.pardee@linux.intel.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/intel/pmc/core.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c index 65eb09c7af6a..e656d51e7ad5 100644 --- a/drivers/platform/x86/intel/pmc/core.c +++ b/drivers/platform/x86/intel/pmc/core.c @@ -403,18 +403,16 @@ static int pmc_core_mphy_pg_show(struct seq_file *s, void *unused) mutex_lock(&pmcdev->lock); - if (pmc_core_send_msg(pmc, &mphy_core_reg_low) != 0) { - err = -EBUSY; + err = pmc_core_send_msg(pmc, &mphy_core_reg_low); + if (err) goto out_unlock; - } msleep(10); val_low = pmc_core_reg_read(pmc, SPT_PMC_MFPMC_OFFSET); - if (pmc_core_send_msg(pmc, &mphy_core_reg_high) != 0) { - err = -EBUSY; + err = pmc_core_send_msg(pmc, &mphy_core_reg_high); + if (err) goto out_unlock; - } msleep(10); val_high = pmc_core_reg_read(pmc, SPT_PMC_MFPMC_OFFSET); @@ -455,10 +453,9 @@ static int pmc_core_pll_show(struct seq_file *s, void *unused) mphy_common_reg = (SPT_PMC_MPHY_COM_STS_0 << 16); mutex_lock(&pmcdev->lock); - if (pmc_core_send_msg(pmc, &mphy_common_reg) != 0) { - err = -EBUSY; + err = pmc_core_send_msg(pmc, &mphy_common_reg); + if (err) goto out_unlock; - } /* Observed PMC HW response latency for MTPMC-MFPMC is ~10 ms */ msleep(10); |