Commit 5938e095 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] USB net drivers: remove direct calls to dev_set* and dev_get*

change dev_set_drvdata() and dev_get_drvdata() to
usb_set_intfdata() and usb_get_intfdata()
parent 46658200
......@@ -928,15 +928,15 @@ static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id
usbdev->bus->bus_name, usbdev->devpath);
for (i = 0; i < 5; i++) printk("%2.2x:", netdev->dev_addr[i]);
printk("%2.2x.\n", netdev->dev_addr[i]);
dev_set_drvdata (&intf->dev, catc);
usb_set_intfdata(intf, catc);
return 0;
}
static void catc_disconnect(struct usb_interface *intf)
{
struct catc *catc = dev_get_drvdata (&intf->dev);
struct catc *catc = usb_get_intfdata(intf);
dev_set_drvdata (&intf->dev, NULL);
usb_set_intfdata(intf, NULL);
if (catc) {
unregister_netdev(catc->netdev);
usb_free_urb(catc->ctrl_urb);
......
......@@ -1287,10 +1287,10 @@ static int CDCEther_probe( struct usb_interface *intf,
static void CDCEther_disconnect( struct usb_interface *intf )
{
ether_dev_t *ether_dev = dev_get_drvdata (&intf->dev);
ether_dev_t *ether_dev = usb_get_intfdata(intf);
struct usb_device *usb;
dev_set_drvdata (&intf->dev, NULL);
usb_set_intfdata(intf, NULL);
// Sanity check!!!
if ( !ether_dev || !ether_dev->usb ) {
......
......@@ -1066,7 +1066,7 @@ static int kaweth_probe(
kaweth_dbg("Kaweth probe returning.");
dev_set_drvdata (&intf->dev, kaweth);
usb_set_intfdata(intf, kaweth);
return 0;
err_tx_and_rx:
......@@ -1085,11 +1085,11 @@ static int kaweth_probe(
****************************************************************/
static void kaweth_disconnect(struct usb_interface *intf)
{
struct kaweth_device *kaweth = dev_get_drvdata (&intf->dev);
struct kaweth_device *kaweth = usb_get_intfdata(intf);
kaweth_info("Unregistering");
dev_set_drvdata (&intf->dev, NULL);
usb_set_intfdata(intf, NULL);
if (!kaweth) {
kaweth_warn("unregistering non-existant device");
return;
......
......@@ -1244,7 +1244,7 @@ static int pegasus_probe(struct usb_interface *intf,
exit:
up(&pegasus->sem);
if (pegasus) {
dev_set_drvdata(&intf->dev, pegasus);
usb_set_intfdata(intf, pegasus);
return 0;
}
return -EIO;
......@@ -1252,9 +1252,9 @@ static int pegasus_probe(struct usb_interface *intf,
static void pegasus_disconnect(struct usb_interface *intf)
{
struct pegasus *pegasus = dev_get_drvdata(&intf->dev);
struct pegasus *pegasus = usb_get_intfdata(intf);
dev_set_drvdata(&intf->dev, NULL);
usb_set_intfdata(intf, NULL);
if (!pegasus) {
warn("unregistering non-existant device");
return;
......
......@@ -842,7 +842,7 @@ static int rtl8150_probe(struct usb_interface *intf,
info("%s: rtl8150 is detected", netdev->name);
up(&dev->sem);
dev_set_drvdata(&intf->dev, dev);
usb_set_intfdata(intf, dev);
return 0;
err:
unregister_netdev(dev->netdev);
......@@ -854,9 +854,9 @@ static int rtl8150_probe(struct usb_interface *intf,
static void rtl8150_disconnect(struct usb_interface *intf)
{
rtl8150_t *dev = dev_get_drvdata(&intf->dev);
rtl8150_t *dev = usb_get_intfdata(intf);
dev_set_drvdata(&intf->dev, NULL);
usb_set_intfdata(intf, NULL);
if (dev) {
set_bit(RTL8150_UNPLUG, &dev->flags);
unregister_netdev(dev->netdev);
......
......@@ -2094,8 +2094,8 @@ static void usbnet_disconnect (struct usb_interface *intf)
struct usbnet *dev;
struct usb_device *xdev;
dev = dev_get_drvdata (&intf->dev);
dev_set_drvdata (&intf->dev, NULL);
dev = usb_get_intfdata(intf);
usb_set_intfdata(intf, NULL);
if (!dev)
return;
......@@ -2206,7 +2206,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
#endif
// ok, it's ready to go.
dev_set_drvdata (&udev->dev, dev);
usb_set_intfdata(udev, dev);
mutex_lock (&usbnet_mutex);
list_add (&dev->dev_list, &usbnet_list);
mutex_unlock (&dev->mutex);
......
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