--- zzzz-none-000/linux-3.10.107/drivers/net/usb/pegasus.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/net/usb/pegasus.c 2021-02-04 17:41:59.000000000 +0000 @@ -126,61 +126,40 @@ static int get_registers(pegasus_t *pegasus, __u16 indx, __u16 size, void *data) { - u8 *buf; int ret; - buf = kmalloc(size, GFP_NOIO); - if (!buf) - return -ENOMEM; - ret = usb_control_msg(pegasus->usb, usb_rcvctrlpipe(pegasus->usb, 0), PEGASUS_REQ_GET_REGS, PEGASUS_REQT_READ, 0, - indx, buf, size, 1000); + indx, data, size, 1000); if (ret < 0) netif_dbg(pegasus, drv, pegasus->net, "%s returned %d\n", __func__, ret); - else if (ret <= size) - memcpy(data, buf, ret); - kfree(buf); return ret; } -static int set_registers(pegasus_t *pegasus, __u16 indx, __u16 size, - const void *data) +static int set_registers(pegasus_t *pegasus, __u16 indx, __u16 size, void *data) { - u8 *buf; int ret; - buf = kmemdup(data, size, GFP_NOIO); - if (!buf) - return -ENOMEM; - ret = usb_control_msg(pegasus->usb, usb_sndctrlpipe(pegasus->usb, 0), PEGASUS_REQ_SET_REGS, PEGASUS_REQT_WRITE, 0, - indx, buf, size, 100); + indx, data, size, 100); if (ret < 0) netif_dbg(pegasus, drv, pegasus->net, "%s returned %d\n", __func__, ret); - kfree(buf); return ret; } static int set_register(pegasus_t *pegasus, __u16 indx, __u8 data) { - u8 *buf; int ret; - buf = kmemdup(&data, 1, GFP_NOIO); - if (!buf) - return -ENOMEM; - ret = usb_control_msg(pegasus->usb, usb_sndctrlpipe(pegasus->usb, 0), PEGASUS_REQ_SET_REG, PEGASUS_REQT_WRITE, data, - indx, buf, 1, 1000); + indx, &data, 1, 1000); if (ret < 0) netif_dbg(pegasus, drv, pegasus->net, "%s returned %d\n", __func__, ret); - kfree(buf); return ret; } @@ -1180,7 +1159,7 @@ net->watchdog_timeo = PEGASUS_TX_TIMEOUT; net->netdev_ops = &pegasus_netdev_ops; - SET_ETHTOOL_OPS(net, &ops); + net->ethtool_ops = &ops; pegasus->mii.dev = net; pegasus->mii.mdio_read = mdio_read; pegasus->mii.mdio_write = mdio_write;