Skip to content

Commit

Permalink
irqchip/imx-intmux: Use dev_err_probe() to simplify error handling
Browse files Browse the repository at this point in the history
dev_err_probe() can reduce code size, uniform error handling and record the
defer probe reason etc., use it to simplify the code.

Signed-off-by: Anson Huang <[email protected]>
Signed-off-by: Marc Zyngier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
Anson-Huang authored and Marc Zyngier committed Sep 13, 2020
1 parent ea6c25e commit c201f43
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/irqchip/irq-imx-intmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,9 @@ static int imx_intmux_probe(struct platform_device *pdev)
}

data->ipg_clk = devm_clk_get(&pdev->dev, "ipg");
if (IS_ERR(data->ipg_clk)) {
ret = PTR_ERR(data->ipg_clk);
if (ret != -EPROBE_DEFER)
dev_err(&pdev->dev, "failed to get ipg clk: %d\n", ret);
return ret;
}
if (IS_ERR(data->ipg_clk))
return dev_err_probe(&pdev->dev, PTR_ERR(data->ipg_clk),
"failed to get ipg clk\n");

data->channum = channum;
raw_spin_lock_init(&data->lock);
Expand Down

0 comments on commit c201f43

Please sign in to comment.