i2c: ocores: use devm_ managed clks
Smatch complains that:
drivers/i2c/busses/i2c-ocores.c:704 ocores_i2c_probe()
warn: missing unwind goto?
If any wrong occurs in ocores_i2c_of_probe, the i2c->clk needs to be
released. But the function returns directly without freeing the clock.
Fix this by updating the code to use devm_clk_get_optional_enabled()
instead. Use dev_err_probe() where appropriate as well since we are
changing those statements.
Fixes: f5f35a92e44a ("i2c: ocores: Add irq support for sparc")
Signed-off-by: Wang Zhang <silver_code@hust.edu.cn>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Wolfram Sang <wsa@kernel.org>