]> git.dujemihanovic.xyz Git - u-boot.git/commit
gpio: qcom_pmic: fix silent dev_read_addr downcast
authorCaleb Connolly <caleb.connolly@linaro.org>
Tue, 5 Dec 2023 13:46:46 +0000 (13:46 +0000)
committerCaleb Connolly <caleb.connolly@linaro.org>
Tue, 16 Jan 2024 12:26:53 +0000 (12:26 +0000)
commit033f09b4b460a676b6ce869d2ade97a3098fd312
tree750f73e8f6adbef82b6940afc3ed22efb6e7d8f6
parenta4ba2a66639ed5db672800a52e6d02b4e83573c2
gpio: qcom_pmic: fix silent dev_read_addr downcast

priv->pid is uint32_t, but dev_read_addr() returns a uint64_t on arm64,
with the upper bits being used for error codes. Do error checking before
downcasting to u32 to prevent errors being silently ignored.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Tested-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
drivers/gpio/qcom_pmic_gpio.c