Commit d1a55841 authored by Stephen Boyd's avatar Stephen Boyd Committed by David S. Miller

net: Remove dev_err() usage after platform_get_irq()

We don't need dev_err() messages when platform_get_irq() fails now that
platform_get_irq() prints an error message itself when something goes
wrong. Let's remove these prints with a simple semantic patch.

// <smpl>
@@
expression ret;
struct platform_device *E;
@@

ret =
(
platform_get_irq(E, ...)
|
platform_get_irq_byname(E, ...)
);

if ( \( ret < 0 \| ret <= 0 \) )
{
(
-if (ret != -EPROBE_DEFER)
-{ ...
-dev_err(...);
-... }
|
...
-dev_err(...);
)
...
}
// </smpl>

While we're here, remove braces on if statements that only have one
statement (manually).

Cc: "David S. Miller" <davem@davemloft.net>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: Saeed Mahameed <saeedm@mellanox.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: Felix Fietkau <nbd@nbd.name>
Cc: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: netdev@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2d73a6c3
...@@ -1936,7 +1936,6 @@ static int ican3_probe(struct platform_device *pdev) ...@@ -1936,7 +1936,6 @@ static int ican3_probe(struct platform_device *pdev)
/* find our IRQ number */ /* find our IRQ number */
mod->irq = platform_get_irq(pdev, 0); mod->irq = platform_get_irq(pdev, 0);
if (mod->irq < 0) { if (mod->irq < 0) {
dev_err(dev, "IRQ line not found\n");
ret = -ENODEV; ret = -ENODEV;
goto out_free_ndev; goto out_free_ndev;
} }
......
...@@ -759,7 +759,6 @@ static int rcar_can_probe(struct platform_device *pdev) ...@@ -759,7 +759,6 @@ static int rcar_can_probe(struct platform_device *pdev)
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");
err = irq; err = irq;
goto fail; goto fail;
} }
......
...@@ -1651,14 +1651,12 @@ static int rcar_canfd_probe(struct platform_device *pdev) ...@@ -1651,14 +1651,12 @@ static int rcar_canfd_probe(struct platform_device *pdev)
ch_irq = platform_get_irq(pdev, 0); ch_irq = platform_get_irq(pdev, 0);
if (ch_irq < 0) { if (ch_irq < 0) {
dev_err(&pdev->dev, "no Channel IRQ resource\n");
err = ch_irq; err = ch_irq;
goto fail_dev; goto fail_dev;
} }
g_irq = platform_get_irq(pdev, 1); g_irq = platform_get_irq(pdev, 1);
if (g_irq < 0) { if (g_irq < 0) {
dev_err(&pdev->dev, "no Global IRQ resource\n");
err = g_irq; err = g_irq;
goto fail_dev; goto fail_dev;
} }
......
...@@ -787,7 +787,6 @@ static int sun4ican_probe(struct platform_device *pdev) ...@@ -787,7 +787,6 @@ static int sun4ican_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0) {
dev_err(&pdev->dev, "could not get a valid irq\n");
err = -ENODEV; err = -ENODEV;
goto exit; goto exit;
} }
......
...@@ -1100,7 +1100,6 @@ static int au1000_probe(struct platform_device *pdev) ...@@ -1100,7 +1100,6 @@ static int au1000_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0) {
dev_err(&pdev->dev, "failed to retrieve IRQ\n");
err = -ENODEV; err = -ENODEV;
goto out; goto out;
} }
......
...@@ -467,10 +467,8 @@ static int xgbe_platform_probe(struct platform_device *pdev) ...@@ -467,10 +467,8 @@ static int xgbe_platform_probe(struct platform_device *pdev)
/* Get the device interrupt */ /* Get the device interrupt */
ret = platform_get_irq(pdev, 0); ret = platform_get_irq(pdev, 0);
if (ret < 0) { if (ret < 0)
dev_err(dev, "platform_get_irq 0 failed\n");
goto err_io; goto err_io;
}
pdata->dev_irq = ret; pdata->dev_irq = ret;
/* Get the per channel DMA interrupts */ /* Get the per channel DMA interrupts */
...@@ -479,12 +477,8 @@ static int xgbe_platform_probe(struct platform_device *pdev) ...@@ -479,12 +477,8 @@ static int xgbe_platform_probe(struct platform_device *pdev)
for (i = 0; (i < max) && (dma_irqnum < dma_irqend); i++) { for (i = 0; (i < max) && (dma_irqnum < dma_irqend); i++) {
ret = platform_get_irq(pdata->platdev, dma_irqnum++); ret = platform_get_irq(pdata->platdev, dma_irqnum++);
if (ret < 0) { if (ret < 0)
netdev_err(pdata->netdev,
"platform_get_irq %u failed\n",
dma_irqnum - 1);
goto err_io; goto err_io;
}
pdata->channel_irq[i] = ret; pdata->channel_irq[i] = ret;
} }
...@@ -496,10 +490,8 @@ static int xgbe_platform_probe(struct platform_device *pdev) ...@@ -496,10 +490,8 @@ static int xgbe_platform_probe(struct platform_device *pdev)
/* Get the auto-negotiation interrupt */ /* Get the auto-negotiation interrupt */
ret = platform_get_irq(phy_pdev, phy_irqnum++); ret = platform_get_irq(phy_pdev, phy_irqnum++);
if (ret < 0) { if (ret < 0)
dev_err(dev, "platform_get_irq phy 0 failed\n");
goto err_io; goto err_io;
}
pdata->an_irq = ret; pdata->an_irq = ret;
/* Configure the netdev resource */ /* Configure the netdev resource */
......
...@@ -54,10 +54,8 @@ static int xge_get_resources(struct xge_pdata *pdata) ...@@ -54,10 +54,8 @@ static int xge_get_resources(struct xge_pdata *pdata)
} }
ret = platform_get_irq(pdev, 0); ret = platform_get_irq(pdev, 0);
if (ret < 0) { if (ret < 0)
dev_err(dev, "Unable to get irq\n");
return ret; return ret;
}
pdata->resources.irq = ret; pdata->resources.irq = ret;
return 0; return 0;
......
...@@ -1617,7 +1617,6 @@ static int xgene_get_rx_delay(struct xgene_enet_pdata *pdata) ...@@ -1617,7 +1617,6 @@ static int xgene_get_rx_delay(struct xgene_enet_pdata *pdata)
static int xgene_enet_get_irqs(struct xgene_enet_pdata *pdata) static int xgene_enet_get_irqs(struct xgene_enet_pdata *pdata)
{ {
struct platform_device *pdev = pdata->pdev; struct platform_device *pdev = pdata->pdev;
struct device *dev = &pdev->dev;
int i, ret, max_irqs; int i, ret, max_irqs;
if (phy_interface_mode_is_rgmii(pdata->phy_mode)) if (phy_interface_mode_is_rgmii(pdata->phy_mode))
...@@ -1637,9 +1636,7 @@ static int xgene_enet_get_irqs(struct xgene_enet_pdata *pdata) ...@@ -1637,9 +1636,7 @@ static int xgene_enet_get_irqs(struct xgene_enet_pdata *pdata)
pdata->cq_cnt = max_irqs / 2; pdata->cq_cnt = max_irqs / 2;
break; break;
} }
dev_err(dev, "Unable to get ENET IRQ\n"); return ret ? : -ENXIO;
ret = ret ? : -ENXIO;
return ret;
} }
pdata->irqs[i] = ret; pdata->irqs[i] = ret;
} }
......
...@@ -1351,10 +1351,8 @@ static int nb8800_probe(struct platform_device *pdev) ...@@ -1351,10 +1351,8 @@ static int nb8800_probe(struct platform_device *pdev)
ops = match->data; ops = match->data;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq <= 0) { if (irq <= 0)
dev_err(&pdev->dev, "No IRQ\n");
return -EINVAL; return -EINVAL;
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
base = devm_ioremap_resource(&pdev->dev, res); base = devm_ioremap_resource(&pdev->dev, res);
......
...@@ -199,10 +199,8 @@ static int bgmac_probe(struct platform_device *pdev) ...@@ -199,10 +199,8 @@ static int bgmac_probe(struct platform_device *pdev)
dev_warn(&pdev->dev, "MAC address not present in device tree\n"); dev_warn(&pdev->dev, "MAC address not present in device tree\n");
bgmac->irq = platform_get_irq(pdev, 0); bgmac->irq = platform_get_irq(pdev, 0);
if (bgmac->irq < 0) { if (bgmac->irq < 0)
dev_err(&pdev->dev, "Unable to obtain IRQ\n");
return bgmac->irq; return bgmac->irq;
}
regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "amac_base"); regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "amac_base");
if (!regs) { if (!regs) {
......
...@@ -2422,10 +2422,8 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev) ...@@ -2422,10 +2422,8 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev)
/* Interrupt */ /* Interrupt */
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq <= 0) { if (irq <= 0)
dev_err(dev, "no IRQ\n");
return irq ? irq : -ENODEV; return irq ? irq : -ENODEV;
}
port->irq = irq; port->irq = irq;
/* Clock the port */ /* Clock the port */
......
...@@ -1500,8 +1500,6 @@ dm9000_probe(struct platform_device *pdev) ...@@ -1500,8 +1500,6 @@ dm9000_probe(struct platform_device *pdev)
ndev->irq = platform_get_irq(pdev, 0); ndev->irq = platform_get_irq(pdev, 0);
if (ndev->irq < 0) { if (ndev->irq < 0) {
dev_err(db->dev, "interrupt resource unavailable: %d\n",
ndev->irq);
ret = ndev->irq; ret = ndev->irq;
goto out; goto out;
} }
......
...@@ -877,7 +877,6 @@ static int hisi_femac_drv_probe(struct platform_device *pdev) ...@@ -877,7 +877,6 @@ static int hisi_femac_drv_probe(struct platform_device *pdev)
ndev->irq = platform_get_irq(pdev, 0); ndev->irq = platform_get_irq(pdev, 0);
if (ndev->irq <= 0) { if (ndev->irq <= 0) {
dev_err(dev, "No irq resource\n");
ret = -ENODEV; ret = -ENODEV;
goto out_disconnect_phy; goto out_disconnect_phy;
} }
......
...@@ -458,17 +458,11 @@ static int xrx200_probe(struct platform_device *pdev) ...@@ -458,17 +458,11 @@ static int xrx200_probe(struct platform_device *pdev)
} }
priv->chan_rx.dma.irq = platform_get_irq_byname(pdev, "rx"); priv->chan_rx.dma.irq = platform_get_irq_byname(pdev, "rx");
if (priv->chan_rx.dma.irq < 0) { if (priv->chan_rx.dma.irq < 0)
dev_err(dev, "failed to get RX IRQ, %i\n",
priv->chan_rx.dma.irq);
return -ENOENT; return -ENOENT;
}
priv->chan_tx.dma.irq = platform_get_irq_byname(pdev, "tx"); priv->chan_tx.dma.irq = platform_get_irq_byname(pdev, "tx");
if (priv->chan_tx.dma.irq < 0) { if (priv->chan_tx.dma.irq < 0)
dev_err(dev, "failed to get TX IRQ, %i\n",
priv->chan_tx.dma.irq);
return -ENOENT; return -ENOENT;
}
/* get the clock */ /* get the clock */
priv->clk = devm_clk_get(dev, NULL); priv->clk = devm_clk_get(dev, NULL);
......
...@@ -993,14 +993,12 @@ static int w90p910_ether_probe(struct platform_device *pdev) ...@@ -993,14 +993,12 @@ static int w90p910_ether_probe(struct platform_device *pdev)
ether->txirq = platform_get_irq(pdev, 0); ether->txirq = platform_get_irq(pdev, 0);
if (ether->txirq < 0) { if (ether->txirq < 0) {
dev_err(&pdev->dev, "failed to get ether tx irq\n");
error = -ENXIO; error = -ENXIO;
goto failed_free_io; goto failed_free_io;
} }
ether->rxirq = platform_get_irq(pdev, 1); ether->rxirq = platform_get_irq(pdev, 1);
if (ether->rxirq < 0) { if (ether->rxirq < 0) {
dev_err(&pdev->dev, "failed to get ether rx irq\n");
error = -ENXIO; error = -ENXIO;
goto failed_free_io; goto failed_free_io;
} }
......
...@@ -556,11 +556,8 @@ static int emac_probe_resources(struct platform_device *pdev, ...@@ -556,11 +556,8 @@ static int emac_probe_resources(struct platform_device *pdev,
/* Core 0 interrupt */ /* Core 0 interrupt */
ret = platform_get_irq(pdev, 0); ret = platform_get_irq(pdev, 0);
if (ret < 0) { if (ret < 0)
dev_err(&pdev->dev,
"error: missing core0 irq resource (error=%i)\n", ret);
return ret; return ret;
}
adpt->irq.irq = ret; adpt->irq.irq = ret;
/* base register address */ /* base register address */
......
...@@ -1573,10 +1573,8 @@ static int ave_probe(struct platform_device *pdev) ...@@ -1573,10 +1573,8 @@ static int ave_probe(struct platform_device *pdev)
} }
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(dev, "IRQ not found\n");
return irq; return irq;
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
base = devm_ioremap_resource(dev, res); base = devm_ioremap_resource(dev, res);
......
...@@ -431,13 +431,8 @@ static int dwc_eth_dwmac_probe(struct platform_device *pdev) ...@@ -431,13 +431,8 @@ static int dwc_eth_dwmac_probe(struct platform_device *pdev)
* resource initialization is done in the glue logic. * resource initialization is done in the glue logic.
*/ */
stmmac_res.irq = platform_get_irq(pdev, 0); stmmac_res.irq = platform_get_irq(pdev, 0);
if (stmmac_res.irq < 0) { if (stmmac_res.irq < 0)
if (stmmac_res.irq != -EPROBE_DEFER)
dev_err(&pdev->dev,
"IRQ configuration information not found\n");
return stmmac_res.irq; return stmmac_res.irq;
}
stmmac_res.wol_irq = stmmac_res.irq; stmmac_res.wol_irq = stmmac_res.irq;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
......
...@@ -610,13 +610,8 @@ int stmmac_get_platform_resources(struct platform_device *pdev, ...@@ -610,13 +610,8 @@ int stmmac_get_platform_resources(struct platform_device *pdev,
* probe if needed before we went too far with resource allocation. * probe if needed before we went too far with resource allocation.
*/ */
stmmac_res->irq = platform_get_irq_byname(pdev, "macirq"); stmmac_res->irq = platform_get_irq_byname(pdev, "macirq");
if (stmmac_res->irq < 0) { if (stmmac_res->irq < 0)
if (stmmac_res->irq != -EPROBE_DEFER) {
dev_err(&pdev->dev,
"MAC IRQ configuration information not found\n");
}
return stmmac_res->irq; return stmmac_res->irq;
}
/* On some platforms e.g. SPEAr the wake up irq differs from the mac irq /* On some platforms e.g. SPEAr the wake up irq differs from the mac irq
* The external wake up irq can be passed through the platform code * The external wake up irq can be passed through the platform code
......
...@@ -17,10 +17,8 @@ mt76_wmac_probe(struct platform_device *pdev) ...@@ -17,10 +17,8 @@ mt76_wmac_probe(struct platform_device *pdev)
int ret; int ret;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0)
dev_err(&pdev->dev, "Failed to get device IRQ\n");
return irq; return irq;
}
mem_base = devm_ioremap_resource(&pdev->dev, res); mem_base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(mem_base)) { if (IS_ERR(mem_base)) {
......
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