Skip to content

Commit

Permalink
irqchip/imx-intmux: Fix irqdata regs save in imx_intmux_runtime_suspe…
Browse files Browse the repository at this point in the history
…nd()

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 <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20200729155849.33919-1-weiyongjun1@huawei.com
  • Loading branch information
Wei Yongjun authored and Marc Zyngier committed Jul 30, 2020
1 parent bb40311 commit 5b6570b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/irqchip/irq-imx-intmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,12 @@ static int imx_intmux_remove(struct platform_device *pdev)
static int imx_intmux_runtime_suspend(struct device *dev)
{
struct intmux_data *data = dev_get_drvdata(dev);
struct intmux_irqchip_data irqchip_data;
struct intmux_irqchip_data *irqchip_data;
int i;

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

clk_disable_unprepare(data->ipg_clk);
Expand All @@ -329,7 +329,7 @@ static int imx_intmux_runtime_suspend(struct device *dev)
static int imx_intmux_runtime_resume(struct device *dev)
{
struct intmux_data *data = dev_get_drvdata(dev);
struct intmux_irqchip_data irqchip_data;
struct intmux_irqchip_data *irqchip_data;
int ret, i;

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

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

return 0;
Expand Down

0 comments on commit 5b6570b

Please sign in to comment.