Skip to content

Commit 5b6570b

Browse files
Wei YongjunMarc Zyngier
authored andcommitted
irqchip/imx-intmux: Fix irqdata regs save in imx_intmux_runtime_suspend()
Gcc report warning as follows: drivers/irqchip/irq-imx-intmux.c:316:29: warning: variable 'irqchip_data' set but not used [-Wunused-but-set-variable] 316 | struct intmux_irqchip_data irqchip_data; | ^~~~~~~~~~~~ irqdata regs is stored to this variable on the stack in imx_intmux_runtime_suspend(), which means a nop. this commit fix to save regs to the right place. Fixes: bb40311 ("irqchip/imx-intmux: Implement intmux runtime power management") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent bb40311 commit 5b6570b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/irqchip/irq-imx-intmux.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -313,12 +313,12 @@ static int imx_intmux_remove(struct platform_device *pdev)
313313
static int imx_intmux_runtime_suspend(struct device *dev)
314314
{
315315
struct intmux_data *data = dev_get_drvdata(dev);
316-
struct intmux_irqchip_data irqchip_data;
316+
struct intmux_irqchip_data *irqchip_data;
317317
int i;
318318

319319
for (i = 0; i < data->channum; i++) {
320-
irqchip_data = data->irqchip_data[i];
321-
irqchip_data.saved_reg = readl_relaxed(data->regs + CHANIER(i));
320+
irqchip_data = &data->irqchip_data[i];
321+
irqchip_data->saved_reg = readl_relaxed(data->regs + CHANIER(i));
322322
}
323323

324324
clk_disable_unprepare(data->ipg_clk);
@@ -329,7 +329,7 @@ static int imx_intmux_runtime_suspend(struct device *dev)
329329
static int imx_intmux_runtime_resume(struct device *dev)
330330
{
331331
struct intmux_data *data = dev_get_drvdata(dev);
332-
struct intmux_irqchip_data irqchip_data;
332+
struct intmux_irqchip_data *irqchip_data;
333333
int ret, i;
334334

335335
ret = clk_prepare_enable(data->ipg_clk);
@@ -339,8 +339,8 @@ static int imx_intmux_runtime_resume(struct device *dev)
339339
}
340340

341341
for (i = 0; i < data->channum; i++) {
342-
irqchip_data = data->irqchip_data[i];
343-
writel_relaxed(irqchip_data.saved_reg, data->regs + CHANIER(i));
342+
irqchip_data = &data->irqchip_data[i];
343+
writel_relaxed(irqchip_data->saved_reg, data->regs + CHANIER(i));
344344
}
345345

346346
return 0;

0 commit comments

Comments
 (0)