From: Wolfgang Grandegger Date: Mon, 14 Nov 2011 23:19:14 +0000 (+0000) Subject: smsc95xx: Fix MAC address programming X-Git-Tag: v2011.12-rc1~155 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=50d89f57572af12bb601ea804deff3b0794e60cc;p=platform%2Fkernel%2Fu-boot.git smsc95xx: Fix MAC address programming Commit 79ad54400932d6484178a372fb3b659e3437473b broke MAC address programming in the SMSC95xx register set. Cc: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger Signed-off-by: Wolfgang Grandegger Acked-by: Mike Frysinger Acked-by: Simon Glass --- diff --git a/drivers/usb/eth/smsc95xx.c b/drivers/usb/eth/smsc95xx.c index 7ee4f87..b5626e6 100644 --- a/drivers/usb/eth/smsc95xx.c +++ b/drivers/usb/eth/smsc95xx.c @@ -20,6 +20,7 @@ * MA 02111-1307 USA */ +#include #include #include #include @@ -372,13 +373,12 @@ static int smsc95xx_init_mac_address(struct eth_device *eth, static int smsc95xx_write_hwaddr(struct eth_device *eth) { struct ueth_data *dev = (struct ueth_data *)eth->priv; - u32 addr_lo, addr_hi; + u32 addr_lo = __get_unaligned_le32(ð->enetaddr[0]); + u32 addr_hi = __get_unaligned_le16(ð->enetaddr[4]); int ret; /* set hardware address */ debug("** %s()\n", __func__); - addr_lo = cpu_to_le32(*eth->enetaddr); - addr_hi = cpu_to_le16(*((u16 *)(eth->enetaddr + 4))); ret = smsc95xx_write_reg(dev, ADDRL, addr_lo); if (ret < 0) { debug("Failed to write ADDRL: %d\n", ret);