|
@@ -121,6 +121,10 @@ static int max77686_i2c_probe(struct i2c_client *i2c,
|
|
|
dev_info(max77686->dev, "device found\n");
|
|
|
|
|
|
max77686->rtc = i2c_new_dummy(i2c->adapter, I2C_ADDR_RTC);
|
|
|
+ if (!max77686->rtc) {
|
|
|
+ dev_err(max77686->dev, "Failed to allocate I2C device for RTC\n");
|
|
|
+ return -ENODEV;
|
|
|
+ }
|
|
|
i2c_set_clientdata(max77686->rtc, max77686);
|
|
|
|
|
|
max77686_irq_init(max77686);
|