aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/wm8400-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd/wm8400-core.c')
-rw-r--r--drivers/mfd/wm8400-core.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/drivers/mfd/wm8400-core.c b/drivers/mfd/wm8400-core.c
index d66d256551fb..e5eae751aa1b 100644
--- a/drivers/mfd/wm8400-core.c
+++ b/drivers/mfd/wm8400-core.c
@@ -161,31 +161,19 @@ static int wm8400_i2c_probe(struct i2c_client *i2c,
161 const struct i2c_device_id *id) 161 const struct i2c_device_id *id)
162{ 162{
163 struct wm8400 *wm8400; 163 struct wm8400 *wm8400;
164 int ret;
165 164
166 wm8400 = devm_kzalloc(&i2c->dev, sizeof(struct wm8400), GFP_KERNEL); 165 wm8400 = devm_kzalloc(&i2c->dev, sizeof(struct wm8400), GFP_KERNEL);
167 if (wm8400 == NULL) { 166 if (!wm8400)
168 ret = -ENOMEM; 167 return -ENOMEM;
169 goto err;
170 }
171 168
172 wm8400->regmap = devm_regmap_init_i2c(i2c, &wm8400_regmap_config); 169 wm8400->regmap = devm_regmap_init_i2c(i2c, &wm8400_regmap_config);
173 if (IS_ERR(wm8400->regmap)) { 170 if (IS_ERR(wm8400->regmap))
174 ret = PTR_ERR(wm8400->regmap); 171 return PTR_ERR(wm8400->regmap);
175 goto err;
176 }
177 172
178 wm8400->dev = &i2c->dev; 173 wm8400->dev = &i2c->dev;
179 i2c_set_clientdata(i2c, wm8400); 174 i2c_set_clientdata(i2c, wm8400);
180 175
181 ret = wm8400_init(wm8400, dev_get_platdata(&i2c->dev)); 176 return wm8400_init(wm8400, dev_get_platdata(&i2c->dev));
182 if (ret != 0)
183 goto err;
184
185 return 0;
186
187err:
188 return ret;
189} 177}
190 178
191static int wm8400_i2c_remove(struct i2c_client *i2c) 179static int wm8400_i2c_remove(struct i2c_client *i2c)