[v1] i2c: designware: Fix optional reset error handling
diff mbox series

Message ID 20190819103130.73999-1-andriy.shevchenko@linux.intel.com
State Accepted
Headers show
Series
  • [v1] i2c: designware: Fix optional reset error handling
Related show

Commit Message

Andy Shevchenko Aug. 19, 2019, 10:31 a.m. UTC
The commit bb475230b8e5 ("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>
---
 drivers/i2c/busses/i2c-designware-platdrv.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

Comments

Jarkko Nikula Aug. 19, 2019, 1:57 p.m. UTC | #1
On 8/19/19 1:31 PM, Andy Shevchenko wrote:
> The commit bb475230b8e5 ("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>
> ---
>   drivers/i2c/busses/i2c-designware-platdrv.c | 16 ++++++----------
>   1 file changed, 6 insertions(+), 10 deletions(-)
> 
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Wolfram Sang Aug. 29, 2019, 8:10 p.m. UTC | #2
On Mon, Aug 19, 2019 at 01:31:30PM +0300, Andy Shevchenko wrote:
> The commit bb475230b8e5 ("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>

Applied to for-next, thanks!

Patch
diff mbox series

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 4624ef8fbae8..16dd338877d0 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -279,12 +279,10 @@  static int dw_i2c_plat_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, dev);
 
 	dev->rst = devm_reset_control_get_optional_exclusive(&pdev->dev, NULL);
-	if (IS_ERR(dev->rst)) {
-		if (PTR_ERR(dev->rst) == -EPROBE_DEFER)
-			return -EPROBE_DEFER;
-	} else {
-		reset_control_deassert(dev->rst);
-	}
+	if (IS_ERR(dev->rst))
+		return PTR_ERR(dev->rst);
+
+	reset_control_deassert(dev->rst);
 
 	t = &dev->timings;
 	if (pdata)
@@ -402,8 +400,7 @@  static int dw_i2c_plat_probe(struct platform_device *pdev)
 exit_probe:
 	dw_i2c_plat_pm_cleanup(dev);
 exit_reset:
-	if (!IS_ERR_OR_NULL(dev->rst))
-		reset_control_assert(dev->rst);
+	reset_control_assert(dev->rst);
 	return ret;
 }
 
@@ -421,8 +418,7 @@  static int dw_i2c_plat_remove(struct platform_device *pdev)
 	pm_runtime_put_sync(&pdev->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;
 }