stmmac: use of_property_read_u32 instead of read_u8
Numbers in DT are stored in “cells” which are 32-bits in size. of_property_read_u8 does not work properly because of endianness problem. This causes it to always return 0 with little-endian architectures. Fix it by using of_property_read_u32() OF API. Signed-off-by: Bhadram Varka <vbhadram@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
2f2b1ae24c
commit
e73b49ebd9
@@ -168,8 +168,8 @@ static void stmmac_mtl_setup(struct platform_device *pdev,
|
||||
}
|
||||
|
||||
/* Processing RX queues common config */
|
||||
if (of_property_read_u8(rx_node, "snps,rx-queues-to-use",
|
||||
&plat->rx_queues_to_use))
|
||||
if (of_property_read_u32(rx_node, "snps,rx-queues-to-use",
|
||||
&plat->rx_queues_to_use))
|
||||
plat->rx_queues_to_use = 1;
|
||||
|
||||
if (of_property_read_bool(rx_node, "snps,rx-sched-sp"))
|
||||
@@ -191,8 +191,8 @@ static void stmmac_mtl_setup(struct platform_device *pdev,
|
||||
else
|
||||
plat->rx_queues_cfg[queue].mode_to_use = MTL_QUEUE_DCB;
|
||||
|
||||
if (of_property_read_u8(q_node, "snps,map-to-dma-channel",
|
||||
&plat->rx_queues_cfg[queue].chan))
|
||||
if (of_property_read_u32(q_node, "snps,map-to-dma-channel",
|
||||
&plat->rx_queues_cfg[queue].chan))
|
||||
plat->rx_queues_cfg[queue].chan = queue;
|
||||
/* TODO: Dynamic mapping to be included in the future */
|
||||
|
||||
@@ -222,8 +222,8 @@ static void stmmac_mtl_setup(struct platform_device *pdev,
|
||||
}
|
||||
|
||||
/* Processing TX queues common config */
|
||||
if (of_property_read_u8(tx_node, "snps,tx-queues-to-use",
|
||||
&plat->tx_queues_to_use))
|
||||
if (of_property_read_u32(tx_node, "snps,tx-queues-to-use",
|
||||
&plat->tx_queues_to_use))
|
||||
plat->tx_queues_to_use = 1;
|
||||
|
||||
if (of_property_read_bool(tx_node, "snps,tx-sched-wrr"))
|
||||
@@ -244,8 +244,8 @@ static void stmmac_mtl_setup(struct platform_device *pdev,
|
||||
if (queue >= plat->tx_queues_to_use)
|
||||
break;
|
||||
|
||||
if (of_property_read_u8(q_node, "snps,weight",
|
||||
&plat->tx_queues_cfg[queue].weight))
|
||||
if (of_property_read_u32(q_node, "snps,weight",
|
||||
&plat->tx_queues_cfg[queue].weight))
|
||||
plat->tx_queues_cfg[queue].weight = 0x10 + queue;
|
||||
|
||||
if (of_property_read_bool(q_node, "snps,dcb-algorithm")) {
|
||||
|
Reference in New Issue
Block a user