Commit 0a14501e authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller
Browse files

eth: fwnode: remove the addr len from mac helpers



All callers pass in ETH_ALEN and the function itself
will return -EINVAL for any other address length.
Just assume it's ETH_ALEN like all other mac address
helpers (nvm, of, platform).

Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8017c4d8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ static int xge_get_resources(struct xge_pdata *pdata)
		return -ENOMEM;
	}

	if (device_get_mac_address(dev, ndev->dev_addr, ETH_ALEN))
	if (device_get_mac_address(dev, ndev->dev_addr))
		eth_hw_addr_random(ndev);

	memcpy(ndev->perm_addr, ndev->dev_addr, ndev->addr_len);
+1 −1
Original line number Diff line number Diff line
@@ -1731,7 +1731,7 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata)
		xgene_get_port_id_acpi(dev, pdata);
#endif

	if (device_get_mac_address(dev, ndev->dev_addr, ETH_ALEN))
	if (device_get_mac_address(dev, ndev->dev_addr))
		eth_hw_addr_random(ndev);

	memcpy(ndev->perm_addr, ndev->dev_addr, ndev->addr_len);
+1 −1
Original line number Diff line number Diff line
@@ -4084,7 +4084,7 @@ static int bcmgenet_probe(struct platform_device *pdev)
	if (pd && !IS_ERR_OR_NULL(pd->mac_address))
		eth_hw_addr_set(dev, pd->mac_address);
	else
		if (device_get_mac_address(&pdev->dev, dev->dev_addr, ETH_ALEN))
		if (device_get_mac_address(&pdev->dev, dev->dev_addr))
			if (has_acpi_companion(&pdev->dev))
				bcmgenet_get_hw_addr(priv, dev->dev_addr);

+1 −1
Original line number Diff line number Diff line
@@ -1389,7 +1389,7 @@ static int acpi_get_mac_address(struct device *dev, struct acpi_device *adev,
	u8 mac[ETH_ALEN];
	int ret;

	ret = fwnode_get_mac_address(acpi_fwnode_handle(adev), mac, ETH_ALEN);
	ret = fwnode_get_mac_address(acpi_fwnode_handle(adev), mac);
	if (ret) {
		dev_err(dev, "MAC address invalid: %pM\n", mac);
		return -EINVAL;
+1 −1
Original line number Diff line number Diff line
@@ -183,7 +183,7 @@ static void ftgmac100_initial_mac(struct ftgmac100 *priv)
	unsigned int m;
	unsigned int l;

	if (!device_get_mac_address(priv->dev, mac, ETH_ALEN)) {
	if (!device_get_mac_address(priv->dev, mac)) {
		eth_hw_addr_set(priv->netdev, mac);
		dev_info(priv->dev, "Read MAC address %pM from device tree\n",
			 mac);
Loading