On Tue, Jun 09, 2026 at 03:52:58PM +0530, Gaurav Kohli wrote:
> Add support for Thermal Mitigation Devices (TMDs) to enable
> thermal throttling of remote processors through QMI.
> 
> This enables the thermal framework to request mitigation when remote
> subsystems (modem, CDSP) contribute to thermal issues.
> 
> Signed-off-by: Gaurav Kohli <[email protected]>
> Signed-off-by: Daniel Lezcano <[email protected]>

Wrong SoB chain. Yours should be the last one.

> ---
>  drivers/remoteproc/Kconfig         |  1 +
>  drivers/remoteproc/qcom_q6v5_pas.c | 61 
> +++++++++++++++++++++++++++++++++++++-
>  2 files changed, 61 insertions(+), 1 deletion(-)
> 
> @@ -733,6 +737,49 @@ static void qcom_pas_unassign_memory_region(struct 
> qcom_pas *pas)
>       }
>  }
>  
> +static int qcom_pas_setup_tmd(struct qcom_pas *pas)
> +{
> +     struct device *dev = pas->dev;
> +     struct device_node *np = dev->of_node;
> +     const char **tmd_names;
> +     int num_tmds, ret, i;
> +
> +     if (!of_find_property(np, "tmd-names", NULL))
> +             return 0;
> +
> +     /* Get the TMD names array */
> +     num_tmds = of_property_count_strings(np, "tmd-names");
> +     if (num_tmds <= 0)
> +             return 0;

Propagate the error?

> +
> +     tmd_names = devm_kcalloc(dev, num_tmds, sizeof(*tmd_names), GFP_KERNEL);
> +     if (!tmd_names)
> +             return -ENOMEM;
> +
> +     for (i = 0; i < num_tmds; i++) {
> +             ret = of_property_read_string_index(np, "tmd-names", i,
> +                                                 &tmd_names[i]);
> +             if (ret) {
> +                     dev_err(dev, "Failed to read tmd-names[%d]: %d\n", i, 
> ret);
> +                     return ret;
> +             }
> +     }
> +
> +     pas->tmd_inst = qmi_tmd_init(dev, pas->info_name, tmd_names, num_tmds);
> +     if (IS_ERR(pas->tmd_inst)) {
> +             dev_err(dev, "Failed to register '%s'\n", pas->info_name);
> +
> +             ret = PTR_ERR(pas->tmd_inst);
> +             if (ret == -ENODEV) {
> +                     pas->tmd_inst = NULL;
> +                     return 0;
> +             }
> +             return ret;
> +     }

Assing to a temporal variable, check the result, assign afterwards.
Saves you from the nested ifs.

> +
> +     return 0;
> +}
> +
>  static int qcom_pas_probe(struct platform_device *pdev)
>  {
>       const struct qcom_pas_data *desc;

-- 
With best wishes
Dmitry

Reply via email to