Message ID | 20201109071244.1.Ie56bb458564739b03616a24da322b72c6fc2250b@changeid |
---|---|
State | Accepted |
Commit | 942012246a7a1dea66869be7763d73f0565bdb7b |
Delegated to: | Heiko Schocher |
Headers | show |
Series | i2c: designware_i2c: Don't warn if no reset controller | expand |
Hello Simon, Am 09.11.20 um 15:12 schrieb Simon Glass: > At present if CONFIG_RESET is not enabled, this code shows a warning: > > designware_i2c_ofdata_to_platdata() i2c_designware_pci i2c2@16,0: > Can't get reset: -524 > > Avoid this by checking if reset is supported, first. > > Fixes: 622597dee4f ("i2c: designware: add reset ctrl to driver") > Signed-off-by: Simon Glass <sjg@chromium.org> > --- > > drivers/i2c/designware_i2c.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) Applied to u-boot-i2c.git Thanks! bye, Heiko
diff --git a/drivers/i2c/designware_i2c.c b/drivers/i2c/designware_i2c.c index 791f32e971c..c54989504ea 100644 --- a/drivers/i2c/designware_i2c.c +++ b/drivers/i2c/designware_i2c.c @@ -774,10 +774,12 @@ int designware_i2c_ofdata_to_platdata(struct udevice *bus) dev_read_u32(bus, "i2c-sda-hold-time-ns", &priv->sda_hold_time_ns); ret = reset_get_bulk(bus, &priv->resets); - if (ret) - dev_warn(bus, "Can't get reset: %d\n", ret); - else + if (ret) { + if (ret != -ENOTSUPP) + dev_warn(bus, "Can't get reset: %d\n", ret); + } else { reset_deassert_bulk(&priv->resets); + } #if CONFIG_IS_ENABLED(CLK) ret = clk_get_by_index(bus, 0, &priv->clk);
At present if CONFIG_RESET is not enabled, this code shows a warning: designware_i2c_ofdata_to_platdata() i2c_designware_pci i2c2@16,0: Can't get reset: -524 Avoid this by checking if reset is supported, first. Fixes: 622597dee4f ("i2c: designware: add reset ctrl to driver") Signed-off-by: Simon Glass <sjg@chromium.org> --- drivers/i2c/designware_i2c.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)