summaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorJohan Hovold <johan+linaro@kernel.org>2023-09-29 12:16:49 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-10-19 23:11:06 +0200
commit92437349c0f015b9e74ba0b3414180785a796900 (patch)
tree5af96e4ad56e2990eee824bc2411febb1a405c5f /drivers/power
parentfbda26ff92e0efcbb1b9172bc469782ecf4c8463 (diff)
downloadlinux-stable-92437349c0f015b9e74ba0b3414180785a796900.tar.gz
linux-stable-92437349c0f015b9e74ba0b3414180785a796900.tar.bz2
linux-stable-92437349c0f015b9e74ba0b3414180785a796900.zip
power: supply: qcom_battmgr: fix enable request endianness
commit 8894b432548851f705f72ff135d3dcbd442a18d1 upstream. 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: 29e8142b5623 ("power: supply: Introduce Qualcomm PMIC GLINK power supply") Cc: stable@vger.kernel.org # 6.3 Cc: Bjorn Andersson <andersson@kernel.org> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Reviewed-by: Andrew Halaney <ahalaney@redhat.com> Link: https://lore.kernel.org/r/20230929101649.20206-1-johan+linaro@kernel.org Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/supply/qcom_battmgr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/power/supply/qcom_battmgr.c b/drivers/power/supply/qcom_battmgr.c
index a05fd00711f6..ec163d1bcd18 100644
--- a/drivers/power/supply/qcom_battmgr.c
+++ b/drivers/power/supply/qcom_battmgr.c
@@ -1282,9 +1282,9 @@ static void qcom_battmgr_enable_worker(struct work_struct *work)
{
struct qcom_battmgr *battmgr = container_of(work, struct qcom_battmgr, enable_work);
struct qcom_battmgr_enable_request req = {
- .hdr.owner = PMIC_GLINK_OWNER_BATTMGR,
- .hdr.type = PMIC_GLINK_NOTIFY,
- .hdr.opcode = BATTMGR_REQUEST_NOTIFICATION,
+ .hdr.owner = cpu_to_le32(PMIC_GLINK_OWNER_BATTMGR),
+ .hdr.type = cpu_to_le32(PMIC_GLINK_NOTIFY),
+ .hdr.opcode = cpu_to_le32(BATTMGR_REQUEST_NOTIFICATION),
};
int ret;