Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 130166
b: refs/heads/master
c: 6d31748
h: refs/heads/master
v: v3
  • Loading branch information
Christian Eggers authored and David S. Miller committed Jan 21, 2009
1 parent 7e63935 commit 931a2a2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0b491eee46012772cbf029450d123e933c2e7940
refs/heads/master: 6d317482944250228255bcbe97a95b7e7ad9a538
20 changes: 18 additions & 2 deletions trunk/drivers/net/usb/mcs7830.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,37 @@ static int mcs7830_get_reg(struct usbnet *dev, u16 index, u16 size, void *data)
{
struct usb_device *xdev = dev->udev;
int ret;
void *buffer;

buffer = kmalloc(size, GFP_NOIO);
if (buffer == NULL)
return -ENOMEM;

ret = usb_control_msg(xdev, usb_rcvctrlpipe(xdev, 0), MCS7830_RD_BREQ,
MCS7830_RD_BMREQ, 0x0000, index, data,
MCS7830_RD_BMREQ, 0x0000, index, buffer,
size, MCS7830_CTRL_TIMEOUT);
memcpy(data, buffer, size);
kfree(buffer);

return ret;
}

static int mcs7830_set_reg(struct usbnet *dev, u16 index, u16 size, void *data)
{
struct usb_device *xdev = dev->udev;
int ret;
void *buffer;

buffer = kmalloc(size, GFP_NOIO);
if (buffer == NULL)
return -ENOMEM;

memcpy(buffer, data, size);

ret = usb_control_msg(xdev, usb_sndctrlpipe(xdev, 0), MCS7830_WR_BREQ,
MCS7830_WR_BMREQ, 0x0000, index, data,
MCS7830_WR_BMREQ, 0x0000, index, buffer,
size, MCS7830_CTRL_TIMEOUT);
kfree(buffer);
return ret;
}

Expand Down

0 comments on commit 931a2a2

Please sign in to comment.