From: Álvaro Fernández Rojas Date: Wed, 29 Mar 2023 16:19:11 +0000 (+0200) Subject: bmips: bcm6348-enet: register emac driver from iudma X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=a0f100c569fea84e4eb7750c5d85886e9e77cf4d;p=openwrt%2Fstaging%2Fneocturne.git bmips: bcm6348-enet: register emac driver from iudma Register the ethernet driver from iudma, which avoids the attempt to probe the emac driver before iudma and its consequent deferral. The ethernet driver can't work without iudma anyway. Signed-off-by: Álvaro Fernández Rojas --- diff --git a/target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6348-enet.c b/target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6348-enet.c index 75e85aa0f3..2bd243089e 100644 --- a/target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6348-enet.c +++ b/target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6348-enet.c @@ -128,6 +128,8 @@ struct bcm6348_iudma { unsigned int dma_channels; }; +int bcm6348_iudma_drivers_register(struct platform_device *pdev); + static inline u32 dma_readl(struct bcm6348_iudma *iudma, u32 off) { u32 val; @@ -269,7 +271,7 @@ static int bcm6348_iudma_probe(struct platform_device *pdev) platform_set_drvdata(pdev, iudma); - return 0; + return bcm6348_iudma_drivers_register(pdev); } static const struct of_device_id bcm6348_iudma_of_match[] = { @@ -1703,4 +1705,15 @@ static struct platform_driver bcm6348_emac_driver = { .probe = bcm6348_emac_probe, .remove = bcm6348_emac_remove, }; -module_platform_driver(bcm6348_emac_driver); + +int bcm6348_iudma_drivers_register(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + int ret; + + ret = platform_driver_register(&bcm6348_emac_driver); + if (ret) + dev_err(dev, "error registering emac driver!\n"); + + return ret; +}