|
@@ -1179,6 +1179,11 @@ static int pm860x_probe(struct i2c_client *client,
|
|
|
chip->companion_addr = pdata->companion_addr;
|
|
|
chip->companion = i2c_new_dummy(chip->client->adapter,
|
|
|
chip->companion_addr);
|
|
|
+ if (!chip->companion) {
|
|
|
+ dev_err(&client->dev,
|
|
|
+ "Failed to allocate I2C companion device\n");
|
|
|
+ return -ENODEV;
|
|
|
+ }
|
|
|
chip->regmap_companion = regmap_init_i2c(chip->companion,
|
|
|
&pm860x_regmap_config);
|
|
|
if (IS_ERR(chip->regmap_companion)) {
|