Commit 9e314023 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Vojtech Pavlik

[PATCH] USB: remove private_data pointer from struct usb_interface, as it shouldn't be used anymore

Also added usb_get_intfdata() and usb_set_intfdata() functions to set the
struct usb_interface private pointer easier.
parent e95cd247
...@@ -298,7 +298,7 @@ void usb_driver_claim_interface(struct usb_driver *driver, struct usb_interface ...@@ -298,7 +298,7 @@ void usb_driver_claim_interface(struct usb_driver *driver, struct usb_interface
dbg("%s driver claimed interface %p", driver->name, iface); dbg("%s driver claimed interface %p", driver->name, iface);
iface->driver = driver; iface->driver = driver;
iface->private_data = priv; usb_set_intfdata(iface, priv);
} }
/** /**
...@@ -341,7 +341,7 @@ void usb_driver_release_interface(struct usb_driver *driver, struct usb_interfac ...@@ -341,7 +341,7 @@ void usb_driver_release_interface(struct usb_driver *driver, struct usb_interfac
return; return;
iface->driver = NULL; iface->driver = NULL;
iface->private_data = NULL; usb_set_intfdata(iface, NULL);
} }
/** /**
......
...@@ -978,7 +978,6 @@ static void usbtest_disconnect (struct usb_interface *intf) ...@@ -978,7 +978,6 @@ static void usbtest_disconnect (struct usb_interface *intf)
dev_set_drvdata (&intf->dev, 0); dev_set_drvdata (&intf->dev, 0);
info ("unbound %s", dev->id); info ("unbound %s", dev->id);
kfree (intf->private_data);
} }
/* Basic testing only needs a device that can source or sink bulk traffic. /* Basic testing only needs a device that can source or sink bulk traffic.
......
...@@ -111,12 +111,21 @@ struct usb_interface { ...@@ -111,12 +111,21 @@ struct usb_interface {
struct usb_driver *driver; /* driver */ struct usb_driver *driver; /* driver */
kdev_t kdev; /* node this interface is bound to */ kdev_t kdev; /* node this interface is bound to */
struct device dev; /* interface specific device info */ struct device dev; /* interface specific device info */
void *private_data;
}; };
#define to_usb_interface(d) container_of(d, struct usb_interface, dev) #define to_usb_interface(d) container_of(d, struct usb_interface, dev)
#define interface_to_usbdev(intf) \ #define interface_to_usbdev(intf) \
container_of(intf->dev.parent, struct usb_device, dev) container_of(intf->dev.parent, struct usb_device, dev)
static inline void *usb_get_intfdata (struct usb_interface *intf)
{
return dev_get_drvdata (&intf->dev);
}
static inline void usb_set_intfdata (struct usb_interface *intf, void *data)
{
return dev_set_drvdata (&intf->dev, data);
}
/* USB_DT_CONFIG: Configuration descriptor information. /* USB_DT_CONFIG: Configuration descriptor information.
* *
* USB_DT_OTHER_SPEED_CONFIG is the same descriptor, except that the * USB_DT_OTHER_SPEED_CONFIG is the same descriptor, except that the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment