clk: versaclock7: Fix an error handling path in vc7_probe()
Commit Message
If an error code other than -EPROBE_DEFER is returned, it is likely that
there will be some trouble when:
__clk_get_name(vc7->pin_xin)
is called a few lines below.
__clk_get_name() only checks for NULL.
Fixes: 48c5e98fedd9 ("clk: Renesas versaclock7 ccf device driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
This patch is speculative and compile tested only.
---
drivers/clk/clk-versaclock7.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -1111,8 +1111,8 @@ static int vc7_probe(struct i2c_client *client)
vc7->chip_info = of_device_get_match_data(&client->dev);
vc7->pin_xin = devm_clk_get(&client->dev, "xin");
- if (PTR_ERR(vc7->pin_xin) == -EPROBE_DEFER) {
- return dev_err_probe(&client->dev, -EPROBE_DEFER,
+ if (IS_ERR(vc7->pin_xin)) {
+ return dev_err_probe(&client->dev, PTR_ERR(vc7->pin_xin),
"xin not specified\n");
}