[PATCH RESEND] ethernet: stmmac: fix for none child queue node for tx node

From: Jianqun Xu
Date: Wed Apr 27 2022 - 21:09:39 EST


In case of nothing to be set for tx node result in no child queue node
for the tx node, this patch init the queue to tx_queues_to_use instead
of 0 to support dt file set no queue node for tx node.

Signed-off-by: Jianqun Xu <jay.xu@xxxxxxxxxxxxxx>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 2d8c095f3856..4f01a41c485c 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -279,7 +279,7 @@ static int stmmac_mtl_setup(struct platform_device *pdev,

queue++;
}
- if (queue != plat->tx_queues_to_use) {
+ if (queue != plat->tx_queues_to_use && of_get_child_count(tx_node)) {
ret = -EINVAL;
dev_err(&pdev->dev, "Not all TX queues were configured\n");
goto out;
--
2.25.1