Skip to content

Commit 8894b43

Browse files
jhovoldsre
authored andcommitted
power: supply: qcom_battmgr: fix enable request endianness
Add the missing endianness conversion when sending the enable request so that the driver will work also on a hypothetical big-endian machine. This issue was reported by sparse. Fixes: 29e8142 ("power: supply: Introduce Qualcomm PMIC GLINK power supply") Cc: [email protected] # 6.3 Cc: Bjorn Andersson <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Reviewed-by: Andrew Halaney <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 383eba9 commit 8894b43

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/power/supply/qcom_battmgr.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,9 +1282,9 @@ static void qcom_battmgr_enable_worker(struct work_struct *work)
12821282
{
12831283
struct qcom_battmgr *battmgr = container_of(work, struct qcom_battmgr, enable_work);
12841284
struct qcom_battmgr_enable_request req = {
1285-
.hdr.owner = PMIC_GLINK_OWNER_BATTMGR,
1286-
.hdr.type = PMIC_GLINK_NOTIFY,
1287-
.hdr.opcode = BATTMGR_REQUEST_NOTIFICATION,
1285+
.hdr.owner = cpu_to_le32(PMIC_GLINK_OWNER_BATTMGR),
1286+
.hdr.type = cpu_to_le32(PMIC_GLINK_NOTIFY),
1287+
.hdr.opcode = cpu_to_le32(BATTMGR_REQUEST_NOTIFICATION),
12881288
};
12891289
int ret;
12901290

0 commit comments

Comments
 (0)