Merge branches 'for-3.15/upstream-fixes' and 'for-3.16/upstream' into for-linus
[firefly-linux-kernel-4.4.55.git] / drivers / mfd / max77686.c
index f53d5823a3f73f47001cb5e6633e0b76028a8607..e5fce765accbfc763b7b0c9a2bed115755691a61 100644 (file)
@@ -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);