drivers/spmi/spmi-pmic-arb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
The "ret" could be returned with an uninitialized value. Fix it.
Fixes: 979987371739 ("spmi: pmic-arb: Add multi bus support")
Signed-off-by: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
---
Changes in v2:
- Drop "of_node_put(child)" fix as it has been fixed by updated to use "for_each_available_child_of_node_scoped"
- Link to v1: https://patch.msgid.link/20260604-spmi-bus-register-fix-v1-1-136adda83a92@oss.qualcomm.com
---
drivers/spmi/spmi-pmic-arb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c
index 2e2cb4774103..6203bfc2207f 100644
--- a/drivers/spmi/spmi-pmic-arb.c
+++ b/drivers/spmi/spmi-pmic-arb.c
@@ -2046,7 +2046,7 @@ static int spmi_pmic_arb_register_buses(struct spmi_pmic_arb *pmic_arb,
{
struct device *dev = &pdev->dev;
struct device_node *node = dev->of_node;
- int ret;
+ int ret = 0;
/* legacy mode doesn't provide child node for the bus */
if (of_device_is_compatible(node, "qcom,spmi-pmic-arb"))
---
base-commit: 3443eec9c55d128064c83225a9111f1a1a37277a
change-id: 20260604-spmi-bus-register-fix-dfdb94bf834e
Best regards,
--
Fenglin Wu <fenglin.wu@oss.qualcomm.com>
On Fri, Jun 05, 2026 at 01:05:48AM -0700, Fenglin Wu wrote:
> The "ret" could be returned with an uninitialized value. Fix it.
>
> Fixes: 979987371739 ("spmi: pmic-arb: Add multi bus support")
> Signed-off-by: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
> ---
> Changes in v2:
> - Drop "of_node_put(child)" fix as it has been fixed by updated to use "for_each_available_child_of_node_scoped"
> - Link to v1: https://patch.msgid.link/20260604-spmi-bus-register-fix-v1-1-136adda83a92@oss.qualcomm.com
> ---
> drivers/spmi/spmi-pmic-arb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c
> index 2e2cb4774103..6203bfc2207f 100644
> --- a/drivers/spmi/spmi-pmic-arb.c
> +++ b/drivers/spmi/spmi-pmic-arb.c
> @@ -2046,7 +2046,7 @@ static int spmi_pmic_arb_register_buses(struct spmi_pmic_arb *pmic_arb,
> {
> struct device *dev = &pdev->dev;
> struct device_node *node = dev->of_node;
> - int ret;
> + int ret = 0;
Just replace 'return ret' with 'return 0' at the end of the function.
>
> /* legacy mode doesn't provide child node for the bus */
> if (of_device_is_compatible(node, "qcom,spmi-pmic-arb"))
>
> ---
> base-commit: 3443eec9c55d128064c83225a9111f1a1a37277a
> change-id: 20260604-spmi-bus-register-fix-dfdb94bf834e
>
> Best regards,
> --
> Fenglin Wu <fenglin.wu@oss.qualcomm.com>
>
--
With best wishes
Dmitry
© 2016 - 2026 Red Hat, Inc.