Re: [patch 03/10] soc: ti: ti_sci_inta_msi: Switch MSI descriptor locking to guard()
From: Dhruva Gole
Date: Thu Mar 13 2025 - 08:07:41 EST
On Mar 09, 2025 at 09:41:46 +0100, Thomas Gleixner wrote:
> Convert the code to use the new guard(msi_descs_lock).
>
> No functional change intended.
>
> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Cc: Nishanth Menon <nm@xxxxxx>
> Cc: Tero Kristo <kristo@xxxxxxxxxx>
> Cc: Santosh Shilimkar <ssantosh@xxxxxxxxxx>
> ---
> drivers/soc/ti/ti_sci_inta_msi.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
Reviewed-by: Dhruva Gole <d-gole@xxxxxx>
>
> --- a/drivers/soc/ti/ti_sci_inta_msi.c
> +++ b/drivers/soc/ti/ti_sci_inta_msi.c
> @@ -103,19 +103,15 @@ int ti_sci_inta_msi_domain_alloc_irqs(st
> if (ret)
> return ret;
>
> - msi_lock_descs(dev);
> + guard(msi_descs_lock)(dev);
> nvec = ti_sci_inta_msi_alloc_descs(dev, res);
> - if (nvec <= 0) {
> - ret = nvec;
> - goto unlock;
> - }
> + if (nvec <= 0)
> + return nvec;
>
> /* Use alloc ALL as it's unclear whether there are gaps in the indices */
> ret = msi_domain_alloc_irqs_all_locked(dev, MSI_DEFAULT_DOMAIN, nvec);
> if (ret)
> dev_err(dev, "Failed to allocate IRQs %d\n", ret);
> -unlock:
> - msi_unlock_descs(dev);
> return ret;
> }
> EXPORT_SYMBOL_GPL(ti_sci_inta_msi_domain_alloc_irqs);
>
>
--
Best regards,
Dhruva Gole
Texas Instruments Incorporated