Skip to content
Commit 9e1a1ee9 authored by Wang Zhang's avatar Wang Zhang Committed by Wolfram Sang
Browse files

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: f5f35a92 ("i2c: ocores: Add irq support for sparc")
Signed-off-by: default avatarWang Zhang <silver_code@hust.edu.cn>
Reviewed-by: default avatarAndi Shyti <andi.shyti@kernel.org>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent e653810f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment