We need to byteswap ibm,pcie-link-speed-stats.
Signed-off-by: Anton Blanchard <redacted>
Signed-off-by: Benjamin Herrenschmidt <redacted>
{
struct device_node *dn, *pdn;
struct pci_bus *bus;
{
struct device_node *dn, *pdn;
struct pci_bus *bus;
- const uint32_t *pcie_link_speed_stats;
+ const __be32 *pcie_link_speed_stats;
return 0;
for (pdn = dn; pdn != NULL; pdn = of_get_next_parent(pdn)) {
return 0;
for (pdn = dn; pdn != NULL; pdn = of_get_next_parent(pdn)) {
- pcie_link_speed_stats = (const uint32_t *) of_get_property(pdn,
+ pcie_link_speed_stats = of_get_property(pdn,
"ibm,pcie-link-speed-stats", NULL);
if (pcie_link_speed_stats)
break;
"ibm,pcie-link-speed-stats", NULL);
if (pcie_link_speed_stats)
break;
- switch (pcie_link_speed_stats[0]) {
+ switch (be32_to_cpup(pcie_link_speed_stats)) {
case 0x01:
bus->max_bus_speed = PCIE_SPEED_2_5GT;
break;
case 0x01:
bus->max_bus_speed = PCIE_SPEED_2_5GT;
break;
- switch (pcie_link_speed_stats[1]) {
+ switch (be32_to_cpup(pcie_link_speed_stats)) {
case 0x01:
bus->cur_bus_speed = PCIE_SPEED_2_5GT;
break;
case 0x01:
bus->cur_bus_speed = PCIE_SPEED_2_5GT;
break;