Commit 8199d0c6 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'dev_addr-const-fixes'



Jakub Kicinski says:

====================
ethernet: fix some esoteric drivers after netdev->dev_addr constification

Looking at recent fixes for drivers which don't get included with
allmodconfig builds I thought it's worth grepping for more instances of:

  dev->dev_addr\[.*\] =

This set contains the fixes.

v2: add last 3 patches which fix drivers for the RiscPC ARM platform.
Thanks to Arnd Bergmann for explaining how to build test that.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 429c3be8 8eb86fc2
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -2278,6 +2278,7 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
	struct net_device *dev;
	struct typhoon *tp;
	int card_id = (int) ent->driver_data;
	u8 addr[ETH_ALEN] __aligned(4);
	void __iomem *ioaddr;
	void *shared;
	dma_addr_t shared_dma;
@@ -2409,8 +2410,9 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
		goto error_out_reset;
	}

	*(__be16 *)&dev->dev_addr[0] = htons(le16_to_cpu(xp_resp[0].parm1));
	*(__be32 *)&dev->dev_addr[2] = htonl(le32_to_cpu(xp_resp[0].parm2));
	*(__be16 *)&addr[0] = htons(le16_to_cpu(xp_resp[0].parm1));
	*(__be32 *)&addr[2] = htonl(le32_to_cpu(xp_resp[0].parm2));
	eth_hw_addr_set(dev, addr);

	if (!is_valid_ether_addr(dev->dev_addr)) {
		err_msg = "Could not obtain valid ethernet address, aborting";
+4 −2
Original line number Diff line number Diff line
@@ -655,6 +655,7 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id)
	struct ei_device *ei_local;
	struct net_device *dev;
	struct etherh_priv *eh;
	u8 addr[ETH_ALEN];
	int ret;

	ret = ecard_request_resources(ec);
@@ -724,12 +725,13 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id)
	spin_lock_init(&ei_local->page_lock);

	if (ec->cid.product == PROD_ANT_ETHERM) {
		etherm_addr(dev->dev_addr);
		etherm_addr(addr);
		ei_local->reg_offset = etherm_regoffsets;
	} else {
		etherh_addr(dev->dev_addr, ec);
		etherh_addr(addr, ec);
		ei_local->reg_offset = etherh_regoffsets;
	}
	eth_hw_addr_set(dev, addr);

	ei_local->name          = dev->name;
	ei_local->word16        = 1;
+1 −3
Original line number Diff line number Diff line
@@ -2183,9 +2183,7 @@ static int sbmac_init(struct platform_device *pldev, long long base)
		ea_reg >>= 8;
	}

	for (i = 0; i < 6; i++) {
		dev->dev_addr[i] = eaddr[i];
	}
	eth_hw_addr_set(dev, eaddr);

	/*
	 * Initialize context (get pointers to registers and stuff), then
+3 −1
Original line number Diff line number Diff line
@@ -986,6 +986,7 @@ static int
ether1_probe(struct expansion_card *ec, const struct ecard_id *id)
{
	struct net_device *dev;
	u8 addr[ETH_ALEN];
	int i, ret = 0;

	ether1_banner();
@@ -1015,7 +1016,8 @@ ether1_probe(struct expansion_card *ec, const struct ecard_id *id)
	}

	for (i = 0; i < 6; i++)
		dev->dev_addr[i] = readb(IDPROM_ADDRESS + (i << 2));
		addr[i] = readb(IDPROM_ADDRESS + (i << 2));
	eth_hw_addr_set(dev, addr);

	if (ether1_init_2(dev)) {
		ret = -ENODEV;
+3 −1
Original line number Diff line number Diff line
@@ -749,6 +749,7 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id)
	const struct ether3_data *data = id->data;
	struct net_device *dev;
	int bus_type, ret;
	u8 addr[ETH_ALEN];

	ether3_banner();

@@ -776,7 +777,8 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id)
	priv(dev)->seeq = priv(dev)->base + data->base_offset;
	dev->irq = ec->irq;

	ether3_addr(dev->dev_addr, ec);
	ether3_addr(addr, ec);
	eth_hw_addr_set(dev, addr);

	priv(dev)->dev = dev;
	timer_setup(&priv(dev)->timer, ether3_ledoff, 0);
Loading