i2c: designware: Fix optional reset error handling
The commit bb475230b8
("reset: make optional functions really optional")
brought a missed part of the support for an optional reset handlers.
Since that we don't need to have special error handling in the driver.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
parent
71dc297ca9
commit
a6af48ec07
|
@ -279,12 +279,10 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
|
||||||
platform_set_drvdata(pdev, dev);
|
platform_set_drvdata(pdev, dev);
|
||||||
|
|
||||||
dev->rst = devm_reset_control_get_optional_exclusive(&pdev->dev, NULL);
|
dev->rst = devm_reset_control_get_optional_exclusive(&pdev->dev, NULL);
|
||||||
if (IS_ERR(dev->rst)) {
|
if (IS_ERR(dev->rst))
|
||||||
if (PTR_ERR(dev->rst) == -EPROBE_DEFER)
|
return PTR_ERR(dev->rst);
|
||||||
return -EPROBE_DEFER;
|
|
||||||
} else {
|
reset_control_deassert(dev->rst);
|
||||||
reset_control_deassert(dev->rst);
|
|
||||||
}
|
|
||||||
|
|
||||||
t = &dev->timings;
|
t = &dev->timings;
|
||||||
if (pdata)
|
if (pdata)
|
||||||
|
@ -402,8 +400,7 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
|
||||||
exit_probe:
|
exit_probe:
|
||||||
dw_i2c_plat_pm_cleanup(dev);
|
dw_i2c_plat_pm_cleanup(dev);
|
||||||
exit_reset:
|
exit_reset:
|
||||||
if (!IS_ERR_OR_NULL(dev->rst))
|
reset_control_assert(dev->rst);
|
||||||
reset_control_assert(dev->rst);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -421,8 +418,7 @@ static int dw_i2c_plat_remove(struct platform_device *pdev)
|
||||||
pm_runtime_put_sync(&pdev->dev);
|
pm_runtime_put_sync(&pdev->dev);
|
||||||
dw_i2c_plat_pm_cleanup(dev);
|
dw_i2c_plat_pm_cleanup(dev);
|
||||||
|
|
||||||
if (!IS_ERR_OR_NULL(dev->rst))
|
reset_control_assert(dev->rst);
|
||||||
reset_control_assert(dev->rst);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue