diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2013-05-02 20:44:20 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-05-03 16:10:23 -0400 |
commit | 3d64fc705318e09d2c8544cec7169e45837a33dc (patch) | |
tree | 0e79599c83b26c4fb2e5d3f6b5a2a779f21ec2b2 | |
parent | 0d05535d413322341f89c77f32936b4df296ac5a (diff) |
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: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/usb/pegasus.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c index 09699054b54..03e8a15d7de 100644 --- a/drivers/net/usb/pegasus.c +++ b/drivers/net/usb/pegasus.c @@ -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) |