[PATCH 2/4] i2c: stm32: only perform a reset if there is a reset property

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Allow the driver to properly initialize even if there is no reset
property given.  In such case reset control is not done and
initialization proceed.

Signed-off-by: Alain Volmat <alain.volmat@xxxxxxxxxxx>
---
 drivers/i2c/busses/i2c-stm32f7.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
index 6d4aa64b195d..b29d8e476342 100644
--- a/drivers/i2c/busses/i2c-stm32f7.c
+++ b/drivers/i2c/busses/i2c-stm32f7.c
@@ -2138,13 +2138,14 @@ static int stm32f7_i2c_probe(struct platform_device *pdev)
 
 	rst = devm_reset_control_get(&pdev->dev, NULL);
 	if (IS_ERR(rst)) {
-		ret = dev_err_probe(&pdev->dev, PTR_ERR(rst),
-				    "Error: Missing reset ctrl\n");
-		goto clk_free;
+		ret = PTR_ERR(rst);
+		if (ret == -EPROBE_DEFER)
+			goto clk_free;
+	} else {
+		reset_control_assert(rst);
+		udelay(2);
+		reset_control_deassert(rst);
 	}
-	reset_control_assert(rst);
-	udelay(2);
-	reset_control_deassert(rst);
 
 	i2c_dev->dev = &pdev->dev;
 
-- 
2.25.1




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux