Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

irqchip/imx-intmux: Use dev_err_probe() to simplify error handling

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 <Anson.Huang@nxp.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/1597126576-18383-1-git-send-email-Anson.Huang@nxp.com

authored by

Anson Huang and committed by
Marc Zyngier
c201f432 ea6c25e6

+3 -6
+3 -6
drivers/irqchip/irq-imx-intmux.c
··· 226 226 } 227 227 228 228 data->ipg_clk = devm_clk_get(&pdev->dev, "ipg"); 229 - if (IS_ERR(data->ipg_clk)) { 230 - ret = PTR_ERR(data->ipg_clk); 231 - if (ret != -EPROBE_DEFER) 232 - dev_err(&pdev->dev, "failed to get ipg clk: %d\n", ret); 233 - return ret; 234 - } 229 + if (IS_ERR(data->ipg_clk)) 230 + return dev_err_probe(&pdev->dev, PTR_ERR(data->ipg_clk), 231 + "failed to get ipg clk\n"); 235 232 236 233 data->channum = channum; 237 234 raw_spin_lock_init(&data->lock);