Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d64fc70 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller
Browse files

usbnet: pegasus: endian bug in write_mii_word()



We're only passing the two high bytes of an integer.  It works for
little endian but not for big endian.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0d05535d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -256,8 +256,9 @@ static int mdio_read(struct net_device *dev, int phy_id, int loc)
static void mdio_write(struct net_device *dev, int phy_id, int loc, int val)
{
	pegasus_t *pegasus = netdev_priv(dev);
	u16 data = val;

	write_mii_word(pegasus, phy_id, loc, (__u16 *)&val);
	write_mii_word(pegasus, phy_id, loc, &data);
}

static int read_eprom_word(pegasus_t *pegasus, __u8 index, __u16 *retdata)