From a0f100c569fea84e4eb7750c5d85886e9e77cf4d Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Wed, 29 Mar 2023 18:19:11 +0200 Subject: [PATCH] bmips: bcm6348-enet: register emac driver from iudma MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- .../net/ethernet/broadcom/bcm6348-enet.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) 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 75e85aa0f32..2bd243089eb 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; +} -- 2.30.2