diff --git a/drivers/mfd/rohm-bd71828.c b/drivers/mfd/rohm-bd71828.c index 3c5c6c393650..7eb920633ee9 100644 --- a/drivers/mfd/rohm-bd71828.c +++ b/drivers/mfd/rohm-bd71828.c @@ -513,27 +513,24 @@ static int bd71828_i2c_probe(struct i2c_client *i2c) } regmap = devm_regmap_init_i2c(i2c, regmap_config); - if (IS_ERR(regmap)) { - dev_err(&i2c->dev, "Failed to initialize Regmap\n"); - return PTR_ERR(regmap); - } + if (IS_ERR(regmap)) + return dev_err_probe(&i2c->dev, PTR_ERR(regmap), + "Failed to initialize Regmap\n"); ret = devm_regmap_add_irq_chip(&i2c->dev, regmap, i2c->irq, IRQF_ONESHOT, 0, irqchip, &irq_data); - if (ret) { - dev_err(&i2c->dev, "Failed to add IRQ chip\n"); - return ret; - } + if (ret) + return dev_err_probe(&i2c->dev, ret, + "Failed to add IRQ chip\n"); dev_dbg(&i2c->dev, "Registered %d IRQs for chip\n", irqchip->num_irqs); if (button_irq) { ret = regmap_irq_get_virq(irq_data, button_irq); - if (ret < 0) { - dev_err(&i2c->dev, "Failed to get the power-key IRQ\n"); - return ret; - } + if (ret < 0) + return dev_err_probe(&i2c->dev, ret, + "Failed to get the power-key IRQ\n"); button.irq = ret; } @@ -545,7 +542,7 @@ static int bd71828_i2c_probe(struct i2c_client *i2c) ret = devm_mfd_add_devices(&i2c->dev, PLATFORM_DEVID_AUTO, mfd, cells, NULL, 0, regmap_irq_get_domain(irq_data)); if (ret) - dev_err(&i2c->dev, "Failed to create subdevices\n"); + dev_err_probe(&i2c->dev, ret, "Failed to create subdevices\n"); return ret; } diff --git a/drivers/mfd/rohm-bd718x7.c b/drivers/mfd/rohm-bd718x7.c index b55674d7b7dc..378eb1a692e4 100644 --- a/drivers/mfd/rohm-bd718x7.c +++ b/drivers/mfd/rohm-bd718x7.c @@ -156,18 +156,15 @@ static int bd718xx_i2c_probe(struct i2c_client *i2c) } regmap = devm_regmap_init_i2c(i2c, &bd718xx_regmap_config); - if (IS_ERR(regmap)) { - dev_err(&i2c->dev, "regmap initialization failed\n"); - return PTR_ERR(regmap); - } + if (IS_ERR(regmap)) + return dev_err_probe(&i2c->dev, PTR_ERR(regmap), + "regmap initialization failed\n"); ret = devm_regmap_add_irq_chip(&i2c->dev, regmap, i2c->irq, IRQF_ONESHOT, 0, &bd718xx_irq_chip, &irq_data); - if (ret) { - dev_err(&i2c->dev, "Failed to add irq_chip\n"); - return ret; - } + if (ret) + return dev_err_probe(&i2c->dev, ret, "Failed to add irq_chip\n"); ret = bd718xx_init_press_duration(regmap, &i2c->dev); if (ret) @@ -175,10 +172,8 @@ static int bd718xx_i2c_probe(struct i2c_client *i2c) ret = regmap_irq_get_virq(irq_data, BD718XX_INT_PWRBTN_S); - if (ret < 0) { - dev_err(&i2c->dev, "Failed to get the IRQ\n"); - return ret; - } + if (ret < 0) + return dev_err_probe(&i2c->dev, ret, "Failed to get the IRQ\n"); button.irq = ret; @@ -186,7 +181,7 @@ static int bd718xx_i2c_probe(struct i2c_client *i2c) mfd, cells, NULL, 0, regmap_irq_get_domain(irq_data)); if (ret) - dev_err(&i2c->dev, "Failed to create subdevices\n"); + dev_err_probe(&i2c->dev, ret, "Failed to create subdevices\n"); return ret; } diff --git a/drivers/mfd/rohm-bd9576.c b/drivers/mfd/rohm-bd9576.c index c854ab5bcd80..6491e385d980 100644 --- a/drivers/mfd/rohm-bd9576.c +++ b/drivers/mfd/rohm-bd9576.c @@ -121,10 +121,9 @@ static int bd957x_i2c_probe(struct i2c_client *i2c) } regmap = devm_regmap_init_i2c(i2c, &bd957x_regmap); - if (IS_ERR(regmap)) { - dev_err(&i2c->dev, "Failed to initialize Regmap\n"); - return PTR_ERR(regmap); - } + if (IS_ERR(regmap)) + return dev_err_probe(&i2c->dev, PTR_ERR(regmap), + "Failed to initialize Regmap\n"); /* * BD9576 behaves badly. It kepts IRQ line asserted for the whole @@ -145,10 +144,10 @@ static int bd957x_i2c_probe(struct i2c_client *i2c) ret = devm_regmap_add_irq_chip(&i2c->dev, regmap, i2c->irq, IRQF_ONESHOT, 0, &bd9576_irq_chip, &irq_data); - if (ret) { - dev_err(&i2c->dev, "Failed to add IRQ chip\n"); - return ret; - } + if (ret) + return dev_err_probe(&i2c->dev, ret, + "Failed to add IRQ chip\n"); + domain = regmap_irq_get_domain(irq_data); } else { ret = regmap_update_bits(regmap, BD957X_REG_INT_MAIN_MASK, @@ -162,7 +161,7 @@ static int bd957x_i2c_probe(struct i2c_client *i2c) ret = devm_mfd_add_devices(&i2c->dev, PLATFORM_DEVID_AUTO, cells, num_cells, NULL, 0, domain); if (ret) - dev_err(&i2c->dev, "Failed to create subdevices\n"); + dev_err_probe(&i2c->dev, ret, "Failed to create subdevices\n"); return ret; }