summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2019-11-12 10:19:51 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-11-13 15:20:25 +0100
commit76f136ddde15039b9b63f089da96905e68fe18c4 (patch)
treefeb98bc4328fe05d5460315c884f8f9ebe028ab4
parent309ce31b811c515207a86de28da37d7a481b7212 (diff)
downloadbarebox-76f136ddde15039b9b63f089da96905e68fe18c4.tar.gz
barebox-76f136ddde15039b9b63f089da96905e68fe18c4.tar.xz
i2c: stm32: use device_reset_us helper instead of open-coding
The exact sequence is already available in form of device_reset_us. Make use of it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/i2c/busses/i2c-stm32.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/i2c/busses/i2c-stm32.c b/drivers/i2c/busses/i2c-stm32.c
index 6af55fb3ff..9f34760e3f 100644
--- a/drivers/i2c/busses/i2c-stm32.c
+++ b/drivers/i2c/busses/i2c-stm32.c
@@ -785,7 +785,6 @@ static int __init stm32_i2c_probe(struct device_d *dev)
struct resource *iores;
struct stm32_i2c *stm32_i2c;
struct i2c_platform_data *pdata;
- struct reset_control *rst;
const struct stm32_i2c_setup *setup;
struct i2c_timings *timings;
int ret;
@@ -799,13 +798,9 @@ static int __init stm32_i2c_probe(struct device_d *dev)
return PTR_ERR(stm32_i2c->clk);
clk_enable(stm32_i2c->clk);
- rst = reset_control_get(dev, NULL);
- if (IS_ERR(rst))
- return PTR_ERR(rst);
-
- reset_control_assert(rst);
- udelay(2);
- reset_control_deassert(rst);
+ ret = device_reset_us(dev, 2);
+ if (ret)
+ return ret;
ret = dev_get_drvdata(dev, (const void **)&setup);
if (ret)