[openwrt/openwrt] bmips: bcm6348-enet: register emac driver from iudma
LEDE Commits
lede-commits at lists.infradead.org
Wed Mar 29 09:34:26 PDT 2023
noltari pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/a0f100c569fea84e4eb7750c5d85886e9e77cf4d
commit a0f100c569fea84e4eb7750c5d85886e9e77cf4d
Author: Álvaro Fernández Rojas <noltari at gmail.com>
AuthorDate: Wed Mar 29 18:19:11 2023 +0200
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 <noltari at gmail.com>
---
.../files/drivers/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 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;
+}
More information about the lede-commits
mailing list