Commit e42688ed authored by Dejin Zheng's avatar Dejin Zheng Committed by Wolfram Sang

i2c: busses: remove duplicate dev_err()

it will print an error message by itself when platform_get_irq()
goes wrong. so don't need dev_err() in here again.
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Suggested-by: default avatarMarkus Elfring <Markus.Elfring@web.de>
Signed-off-by: default avatarDejin Zheng <zhengdejin5@gmail.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent e5175261
...@@ -394,10 +394,8 @@ static int altr_i2c_probe(struct platform_device *pdev) ...@@ -394,10 +394,8 @@ static int altr_i2c_probe(struct platform_device *pdev)
return PTR_ERR(idev->base); return PTR_ERR(idev->base);
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "missing interrupt resource\n");
return irq; return irq;
}
idev->i2c_clk = devm_clk_get(&pdev->dev, NULL); idev->i2c_clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(idev->i2c_clk)) { if (IS_ERR(idev->i2c_clk)) {
......
...@@ -746,10 +746,8 @@ static int axxia_i2c_probe(struct platform_device *pdev) ...@@ -746,10 +746,8 @@ static int axxia_i2c_probe(struct platform_device *pdev)
return PTR_ERR(base); return PTR_ERR(base);
idev->irq = platform_get_irq(pdev, 0); idev->irq = platform_get_irq(pdev, 0);
if (idev->irq < 0) { if (idev->irq < 0)
dev_err(&pdev->dev, "missing interrupt resource\n");
return idev->irq; return idev->irq;
}
idev->i2c_clk = devm_clk_get(&pdev->dev, "i2c"); idev->i2c_clk = devm_clk_get(&pdev->dev, "i2c");
if (IS_ERR(idev->i2c_clk)) { if (IS_ERR(idev->i2c_clk)) {
......
...@@ -821,8 +821,7 @@ static int bcm_kona_i2c_probe(struct platform_device *pdev) ...@@ -821,8 +821,7 @@ static int bcm_kona_i2c_probe(struct platform_device *pdev)
/* Get the interrupt number */ /* Get the interrupt number */
dev->irq = platform_get_irq(pdev, 0); dev->irq = platform_get_irq(pdev, 0);
if (dev->irq < 0) { if (dev->irq < 0) {
dev_err(dev->device, "no irq resource\n"); rc = dev->irq;
rc = -ENODEV;
goto probe_disable_clk; goto probe_disable_clk;
} }
......
...@@ -314,10 +314,8 @@ static int cht_wc_i2c_adap_i2c_probe(struct platform_device *pdev) ...@@ -314,10 +314,8 @@ static int cht_wc_i2c_adap_i2c_probe(struct platform_device *pdev)
int ret, reg, irq; int ret, reg, irq;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "Error missing irq resource\n"); return irq;
return -EINVAL;
}
adap = devm_kzalloc(&pdev->dev, sizeof(*adap), GFP_KERNEL); adap = devm_kzalloc(&pdev->dev, sizeof(*adap), GFP_KERNEL);
if (!adap) if (!adap)
......
...@@ -1342,10 +1342,8 @@ static int img_i2c_probe(struct platform_device *pdev) ...@@ -1342,10 +1342,8 @@ static int img_i2c_probe(struct platform_device *pdev)
return PTR_ERR(i2c->base); return PTR_ERR(i2c->base);
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "can't get irq number\n");
return irq; return irq;
}
i2c->sys_clk = devm_clk_get(&pdev->dev, "sys"); i2c->sys_clk = devm_clk_get(&pdev->dev, "sys");
if (IS_ERR(i2c->sys_clk)) { if (IS_ERR(i2c->sys_clk)) {
......
...@@ -551,10 +551,8 @@ static int lpi2c_imx_probe(struct platform_device *pdev) ...@@ -551,10 +551,8 @@ static int lpi2c_imx_probe(struct platform_device *pdev)
return PTR_ERR(lpi2c_imx->base); return PTR_ERR(lpi2c_imx->base);
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "can't get irq number\n");
return irq; return irq;
}
lpi2c_imx->adapter.owner = THIS_MODULE; lpi2c_imx->adapter.owner = THIS_MODULE;
lpi2c_imx->adapter.algo = &lpi2c_imx_algo; lpi2c_imx->adapter.algo = &lpi2c_imx_algo;
......
...@@ -360,10 +360,8 @@ static int i2c_lpc2k_probe(struct platform_device *pdev) ...@@ -360,10 +360,8 @@ static int i2c_lpc2k_probe(struct platform_device *pdev)
return PTR_ERR(i2c->base); return PTR_ERR(i2c->base);
i2c->irq = platform_get_irq(pdev, 0); i2c->irq = platform_get_irq(pdev, 0);
if (i2c->irq < 0) { if (i2c->irq < 0)
dev_err(&pdev->dev, "can't get interrupt resource\n");
return i2c->irq; return i2c->irq;
}
init_waitqueue_head(&i2c->wait); init_waitqueue_head(&i2c->wait);
......
...@@ -426,10 +426,8 @@ static int meson_i2c_probe(struct platform_device *pdev) ...@@ -426,10 +426,8 @@ static int meson_i2c_probe(struct platform_device *pdev)
return PTR_ERR(i2c->regs); return PTR_ERR(i2c->regs);
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "can't find IRQ\n");
return irq; return irq;
}
ret = devm_request_irq(&pdev->dev, irq, meson_i2c_irq, 0, NULL, i2c); ret = devm_request_irq(&pdev->dev, irq, meson_i2c_irq, 0, NULL, i2c);
if (ret < 0) { if (ret < 0) {
......
...@@ -1365,10 +1365,8 @@ omap_i2c_probe(struct platform_device *pdev) ...@@ -1365,10 +1365,8 @@ omap_i2c_probe(struct platform_device *pdev)
u16 minor, major; u16 minor, major;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "no irq resource?\n");
return irq; return irq;
}
omap = devm_kzalloc(&pdev->dev, sizeof(struct omap_i2c_dev), GFP_KERNEL); omap = devm_kzalloc(&pdev->dev, sizeof(struct omap_i2c_dev), GFP_KERNEL);
if (!omap) if (!omap)
......
...@@ -407,10 +407,8 @@ static int owl_i2c_probe(struct platform_device *pdev) ...@@ -407,10 +407,8 @@ static int owl_i2c_probe(struct platform_device *pdev)
return PTR_ERR(i2c_dev->base); return PTR_ERR(i2c_dev->base);
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(dev, "failed to get IRQ number\n");
return irq; return irq;
}
if (of_property_read_u32(dev->of_node, "clock-frequency", if (of_property_read_u32(dev->of_node, "clock-frequency",
&i2c_dev->bus_freq)) &i2c_dev->bus_freq))
......
...@@ -720,7 +720,6 @@ static int i2c_pnx_probe(struct platform_device *pdev) ...@@ -720,7 +720,6 @@ static int i2c_pnx_probe(struct platform_device *pdev)
alg_data->irq = platform_get_irq(pdev, 0); alg_data->irq = platform_get_irq(pdev, 0);
if (alg_data->irq < 0) { if (alg_data->irq < 0) {
dev_err(&pdev->dev, "Failed to get IRQ from platform resource\n");
ret = alg_data->irq; ret = alg_data->irq;
goto out_clock; goto out_clock;
} }
......
...@@ -1267,10 +1267,8 @@ static int i2c_pxa_probe(struct platform_device *dev) ...@@ -1267,10 +1267,8 @@ static int i2c_pxa_probe(struct platform_device *dev)
return PTR_ERR(i2c->reg_base); return PTR_ERR(i2c->reg_base);
irq = platform_get_irq(dev, 0); irq = platform_get_irq(dev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&dev->dev, "no irq resource: %d\n", irq);
return irq; return irq;
}
/* Default adapter num to device id; i2c_pxa_probe_dt can override. */ /* Default adapter num to device id; i2c_pxa_probe_dt can override. */
i2c->adap.nr = dev->id; i2c->adap.nr = dev->id;
......
...@@ -1761,10 +1761,8 @@ static int qup_i2c_probe(struct platform_device *pdev) ...@@ -1761,10 +1761,8 @@ static int qup_i2c_probe(struct platform_device *pdev)
return PTR_ERR(qup->base); return PTR_ERR(qup->base);
qup->irq = platform_get_irq(pdev, 0); qup->irq = platform_get_irq(pdev, 0);
if (qup->irq < 0) { if (qup->irq < 0)
dev_err(qup->dev, "No IRQ defined\n");
return qup->irq; return qup->irq;
}
if (has_acpi_companion(qup->dev)) { if (has_acpi_companion(qup->dev)) {
ret = device_property_read_u32(qup->dev, ret = device_property_read_u32(qup->dev,
......
...@@ -1260,10 +1260,8 @@ static int rk3x_i2c_probe(struct platform_device *pdev) ...@@ -1260,10 +1260,8 @@ static int rk3x_i2c_probe(struct platform_device *pdev)
/* IRQ setup */ /* IRQ setup */
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "cannot find rk3x IRQ\n");
return irq; return irq;
}
ret = devm_request_irq(&pdev->dev, irq, rk3x_i2c_irq, ret = devm_request_irq(&pdev->dev, irq, rk3x_i2c_irq,
0, dev_name(&pdev->dev), i2c); 0, dev_name(&pdev->dev), i2c);
......
...@@ -492,10 +492,8 @@ static int sprd_i2c_probe(struct platform_device *pdev) ...@@ -492,10 +492,8 @@ static int sprd_i2c_probe(struct platform_device *pdev)
return PTR_ERR(i2c_dev->base); return PTR_ERR(i2c_dev->base);
i2c_dev->irq = platform_get_irq(pdev, 0); i2c_dev->irq = platform_get_irq(pdev, 0);
if (i2c_dev->irq < 0) { if (i2c_dev->irq < 0)
dev_err(&pdev->dev, "failed to get irq resource\n");
return i2c_dev->irq; return i2c_dev->irq;
}
i2c_set_adapdata(&i2c_dev->adap, i2c_dev); i2c_set_adapdata(&i2c_dev->adap, i2c_dev);
init_completion(&i2c_dev->complete); init_completion(&i2c_dev->complete);
......
...@@ -236,10 +236,8 @@ static int p2wi_probe(struct platform_device *pdev) ...@@ -236,10 +236,8 @@ static int p2wi_probe(struct platform_device *pdev)
strlcpy(p2wi->adapter.name, pdev->name, sizeof(p2wi->adapter.name)); strlcpy(p2wi->adapter.name, pdev->name, sizeof(p2wi->adapter.name));
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(dev, "failed to retrieve irq: %d\n", irq);
return irq; return irq;
}
p2wi->clk = devm_clk_get(dev, NULL); p2wi->clk = devm_clk_get(dev, NULL);
if (IS_ERR(p2wi->clk)) { if (IS_ERR(p2wi->clk)) {
......
...@@ -578,10 +578,8 @@ static int synquacer_i2c_probe(struct platform_device *pdev) ...@@ -578,10 +578,8 @@ static int synquacer_i2c_probe(struct platform_device *pdev)
return PTR_ERR(i2c->base); return PTR_ERR(i2c->base);
i2c->irq = platform_get_irq(pdev, 0); i2c->irq = platform_get_irq(pdev, 0);
if (i2c->irq < 0) { if (i2c->irq < 0)
dev_err(&pdev->dev, "no IRQ resource found\n");
return -ENODEV; return -ENODEV;
}
ret = devm_request_irq(&pdev->dev, i2c->irq, synquacer_i2c_isr, ret = devm_request_irq(&pdev->dev, i2c->irq, synquacer_i2c_isr,
0, dev_name(&pdev->dev), i2c); 0, dev_name(&pdev->dev), i2c);
......
...@@ -529,10 +529,8 @@ static int uniphier_fi2c_probe(struct platform_device *pdev) ...@@ -529,10 +529,8 @@ static int uniphier_fi2c_probe(struct platform_device *pdev)
return PTR_ERR(priv->membase); return PTR_ERR(priv->membase);
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(dev, "failed to get IRQ number\n");
return irq; return irq;
}
if (of_property_read_u32(dev->of_node, "clock-frequency", &bus_speed)) if (of_property_read_u32(dev->of_node, "clock-frequency", &bus_speed))
bus_speed = I2C_MAX_STANDARD_MODE_FREQ; bus_speed = I2C_MAX_STANDARD_MODE_FREQ;
......
...@@ -324,10 +324,8 @@ static int uniphier_i2c_probe(struct platform_device *pdev) ...@@ -324,10 +324,8 @@ static int uniphier_i2c_probe(struct platform_device *pdev)
return PTR_ERR(priv->membase); return PTR_ERR(priv->membase);
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(dev, "failed to get IRQ number\n");
return irq; return irq;
}
if (of_property_read_u32(dev->of_node, "clock-frequency", &bus_speed)) if (of_property_read_u32(dev->of_node, "clock-frequency", &bus_speed))
bus_speed = I2C_MAX_STANDARD_MODE_FREQ; bus_speed = I2C_MAX_STANDARD_MODE_FREQ;
......
...@@ -517,10 +517,8 @@ static int xlp9xx_i2c_probe(struct platform_device *pdev) ...@@ -517,10 +517,8 @@ static int xlp9xx_i2c_probe(struct platform_device *pdev)
return PTR_ERR(priv->base); return PTR_ERR(priv->base);
priv->irq = platform_get_irq(pdev, 0); priv->irq = platform_get_irq(pdev, 0);
if (priv->irq <= 0) { if (priv->irq <= 0)
dev_err(&pdev->dev, "invalid irq!\n");
return priv->irq; return priv->irq;
}
/* SMBAlert irq */ /* SMBAlert irq */
priv->alert_data.irq = platform_get_irq(pdev, 1); priv->alert_data.irq = platform_get_irq(pdev, 1);
if (priv->alert_data.irq <= 0) if (priv->alert_data.irq <= 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment