summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJason M. Bills <jason.m.bills@intel.com>2022-01-29 02:16:19 +0300
committerjmbills <jasonm.bills@yahoo.com>2022-02-01 00:13:53 +0300
commitb7504577edef85b5a7b2120d7ce81c8a933163f3 (patch)
treec76148f8cf8f1ecb9607d170f43523c1bb803524 /drivers
parent2797f889860a4bb2cd9fb19b74b5828477eaadb9 (diff)
downloadlinux-b7504577edef85b5a7b2120d7ce81c8a933163f3.tar.xz
intel-peci-client: Use wr_pkg_cfg struct for write command
The write command is incorrectly using the rd_pkg_cfg struct for the PECI command data, which could introduce issues if the structs change in the future. This fixes the write command and the callers (only peci-hwmon.h found using grep) to send the data as a u32 and use the wr_pkg_cfg struct. Tested: Wrote the /sys/class/hwmon/hwmon13/power1_cap attribute which triggers a write command and confirmed that the data written is the same after this change. Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hwmon/peci-hwmon.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/hwmon/peci-hwmon.h b/drivers/hwmon/peci-hwmon.h
index a3cb2fdcf8b7..918bbec03a92 100644
--- a/drivers/hwmon/peci-hwmon.h
+++ b/drivers/hwmon/peci-hwmon.h
@@ -429,13 +429,9 @@ static inline int peci_pcs_read(struct peci_client_manager *peci_mgr, u8 index,
static inline int peci_pcs_write(struct peci_client_manager *peci_mgr, u8 index,
u16 parameter, u32 reg)
{
- u32 pcs_reg;
int ret;
- pcs_reg = cpu_to_le32p(&reg);
-
- ret = peci_client_write_package_config(peci_mgr, index, parameter,
- (u8 *)&pcs_reg);
+ ret = peci_client_write_package_config(peci_mgr, index, parameter, reg);
return ret;
}