From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next 13/15] apple: macmace: use eth_hw_addr_set()
Date: Thu, 18 Nov 2021 23:10:31 -0800 [thread overview]
Message-ID: <20211119071033.3756560-14-kuba@kernel.org> (raw)
In-Reply-To: <20211119071033.3756560-1-kuba@kernel.org>
Byte by byte assignments.
Fixes build on m68k.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
drivers/net/ethernet/apple/macmace.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/apple/macmace.c b/drivers/net/ethernet/apple/macmace.c
index 95d3061c61be..8fcaf1639920 100644
--- a/drivers/net/ethernet/apple/macmace.c
+++ b/drivers/net/ethernet/apple/macmace.c
@@ -92,7 +92,7 @@ static void mace_reset(struct net_device *dev);
static irqreturn_t mace_interrupt(int irq, void *dev_id);
static irqreturn_t mace_dma_intr(int irq, void *dev_id);
static void mace_tx_timeout(struct net_device *dev, unsigned int txqueue);
-static void __mace_set_address(struct net_device *dev, void *addr);
+static void __mace_set_address(struct net_device *dev, const void *addr);
/*
* Load a receive DMA channel with a base address and ring length
@@ -197,6 +197,7 @@ static int mace_probe(struct platform_device *pdev)
unsigned char *addr;
struct net_device *dev;
unsigned char checksum = 0;
+ u8 macaddr[ETH_ALEN];
int err;
dev = alloc_etherdev(PRIV_BYTES);
@@ -229,8 +230,9 @@ static int mace_probe(struct platform_device *pdev)
for (j = 0; j < 6; ++j) {
u8 v = bitrev8(addr[j<<4]);
checksum ^= v;
- dev->dev_addr[j] = v;
+ macaddr[j] = v;
}
+ eth_hw_addr_set(dev, macaddr);
for (; j < 8; ++j) {
checksum ^= bitrev8(addr[j<<4]);
}
@@ -315,11 +317,12 @@ static void mace_reset(struct net_device *dev)
* Load the address on a mace controller.
*/
-static void __mace_set_address(struct net_device *dev, void *addr)
+static void __mace_set_address(struct net_device *dev, const void *addr)
{
struct mace_data *mp = netdev_priv(dev);
volatile struct mace *mb = mp->mace;
- unsigned char *p = addr;
+ const unsigned char *p = addr;
+ u8 macaddr[ETH_ALEN];
int i;
/* load up the hardware address */
@@ -331,7 +334,8 @@ static void __mace_set_address(struct net_device *dev, void *addr)
;
}
for (i = 0; i < 6; ++i)
- mb->padr = dev->dev_addr[i] = p[i];
+ mb->padr = macaddr[i] = p[i];
+ eth_hw_addr_set(dev, macaddr);
if (mp->chipid != BROKEN_ADDRCHG_REV)
mb->iac = 0;
}
--
2.31.1
next prev parent reply other threads:[~2021-11-19 7:10 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-19 7:10 [PATCH net-next 00/15] use eth_hw_addr_set() in arch-specific drivers Jakub Kicinski
2021-11-19 7:10 ` [PATCH net-next 01/15] amd: lance: use eth_hw_addr_set() Jakub Kicinski
2021-11-19 7:10 ` [PATCH net-next 02/15] amd: ni65: " Jakub Kicinski
2021-11-19 7:10 ` [PATCH net-next 03/15] amd: a2065/ariadne: " Jakub Kicinski
2021-11-19 7:10 ` [PATCH net-next 04/15] amd: hplance: " Jakub Kicinski
2021-11-19 7:10 ` [PATCH net-next 05/15] amd: atarilance: " Jakub Kicinski
2021-11-19 7:10 ` [PATCH net-next 06/15] amd: mvme147: " Jakub Kicinski
2021-11-19 7:10 ` [PATCH net-next 07/15] 8390: smc-ultra: " Jakub Kicinski
2021-11-19 7:10 ` [PATCH net-next 08/15] 8390: hydra: " Jakub Kicinski
2021-11-19 7:10 ` [PATCH net-next 09/15] 8390: mac8390: " Jakub Kicinski
2021-11-19 7:10 ` [PATCH net-next 10/15] 8390: wd: " Jakub Kicinski
2021-11-19 7:10 ` [PATCH net-next 11/15] smc9194: " Jakub Kicinski
2021-11-19 7:10 ` [PATCH net-next 12/15] lasi_82594: " Jakub Kicinski
2021-11-19 7:10 ` Jakub Kicinski [this message]
2021-11-19 7:10 ` [PATCH net-next 14/15] cirrus: mac89x0: " Jakub Kicinski
2021-11-19 7:10 ` [PATCH net-next 15/15] natsemi: macsonic: " Jakub Kicinski
2021-11-19 11:20 ` [PATCH net-next 00/15] use eth_hw_addr_set() in arch-specific drivers patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211119071033.3756560-14-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).