summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorQianfeng Rong <rongqianfeng@vivo.com>2025-08-29 18:14:11 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-15 11:59:57 +0200
commit8ffe812280c4cbc8e089a0eede75d1fa458adac5 (patch)
tree9b779b9d628c25aa55496b3ad0957d6f6c3ef831 /drivers/regulator
parent0f43928b691e3769bcb8bd2d5ff28543de0b5aba (diff)
downloadlinux-8ffe812280c4cbc8e089a0eede75d1fa458adac5.tar.gz
linux-8ffe812280c4cbc8e089a0eede75d1fa458adac5.tar.bz2
linux-8ffe812280c4cbc8e089a0eede75d1fa458adac5.zip
regulator: scmi: Use int type to store negative error codes
[ Upstream commit 9d35d068fb138160709e04e3ee97fe29a6f8615b ] Change the 'ret' variable from u32 to int to store negative error codes or zero returned by of_property_read_u32(). Storing the negative error codes in unsigned type, doesn't cause an issue at runtime but it's ugly as pants. Additionally, assigning negative error codes to unsigned type may trigger a GCC warning when the -Wsign-conversion flag is enabled. No effect on runtime. Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com> Reviewed-by: Sudeep Holla <sudeep.holla@arm.com> Fixes: 0fbeae70ee7c ("regulator: add SCMI driver") Link: https://patch.msgid.link/20250829101411.625214-1-rongqianfeng@vivo.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/scmi-regulator.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/regulator/scmi-regulator.c b/drivers/regulator/scmi-regulator.c
index 9df726f10ad1..6d609c42e479 100644
--- a/drivers/regulator/scmi-regulator.c
+++ b/drivers/regulator/scmi-regulator.c
@@ -257,7 +257,8 @@ static int process_scmi_regulator_of_node(struct scmi_device *sdev,
struct device_node *np,
struct scmi_regulator_info *rinfo)
{
- u32 dom, ret;
+ u32 dom;
+ int ret;
ret = of_property_read_u32(np, "reg", &dom);
if (ret)