[PATCH 6/6] rtc: mxc_v2: Replace spin_lock_irqsave with spin_lock in hard IRQ

From: Xiaofei Tan
Date: Wed Feb 03 2021 - 07:49:05 EST


It is redundant to do irqsave and irqrestore in hardIRQ context, where
it has been in a irq-disabled context.

Signed-off-by: Xiaofei Tan <tanxiaofei@xxxxxxxxxx>
---
drivers/rtc/rtc-mxc_v2.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-mxc_v2.c b/drivers/rtc/rtc-mxc_v2.c
index 0d73f6f..a577a74 100644
--- a/drivers/rtc/rtc-mxc_v2.c
+++ b/drivers/rtc/rtc-mxc_v2.c
@@ -74,13 +74,12 @@ static irqreturn_t mxc_rtc_interrupt(int irq, void *dev_id)
struct device *dev = dev_id;
struct mxc_rtc_data *pdata = dev_get_drvdata(dev);
void __iomem *ioaddr = pdata->ioaddr;
- unsigned long flags;
u32 lp_status;
u32 lp_cr;

- spin_lock_irqsave(&pdata->lock, flags);
+ spin_lock(&pdata->lock);
if (clk_enable(pdata->clk)) {
- spin_unlock_irqrestore(&pdata->lock, flags);
+ spin_unlock(&pdata->lock);
return IRQ_NONE;
}

@@ -104,7 +103,7 @@ static irqreturn_t mxc_rtc_interrupt(int irq, void *dev_id)

mxc_rtc_sync_lp_locked(dev, ioaddr);
clk_disable(pdata->clk);
- spin_unlock_irqrestore(&pdata->lock, flags);
+ spin_unlock(&pdata->lock);
return IRQ_HANDLED;
}

--
2.8.1