Skip to content

Commit e97b21e

Browse files
rddunlapdavem330
authored andcommitted
net: ethernet: lantiq_etop: fix build errors/warnings
Fix build error and warnings reported by kernel test robot: drivers/net/ethernet/lantiq_etop.c: In function 'ltq_etop_probe': drivers/net/ethernet/lantiq_etop.c:673:15: error: implicit declaration of function 'device_property_read_u32' [-Werror=implicit-function-declaration] 673 | err = device_property_read_u32(&pdev->dev, "lantiq,tx-burst-length", &priv->tx_burst_len); drivers/net/ethernet/lantiq_etop.c: At top level: drivers/net/ethernet/lantiq_etop.c:730:1: warning: no previous prototype for 'init_ltq_etop' [-Wmissing-prototypes] 730 | init_ltq_etop(void) drivers/net/ethernet/lantiq_etop.c: In function 'ltq_etop_hw_init': drivers/net/ethernet/lantiq_etop.c:276:25: warning: ignoring return value of 'request_irq' declared with attribute 'warn_unused_result' [-Wunused-result] 276 | request_irq(irq, ltq_etop_dma_irq, 0, "etop_tx", priv); drivers/net/ethernet/lantiq_etop.c:284:25: warning: ignoring return value of 'request_irq' declared with attribute 'warn_unused_result' [-Wunused-result] 284 | request_irq(irq, ltq_etop_dma_irq, 0, "etop_rx", priv); Fixes: 14d4e30 ("net: lantiq: configure the burst length in ethernet drivers") Fixes: dddb29e ("net: lantiq_etop: remove deprecated IRQF_DISABLED") Fixes: 504d472 ("MIPS: Lantiq: Add ethernet driver") Signed-off-by: Randy Dunlap <[email protected]> Reported-by: kernel test robot <[email protected]> Link: lore.kernel.org/r/[email protected] To: [email protected] Cc: Aleksander Jan Bajkowski <[email protected]> Cc: Hauke Mehrtens <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Jakub Kicinski <[email protected]> Cc: John Crispin <[email protected]> Cc: [email protected] Cc: Ralf Baechle <[email protected]> Cc: Michael Opdenacker <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b922f62 commit e97b21e

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

drivers/net/ethernet/lantiq_etop.c

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <linux/io.h>
2626
#include <linux/dma-mapping.h>
2727
#include <linux/module.h>
28+
#include <linux/property.h>
2829

2930
#include <asm/checksum.h>
3031

@@ -239,6 +240,7 @@ ltq_etop_hw_init(struct net_device *dev)
239240
{
240241
struct ltq_etop_priv *priv = netdev_priv(dev);
241242
int i;
243+
int err;
242244

243245
ltq_pmu_enable(PMU_PPE);
244246

@@ -273,15 +275,27 @@ ltq_etop_hw_init(struct net_device *dev)
273275

274276
if (IS_TX(i)) {
275277
ltq_dma_alloc_tx(&ch->dma);
276-
request_irq(irq, ltq_etop_dma_irq, 0, "etop_tx", priv);
278+
err = request_irq(irq, ltq_etop_dma_irq, 0, "etop_tx", priv);
279+
if (err) {
280+
netdev_err(dev,
281+
"Unable to get Tx DMA IRQ %d\n",
282+
irq);
283+
return err;
284+
}
277285
} else if (IS_RX(i)) {
278286
ltq_dma_alloc_rx(&ch->dma);
279287
for (ch->dma.desc = 0; ch->dma.desc < LTQ_DESC_NUM;
280288
ch->dma.desc++)
281289
if (ltq_etop_alloc_skb(ch))
282290
return -ENOMEM;
283291
ch->dma.desc = 0;
284-
request_irq(irq, ltq_etop_dma_irq, 0, "etop_rx", priv);
292+
err = request_irq(irq, ltq_etop_dma_irq, 0, "etop_rx", priv);
293+
if (err) {
294+
netdev_err(dev,
295+
"Unable to get Rx DMA IRQ %d\n",
296+
irq);
297+
return err;
298+
}
285299
}
286300
ch->dma.irq = irq;
287301
}
@@ -726,7 +740,7 @@ static struct platform_driver ltq_mii_driver = {
726740
},
727741
};
728742

729-
int __init
743+
static int __init
730744
init_ltq_etop(void)
731745
{
732746
int ret = platform_driver_probe(&ltq_mii_driver, ltq_etop_probe);

0 commit comments

Comments
 (0)