]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
usbnet: pegasus: endian bug in write_mii_word()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 2 May 2013 20:44:20 +0000 (20:44 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 3 May 2013 20:10:23 +0000 (16:10 -0400)
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>
drivers/net/usb/pegasus.c

index 09699054b54f66e65b5c168a8dec868229831147..03e8a15d7deb74d328d5e563ed2077f62c8d9687 100644 (file)
@@ -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)