Skip to content

Commit

Permalink
Litex: LiteETH: Fixups for compat with BE, also properly detect unset…
Browse files Browse the repository at this point in the history
… MAC
  • Loading branch information
stffrdhrn authored and gsomlo committed Dec 6, 2020
1 parent 8ba7ad1 commit 78969c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/net/ethernet/litex/litex_liteeth.c
Expand Up @@ -195,7 +195,8 @@ static int liteeth_start_xmit(struct sk_buff *skb, struct net_device *netdev)
litex_reg_writeb(priv->base + LITEETH_READER_SLOT_OFF, priv->tx_slot);
litex_reg_writew(priv->base + LITEETH_READER_LENGTH_OFF, skb->len);

ret = readb_poll_timeout_atomic(priv->base + LITEETH_READER_READY_OFF,
ret = readx_poll_timeout_atomic(litex_reg_readb,
priv->base + LITEETH_READER_READY_OFF,
val, val, 5, 1000);
if (ret == -ETIMEDOUT) {
netdev_err(netdev, "LITEETH_READER_READY timed out\n");
Expand Down Expand Up @@ -250,7 +251,6 @@ static void liteeth_reset_hw(struct liteeth *priv)

static int liteeth_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
struct net_device *netdev;
void __iomem *buf_base;
struct resource *res;
Expand Down Expand Up @@ -321,8 +321,8 @@ static int liteeth_probe(struct platform_device *pdev)
priv->tx_base = buf_base + priv->num_rx_slots * LITEETH_BUFFER_SIZE;
priv->tx_slot = 0;

mac_addr = of_get_mac_address(np);
if (mac_addr && is_valid_ether_addr(mac_addr))
mac_addr = of_get_mac_address(pdev->dev.of_node);
if (mac_addr && !IS_ERR(mac_addr) && is_valid_ether_addr(mac_addr))
memcpy(netdev->dev_addr, mac_addr, ETH_ALEN);
else
eth_hw_addr_random(netdev);
Expand Down

0 comments on commit 78969c5

Please sign in to comment.