@@ -356,11 +356,9 @@ static int riic_init_hw(struct riic_dev *riic)
rate /= 2;
}
- if (brl > (0x1F + 3)) {
- dev_err(&riic->adapter.dev, "invalid speed (%lu). Too slow.\n",
- (unsigned long)t->bus_freq_hz);
- return -EINVAL;
- }
+ if (brl > (0x1F + 3))
+ return dev_err_probe(dev, -EINVAL, "invalid speed (%lu). Too slow.\n",
+ (unsigned long)t->bus_freq_hz);
brh = total_ticks - brl;
@@ -445,10 +443,9 @@ static int riic_i2c_probe(struct platform_device *pdev)
return PTR_ERR(riic->base);
riic->clk = devm_clk_get(dev, NULL);
- if (IS_ERR(riic->clk)) {
- dev_err(dev, "missing controller clock");
- return PTR_ERR(riic->clk);
- }
+ if (IS_ERR(riic->clk))
+ return dev_err_probe(dev, PTR_ERR(riic->clk),
+ "missing controller clock");
riic->rstc = devm_reset_control_get_optional_exclusive(dev, NULL);
if (IS_ERR(riic->rstc))
@@ -470,10 +467,9 @@ static int riic_i2c_probe(struct platform_device *pdev)
ret = devm_request_irq(dev, ret, riic_irqs[i].isr,
0, riic_irqs[i].name, riic);
- if (ret) {
- dev_err(dev, "failed to request irq %s\n", riic_irqs[i].name);
- return ret;
- }
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to request irq %s\n",
+ riic_irqs[i].name);
}
riic->info = of_device_get_match_data(dev);