Skip to content

Commit

Permalink
net: dpaa: Use mac_dev variable in dpaa_netdev_init
Browse files Browse the repository at this point in the history
There are several references to mac_dev in dpaa_netdev_init. Make things a
bit more concise by adding a local variable for it.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Acked-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sean Anderson authored and David S. Miller committed Sep 5, 2022
1 parent 901bdff commit fca4804
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ static int dpaa_netdev_init(struct net_device *net_dev,
{
struct dpaa_priv *priv = netdev_priv(net_dev);
struct device *dev = net_dev->dev.parent;
struct mac_device *mac_dev = priv->mac_dev;
struct dpaa_percpu_priv *percpu_priv;
const u8 *mac_addr;
int i, err;
Expand All @@ -216,10 +217,10 @@ static int dpaa_netdev_init(struct net_device *net_dev,
}

net_dev->netdev_ops = dpaa_ops;
mac_addr = priv->mac_dev->addr;
mac_addr = mac_dev->addr;

net_dev->mem_start = (unsigned long)priv->mac_dev->vaddr;
net_dev->mem_end = (unsigned long)priv->mac_dev->vaddr_end;
net_dev->mem_start = (unsigned long)mac_dev->vaddr;
net_dev->mem_end = (unsigned long)mac_dev->vaddr_end;

net_dev->min_mtu = ETH_MIN_MTU;
net_dev->max_mtu = dpaa_get_max_mtu();
Expand All @@ -246,7 +247,7 @@ static int dpaa_netdev_init(struct net_device *net_dev,
eth_hw_addr_set(net_dev, mac_addr);
} else {
eth_hw_addr_random(net_dev);
err = priv->mac_dev->change_addr(priv->mac_dev->fman_mac,
err = mac_dev->change_addr(mac_dev->fman_mac,
(const enet_addr_t *)net_dev->dev_addr);
if (err) {
dev_err(dev, "Failed to set random MAC address\n");
Expand Down

0 comments on commit fca4804

Please sign in to comment.