Skip to content

Commit

Permalink
usbnet: dm9601: Fix incorrect command
Browse files Browse the repository at this point in the history
commit 24b1042 ("usbnet: dm9601: apply introduced usb command
APIs") removes the distiction between DM_WRITE_REG and DM_WRITE_REGS
command. The distiction is reintroduced to the driver so that the
functionality of the driver remains same.

CC: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Tushar Behera authored and David S. Miller committed Jan 16, 2013
1 parent d4fc9dc commit 1b9c3a1
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions drivers/net/usb/dm9601.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
#define DM_RX_OVERHEAD 7 /* 3 byte header + 4 byte crc tail */
#define DM_TIMEOUT 1000


static int dm_read(struct usbnet *dev, u8 reg, u16 length, void *data)
{
int err;
Expand Down Expand Up @@ -84,32 +83,23 @@ static int dm_write(struct usbnet *dev, u8 reg, u16 length, void *data)

static int dm_write_reg(struct usbnet *dev, u8 reg, u8 value)
{
return usbnet_write_cmd(dev, DM_WRITE_REGS,
return usbnet_write_cmd(dev, DM_WRITE_REG,
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
value, reg, NULL, 0);
}

static void dm_write_async_helper(struct usbnet *dev, u8 reg, u8 value,
u16 length, void *data)
static void dm_write_async(struct usbnet *dev, u8 reg, u16 length, void *data)
{
usbnet_write_cmd_async(dev, DM_WRITE_REGS,
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
value, reg, data, length);
}

static void dm_write_async(struct usbnet *dev, u8 reg, u16 length, void *data)
{
netdev_dbg(dev->net, "dm_write_async() reg=0x%02x length=%d\n", reg, length);

dm_write_async_helper(dev, reg, 0, length, data);
0, reg, data, length);
}

static void dm_write_reg_async(struct usbnet *dev, u8 reg, u8 value)
{
netdev_dbg(dev->net, "dm_write_reg_async() reg=0x%02x value=0x%02x\n",
reg, value);

dm_write_async_helper(dev, reg, value, 0, NULL);
usbnet_write_cmd_async(dev, DM_WRITE_REG,
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
value, reg, NULL, 0);
}

static int dm_read_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 *value)
Expand Down

0 comments on commit 1b9c3a1

Please sign in to comment.