ChangeSet 1.946.3.21, 2002/12/27 11:33:42-08:00, greg@kroah.com [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. diff -Nru a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c --- a/drivers/usb/core/usb.c Fri Dec 27 23:56:40 2002 +++ b/drivers/usb/core/usb.c Fri Dec 27 23:56:40 2002 @@ -298,7 +298,7 @@ dbg("%s driver claimed interface %p", driver->name, iface); iface->driver = driver; - iface->private_data = priv; + usb_set_intfdata(iface, priv); } /** @@ -341,7 +341,7 @@ return; iface->driver = NULL; - iface->private_data = NULL; + usb_set_intfdata(iface, NULL); } /** diff -Nru a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c --- a/drivers/usb/misc/usbtest.c Fri Dec 27 23:56:40 2002 +++ b/drivers/usb/misc/usbtest.c Fri Dec 27 23:56:40 2002 @@ -978,7 +978,6 @@ dev_set_drvdata (&intf->dev, 0); info ("unbound %s", dev->id); - kfree (intf->private_data); } /* Basic testing only needs a device that can source or sink bulk traffic. diff -Nru a/include/linux/usb.h b/include/linux/usb.h --- a/include/linux/usb.h Fri Dec 27 23:56:40 2002 +++ b/include/linux/usb.h Fri Dec 27 23:56:40 2002 @@ -111,11 +111,20 @@ struct usb_driver *driver; /* driver */ kdev_t kdev; /* node this interface is bound to */ struct device dev; /* interface specific device info */ - void *private_data; }; #define to_usb_interface(d) container_of(d, struct usb_interface, dev) #define interface_to_usbdev(intf) \ 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. *