[PATCH 3/4] scsi: ufs: core: Make use of guard(spinlock_irq)

From: Avri Altman
Date: Tue Apr 16 2024 - 06:24:51 EST


Replace open-coded handling with cleanup.h guard(spinlock_irq).

Signed-off-by: Avri Altman <avri.altman@xxxxxxx>
---
drivers/ufs/core/ufshcd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 92ac6a358365..3c62b69bbd52 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -6309,10 +6309,9 @@ void ufshcd_schedule_eh_work(struct ufs_hba *hba)

static void ufshcd_force_error_recovery(struct ufs_hba *hba)
{
- spin_lock_irq(hba->host->host_lock);
+ guard(spinlock_irq)(hba->host->host_lock);
hba->force_reset = true;
ufshcd_schedule_eh_work(hba);
- spin_unlock_irq(hba->host->host_lock);
}

static void ufshcd_clk_scaling_allow(struct ufs_hba *hba, bool allow)
--
2.42.0