Skip to content

Commit

Permalink
net: cdc_ncm: remove redundant "intf" field
Browse files Browse the repository at this point in the history
This is always a duplicate of the "control" field. It causes
confusion wrt intf_data updates and cleanups.

Cc: Alexey Orishko <alexey.orishko@gmail.com>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Bjørn Mork authored and David S. Miller committed Nov 2, 2013
1 parent f6701d5 commit 3e51566
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 1 addition & 3 deletions drivers/net/usb/cdc_ncm.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,6 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_
len = intf->cur_altsetting->extralen;

ctx->udev = dev->udev;
ctx->intf = intf;

/* parse through descriptors associated with control interface */
while ((len > 0) && (buf[0] > 2) && (buf[0] <= len)) {
Expand Down Expand Up @@ -489,7 +488,6 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_

usb_set_intfdata(ctx->data, dev);
usb_set_intfdata(ctx->control, dev);
usb_set_intfdata(ctx->intf, dev);

if (ctx->ether_desc) {
temp = usbnet_get_ethernet_addr(dev, ctx->ether_desc->iMACAddress);
Expand Down Expand Up @@ -562,7 +560,7 @@ void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf)
ctx->control = NULL;
}

usb_set_intfdata(ctx->intf, NULL);
usb_set_intfdata(intf, NULL);
cdc_ncm_free(ctx);
}
EXPORT_SYMBOL_GPL(cdc_ncm_unbind);
Expand Down
1 change: 0 additions & 1 deletion include/linux/usb/cdc_ncm.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ struct cdc_ncm_ctx {
struct usb_host_endpoint *in_ep;
struct usb_host_endpoint *out_ep;
struct usb_host_endpoint *status_ep;
struct usb_interface *intf;
struct usb_interface *control;
struct usb_interface *data;

Expand Down

0 comments on commit 3e51566

Please sign in to comment.