summaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorSachin Kamat <sachin.kamat@linaro.org>2014-02-12 14:40:13 +0530
committerLee Jones <lee.jones@linaro.org>2014-03-19 08:58:17 +0000
commitc88fd91bcd016b84e5f7d7ebd583e073e5ead48a (patch)
tree99b5ca88bbab7123e0f2b82e283fae644b756bb5 /drivers/mfd
parente2f3e9bbbaa64a017d91b33fdd9d0886f431b36b (diff)
downloadblackbird-op-linux-c88fd91bcd016b84e5f7d7ebd583e073e5ead48a.tar.gz
blackbird-op-linux-c88fd91bcd016b84e5f7d7ebd583e073e5ead48a.zip
mfd: stw481x: Check the return value of devm_regmap_init_i2c
devm_regmap_init_i2c can fail. Check for it. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/stw481x.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mfd/stw481x.c b/drivers/mfd/stw481x.c
index cc42f88586f6..7ceb3df09e25 100644
--- a/drivers/mfd/stw481x.c
+++ b/drivers/mfd/stw481x.c
@@ -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) {
OpenPOWER on IntegriCloud