Commit c88fd91b authored by Sachin Kamat's avatar Sachin Kamat Committed by Lee Jones

mfd: stw481x: Check the return value of devm_regmap_init_i2c

devm_regmap_init_i2c can fail. Check for it.
Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent e2f3e9bb
......@@ -186,6 +186,12 @@ static int stw481x_probe(struct i2c_client *client,
i2c_set_clientdata(client, stw481x);
stw481x->client = client;
stw481x->map = devm_regmap_init_i2c(client, &stw481x_regmap_config);
if (IS_ERR(stw481x->map)) {
ret = PTR_ERR(stw481x->map);
dev_err(&client->dev, "Failed to allocate register map: %d\n",
ret);
return ret;
}
ret = stw481x_startup(stw481x);
if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment