diff options
author | Pavel Roskin <proski@gnu.org> | 2007-06-08 03:16:24 -0400 |
---|---|---|
committer | Guido Guenther <agx@sigxcpu.org> | 2007-06-09 17:34:05 +0200 |
commit | b9a60139fce263beac4571d44e0b322fb1ee2d9d (patch) | |
tree | ef3bedc3def010ee900fb6f0d58c1dcc712d0cbc | |
parent | 3a9d7b626de02fdda23750f8ac10ebb97aaf961f (diff) |
[PATCH] Don't keep priv->interface, use USB interface provided in at76_probe()
This reduces driver's dependency on USB internals.
Signed-off-by: Pavel Roskin <proski@gnu.org>
-rw-r--r-- | at76_usb.c | 16 | ||||
-rw-r--r-- | at76_usb.h | 1 |
2 files changed, 7 insertions, 10 deletions
@@ -2293,9 +2293,9 @@ static void at76_delete_device(struct at76_priv *priv) } -static int at76_alloc_urbs(struct at76_priv *priv) +static int at76_alloc_urbs(struct at76_priv *priv, + struct usb_interface *interface) { - struct usb_interface *interface = priv->interface; struct usb_endpoint_descriptor *endpoint; struct usb_device *udev = priv->udev; int i, buffer_size; @@ -4039,7 +4039,8 @@ static struct ethtool_ops at76_ethtool_ops = { * because hotplug may try to configure the netdev _before_ (or parallel to) * the download of firmware */ -static int at76_init_new_device(struct at76_priv *priv) +static int at76_init_new_device(struct at76_priv *priv, + struct usb_interface *interface) { struct net_device *netdev = priv->netdev; int ret; @@ -4048,12 +4049,10 @@ static int at76_init_new_device(struct at76_priv *priv) /* set up the endpoint information */ /* check out the endpoints */ - priv->interface = priv->udev->actconfig->interface[0]; - at76_dbg(DBG_DEVSTART, "USB interface: %d endpoints", - priv->interface->cur_altsetting->desc.bNumEndpoints); + interface->cur_altsetting->desc.bNumEndpoints); - if ((ret = at76_alloc_urbs(priv)) < 0) + if ((ret = at76_alloc_urbs(priv, interface)) < 0) goto error; /* get firmware version */ @@ -6196,10 +6195,9 @@ static int at76_probe(struct usb_interface *interface, } usb_set_intfdata(interface, priv); - priv->interface = interface; priv->fwe = fwe; - ret = at76_init_new_device(priv); + ret = at76_init_new_device(priv, interface); if (ret < 0) at76_delete_device(priv); @@ -463,7 +463,6 @@ struct at76_priv { struct net_device *netdev; /* net device pointer */ struct net_device_stats stats; struct iw_statistics wstats; - struct usb_interface *interface; /* the interface for this device */ struct sk_buff *rx_skb; /* skbuff for receiving packets */ __u8 bulk_in_endpointAddr; /* the address of the bulk in endpoint */ |