Commit 1048e635 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] USB serial 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 b9197910
...@@ -1131,8 +1131,7 @@ int usb_serial_probe(struct usb_interface *interface, ...@@ -1131,8 +1131,7 @@ int usb_serial_probe(struct usb_interface *interface,
if (retval > 0) { if (retval > 0) {
/* quietly accept this device, but don't bind to a serial port /* quietly accept this device, but don't bind to a serial port
* as it's about to disappear */ * as it's about to disappear */
dev_set_drvdata (&interface->dev, serial); goto exit;
return 0;
} }
} }
...@@ -1151,8 +1150,9 @@ int usb_serial_probe(struct usb_interface *interface, ...@@ -1151,8 +1150,9 @@ int usb_serial_probe(struct usb_interface *interface,
usb_serial_console_init (debug, minor); usb_serial_console_init (debug, minor);
exit:
/* success */ /* success */
dev_set_drvdata (&interface->dev, serial); usb_set_intfdata (interface, serial);
return 0; return 0;
...@@ -1189,14 +1189,14 @@ int usb_serial_probe(struct usb_interface *interface, ...@@ -1189,14 +1189,14 @@ int usb_serial_probe(struct usb_interface *interface,
void usb_serial_disconnect(struct usb_interface *interface) void usb_serial_disconnect(struct usb_interface *interface)
{ {
struct usb_serial *serial = dev_get_drvdata (&interface->dev); struct usb_serial *serial = usb_get_intfdata (interface);
struct device *dev = &interface->dev; struct device *dev = &interface->dev;
struct usb_serial_port *port; struct usb_serial_port *port;
int i; int i;
dbg ("%s", __FUNCTION__); dbg ("%s", __FUNCTION__);
dev_set_drvdata (&interface->dev, NULL); usb_set_intfdata (interface, NULL);
if (serial) { if (serial) {
/* fail all future close/read/write/ioctl/etc calls */ /* fail all future close/read/write/ioctl/etc calls */
for (i = 0; i < serial->num_ports; ++i) { for (i = 0; i < serial->num_ports; ++i) {
......
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