mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-30 03:56:44 +07:00
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:
parent
8691b97b99
commit
839214aeaa
@ -1574,7 +1574,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
|
||||
|
||||
udc->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->selfpowered = 1;
|
||||
|
||||
@ -1583,7 +1583,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
|
||||
DBG("driver->bind() returned %d\n", retval);
|
||||
udc->driver = NULL;
|
||||
udc->gadget.dev.driver = NULL;
|
||||
udc->gadget.dev.driver_data = NULL;
|
||||
dev_set_drvdata(&udc->gadget.dev, NULL);
|
||||
udc->enabled = 0;
|
||||
udc->selfpowered = 0;
|
||||
return retval;
|
||||
@ -1613,7 +1613,7 @@ int usb_gadget_unregister_driver (struct usb_gadget_driver *driver)
|
||||
|
||||
driver->unbind(&udc->gadget);
|
||||
udc->gadget.dev.driver = NULL;
|
||||
udc->gadget.dev.driver_data = NULL;
|
||||
dev_set_drvdata(&udc->gadget.dev, NULL);
|
||||
udc->driver = NULL;
|
||||
|
||||
DBG("unbound from %s\n", driver->driver.name);
|
||||
|
Loading…
Reference in New Issue
Block a user