diff options
author | Thierry Reding <treding@nvidia.com> | 2017-03-21 16:12:10 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-03-22 12:15:15 -0700 |
commit | 33e85b8dd69e7f2fbf77f04bfc97ea7c76bccf9b (patch) | |
tree | 301526d3550677926b4c215b5e67f2e9e9651731 /drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | |
parent | f39768744fd6cd45291c957bd4bf2f68f073ed73 (diff) | |
download | op-kernel-dev-33e85b8dd69e7f2fbf77f04bfc97ea7c76bccf9b.zip op-kernel-dev-33e85b8dd69e7f2fbf77f04bfc97ea7c76bccf9b.tar.gz |
net: stmmac: Restore DT backwards-compatibility
Recent changes to support multiple queues in the device tree bindings
resulted in the number of RX and TX queues to be initialized to zero for
device trees not adhering to the new bindings.
Restore backwards-compatibility with those device trees by falling back
to a single RX and TX queues each.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Acked-By: Joao Pinto <jpinto@synopsys.com>
Tested-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index f5c8b1b..7fc3a1e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -143,6 +143,13 @@ static void stmmac_mtl_setup(struct platform_device *pdev, struct device_node *tx_node; u8 queue = 0; + /* For backwards-compatibility with device trees that don't have any + * snps,mtl-rx-config or snps,mtl-tx-config properties, we fall back + * to one RX and TX queues each. + */ + plat->rx_queues_to_use = 1; + plat->tx_queues_to_use = 1; + rx_node = of_parse_phandle(pdev->dev.of_node, "snps,mtl-rx-config", 0); if (!rx_node) return; |