Commit 621e3634 authored by Inochi Amaoto's avatar Inochi Amaoto Committed by Jakub Kicinski
Browse files

net: ethernet: litex: use device pointer to simplify code.



As there is already a device pointer in the probe function, replace
all "&pdev->dev" pattern with this predefined device pointer.

Signed-off-by: default avatarInochi Amaoto <inochiama@gmail.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20260227003351.752934-3-inochiama@gmail.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 97c55c12
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -238,7 +238,7 @@ static int liteeth_probe(struct platform_device *pdev)
	struct liteeth *priv;
	int irq, err;

	netdev = devm_alloc_etherdev(&pdev->dev, sizeof(*priv));
	netdev = devm_alloc_etherdev(dev, sizeof(*priv));
	if (!netdev)
		return -ENOMEM;

@@ -247,9 +247,9 @@ static int liteeth_probe(struct platform_device *pdev)

	priv = netdev_priv(netdev);
	priv->netdev = netdev;
	priv->dev = &pdev->dev;
	priv->dev = dev;

	netdev->tstats = devm_netdev_alloc_pcpu_stats(&pdev->dev,
	netdev->tstats = devm_netdev_alloc_pcpu_stats(dev,
						      struct pcpu_sw_netstats);
	if (!netdev->tstats)
		return -ENOMEM;
@@ -277,7 +277,7 @@ static int liteeth_probe(struct platform_device *pdev)
	priv->tx_base = buf_base + priv->num_rx_slots * priv->slot_size;
	priv->tx_slot = 0;

	err = of_get_ethdev_address(pdev->dev.of_node, netdev);
	err = of_get_ethdev_address(dev->of_node, netdev);
	if (err)
		eth_hw_addr_random(netdev);

@@ -285,7 +285,7 @@ static int liteeth_probe(struct platform_device *pdev)

	err = devm_register_netdev(dev, netdev);
	if (err) {
		dev_err(&pdev->dev, "Failed to register netdev %d\n", err);
		dev_err(dev, "Failed to register netdev %d\n", err);
		return err;
	}