mirror of https://github.com/torvalds/linux.git
i2c: designware: use dev_err_probe() when probing platform device
Add calls to dev_err_probe() on error paths that can return -EPROBE_DEFER when probing platform device. Namely when requesting the reset controller, when probing for lock support and when requesting the clocks. PCI device probing already use dev_err_probe(). Signed-off-by: Benoît Monin <benoit.monin@bootlin.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
This commit is contained in:
parent
437e6c3e31
commit
2b7a2003ba
|
|
@ -238,7 +238,7 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
dev->rst = devm_reset_control_get_optional_exclusive(device, NULL);
|
dev->rst = devm_reset_control_get_optional_exclusive(device, NULL);
|
||||||
if (IS_ERR(dev->rst))
|
if (IS_ERR(dev->rst))
|
||||||
return PTR_ERR(dev->rst);
|
return dev_err_probe(device, PTR_ERR(dev->rst), "failed to acquire reset\n");
|
||||||
|
|
||||||
reset_control_deassert(dev->rst);
|
reset_control_deassert(dev->rst);
|
||||||
|
|
||||||
|
|
@ -247,21 +247,23 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
|
||||||
goto exit_reset;
|
goto exit_reset;
|
||||||
|
|
||||||
ret = i2c_dw_probe_lock_support(dev);
|
ret = i2c_dw_probe_lock_support(dev);
|
||||||
if (ret)
|
if (ret) {
|
||||||
|
ret = dev_err_probe(device, ret, "failed to probe lock support\n");
|
||||||
goto exit_reset;
|
goto exit_reset;
|
||||||
|
}
|
||||||
|
|
||||||
i2c_dw_configure(dev);
|
i2c_dw_configure(dev);
|
||||||
|
|
||||||
/* Optional interface clock */
|
/* Optional interface clock */
|
||||||
dev->pclk = devm_clk_get_optional(device, "pclk");
|
dev->pclk = devm_clk_get_optional(device, "pclk");
|
||||||
if (IS_ERR(dev->pclk)) {
|
if (IS_ERR(dev->pclk)) {
|
||||||
ret = PTR_ERR(dev->pclk);
|
ret = dev_err_probe(device, PTR_ERR(dev->pclk), "failed to acquire pclk\n");
|
||||||
goto exit_reset;
|
goto exit_reset;
|
||||||
}
|
}
|
||||||
|
|
||||||
dev->clk = devm_clk_get_optional(device, NULL);
|
dev->clk = devm_clk_get_optional(device, NULL);
|
||||||
if (IS_ERR(dev->clk)) {
|
if (IS_ERR(dev->clk)) {
|
||||||
ret = PTR_ERR(dev->clk);
|
ret = dev_err_probe(device, PTR_ERR(dev->clk), "failed to acquire clock\n");
|
||||||
goto exit_reset;
|
goto exit_reset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue