aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mfd/max8925-i2c.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/mfd/max8925-i2c.c b/drivers/mfd/max8925-i2c.c
index 92bbebd31598..c94d3337bdfd 100644
--- a/drivers/mfd/max8925-i2c.c
+++ b/drivers/mfd/max8925-i2c.c
@@ -180,9 +180,18 @@ static int max8925_probe(struct i2c_client *client,
180 mutex_init(&chip->io_lock); 180 mutex_init(&chip->io_lock);
181 181
182 chip->rtc = i2c_new_dummy(chip->i2c->adapter, RTC_I2C_ADDR); 182 chip->rtc = i2c_new_dummy(chip->i2c->adapter, RTC_I2C_ADDR);
183 if (!chip->rtc) {
184 dev_err(chip->dev, "Failed to allocate I2C device for RTC\n");
185 return -ENODEV;
186 }
183 i2c_set_clientdata(chip->rtc, chip); 187 i2c_set_clientdata(chip->rtc, chip);
184 188
185 chip->adc = i2c_new_dummy(chip->i2c->adapter, ADC_I2C_ADDR); 189 chip->adc = i2c_new_dummy(chip->i2c->adapter, ADC_I2C_ADDR);
190 if (!chip->adc) {
191 dev_err(chip->dev, "Failed to allocate I2C device for ADC\n");
192 i2c_unregister_device(chip->rtc);
193 return -ENODEV;
194 }
186 i2c_set_clientdata(chip->adc, chip); 195 i2c_set_clientdata(chip->adc, chip);
187 196
188 device_init_wakeup(&client->dev, 1); 197 device_init_wakeup(&client->dev, 1);