Skip to content

Commit 40fdf3f

Browse files
xpardee-createij-intel
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent 4bf1ea3 commit 40fdf3f

File tree

1 file changed

+6
-9
lines changed
  • drivers/platform/x86/intel/pmc

1 file changed

+6
-9
lines changed

drivers/platform/x86/intel/pmc/core.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -403,18 +403,16 @@ static int pmc_core_mphy_pg_show(struct seq_file *s, void *unused)
403403

404404
mutex_lock(&pmcdev->lock);
405405

406-
if (pmc_core_send_msg(pmc, &mphy_core_reg_low) != 0) {
407-
err = -EBUSY;
406+
err = pmc_core_send_msg(pmc, &mphy_core_reg_low);
407+
if (err)
408408
goto out_unlock;
409-
}
410409

411410
msleep(10);
412411
val_low = pmc_core_reg_read(pmc, SPT_PMC_MFPMC_OFFSET);
413412

414-
if (pmc_core_send_msg(pmc, &mphy_core_reg_high) != 0) {
415-
err = -EBUSY;
413+
err = pmc_core_send_msg(pmc, &mphy_core_reg_high);
414+
if (err)
416415
goto out_unlock;
417-
}
418416

419417
msleep(10);
420418
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)
455453
mphy_common_reg = (SPT_PMC_MPHY_COM_STS_0 << 16);
456454
mutex_lock(&pmcdev->lock);
457455

458-
if (pmc_core_send_msg(pmc, &mphy_common_reg) != 0) {
459-
err = -EBUSY;
456+
err = pmc_core_send_msg(pmc, &mphy_common_reg);
457+
if (err)
460458
goto out_unlock;
461-
}
462459

463460
/* Observed PMC HW response latency for MTPMC-MFPMC is ~10 ms */
464461
msleep(10);

0 commit comments

Comments
 (0)