diff options
-rw-r--r-- | drivers/mfd/max77693.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/mfd/max77693.c b/drivers/mfd/max77693.c index 9e60fed5ff82..299970f99588 100644 --- a/drivers/mfd/max77693.c +++ b/drivers/mfd/max77693.c | |||
@@ -149,9 +149,18 @@ static int max77693_i2c_probe(struct i2c_client *i2c, | |||
149 | dev_info(max77693->dev, "device ID: 0x%x\n", reg_data); | 149 | dev_info(max77693->dev, "device ID: 0x%x\n", reg_data); |
150 | 150 | ||
151 | max77693->muic = i2c_new_dummy(i2c->adapter, I2C_ADDR_MUIC); | 151 | max77693->muic = i2c_new_dummy(i2c->adapter, I2C_ADDR_MUIC); |
152 | if (!max77693->muic) { | ||
153 | dev_err(max77693->dev, "Failed to allocate I2C device for MUIC\n"); | ||
154 | return -ENODEV; | ||
155 | } | ||
152 | i2c_set_clientdata(max77693->muic, max77693); | 156 | i2c_set_clientdata(max77693->muic, max77693); |
153 | 157 | ||
154 | max77693->haptic = i2c_new_dummy(i2c->adapter, I2C_ADDR_HAPTIC); | 158 | max77693->haptic = i2c_new_dummy(i2c->adapter, I2C_ADDR_HAPTIC); |
159 | if (!max77693->haptic) { | ||
160 | dev_err(max77693->dev, "Failed to allocate I2C device for Haptic\n"); | ||
161 | ret = -ENODEV; | ||
162 | goto err_i2c_haptic; | ||
163 | } | ||
155 | i2c_set_clientdata(max77693->haptic, max77693); | 164 | i2c_set_clientdata(max77693->haptic, max77693); |
156 | 165 | ||
157 | /* | 166 | /* |
@@ -187,8 +196,9 @@ err_mfd: | |||
187 | max77693_irq_exit(max77693); | 196 | max77693_irq_exit(max77693); |
188 | err_irq: | 197 | err_irq: |
189 | err_regmap_muic: | 198 | err_regmap_muic: |
190 | i2c_unregister_device(max77693->muic); | ||
191 | i2c_unregister_device(max77693->haptic); | 199 | i2c_unregister_device(max77693->haptic); |
200 | err_i2c_haptic: | ||
201 | i2c_unregister_device(max77693->muic); | ||
192 | return ret; | 202 | return ret; |
193 | } | 203 | } |
194 | 204 | ||