usb: gadget: at91_udc: remove driver_data direct access of struct device

In the near future, the driver core is going to not allow direct access
to the driver_data pointer in struct device.  Instead, the functions
dev_get_drvdata() and dev_set_drvdata() should be used.  These functions
have been around since the beginning, so are backwards compatible with
all older kernel versions.

Cc: linux-usb@vger.kernel.org
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Greg Kroah-Hartman 2009-05-04 12:40:54 -07:00
parent 8691b97b99
commit 839214aeaa

View file

@ -1574,7 +1574,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
udc->driver = driver; udc->driver = driver;
udc->gadget.dev.driver = &driver->driver; udc->gadget.dev.driver = &driver->driver;
udc->gadget.dev.driver_data = &driver->driver; dev_set_drvdata(&udc->gadget.dev, &driver->driver);
udc->enabled = 1; udc->enabled = 1;
udc->selfpowered = 1; udc->selfpowered = 1;
@ -1583,7 +1583,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
DBG("driver->bind() returned %d\n", retval); DBG("driver->bind() returned %d\n", retval);
udc->driver = NULL; udc->driver = NULL;
udc->gadget.dev.driver = NULL; udc->gadget.dev.driver = NULL;
udc->gadget.dev.driver_data = NULL; dev_set_drvdata(&udc->gadget.dev, NULL);
udc->enabled = 0; udc->enabled = 0;
udc->selfpowered = 0; udc->selfpowered = 0;
return retval; return retval;
@ -1613,7 +1613,7 @@ int usb_gadget_unregister_driver (struct usb_gadget_driver *driver)
driver->unbind(&udc->gadget); driver->unbind(&udc->gadget);
udc->gadget.dev.driver = NULL; udc->gadget.dev.driver = NULL;
udc->gadget.dev.driver_data = NULL; dev_set_drvdata(&udc->gadget.dev, NULL);
udc->driver = NULL; udc->driver = NULL;
DBG("unbound from %s\n", driver->driver.name); DBG("unbound from %s\n", driver->driver.name);