Commit 37357ca5 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

USB: usb_wwan: use interface-data accessors

Use usb_get_serial_data() rather than accessing the private pointer
directly.
Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b0f9d003
...@@ -41,7 +41,7 @@ void usb_wwan_dtr_rts(struct usb_serial_port *port, int on) ...@@ -41,7 +41,7 @@ void usb_wwan_dtr_rts(struct usb_serial_port *port, int on)
struct usb_wwan_port_private *portdata; struct usb_wwan_port_private *portdata;
struct usb_wwan_intf_private *intfdata; struct usb_wwan_intf_private *intfdata;
intfdata = port->serial->private; intfdata = usb_get_serial_data(port->serial);
if (!intfdata->send_setup) if (!intfdata->send_setup)
return; return;
...@@ -82,7 +82,7 @@ int usb_wwan_tiocmset(struct tty_struct *tty, ...@@ -82,7 +82,7 @@ int usb_wwan_tiocmset(struct tty_struct *tty,
struct usb_wwan_intf_private *intfdata; struct usb_wwan_intf_private *intfdata;
portdata = usb_get_serial_port_data(port); portdata = usb_get_serial_port_data(port);
intfdata = port->serial->private; intfdata = usb_get_serial_data(port->serial);
if (!intfdata->send_setup) if (!intfdata->send_setup)
return -EINVAL; return -EINVAL;
...@@ -191,7 +191,7 @@ int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port, ...@@ -191,7 +191,7 @@ int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port,
unsigned long flags; unsigned long flags;
portdata = usb_get_serial_port_data(port); portdata = usb_get_serial_port_data(port);
intfdata = port->serial->private; intfdata = usb_get_serial_data(port->serial);
dev_dbg(&port->dev, "%s: write (%d chars)\n", __func__, count); dev_dbg(&port->dev, "%s: write (%d chars)\n", __func__, count);
...@@ -302,7 +302,7 @@ static void usb_wwan_outdat_callback(struct urb *urb) ...@@ -302,7 +302,7 @@ static void usb_wwan_outdat_callback(struct urb *urb)
int i; int i;
port = urb->context; port = urb->context;
intfdata = port->serial->private; intfdata = usb_get_serial_data(port->serial);
usb_serial_port_softint(port); usb_serial_port_softint(port);
usb_autopm_put_interface_async(port->serial->interface); usb_autopm_put_interface_async(port->serial->interface);
...@@ -372,7 +372,7 @@ int usb_wwan_open(struct tty_struct *tty, struct usb_serial_port *port) ...@@ -372,7 +372,7 @@ int usb_wwan_open(struct tty_struct *tty, struct usb_serial_port *port)
struct urb *urb; struct urb *urb;
portdata = usb_get_serial_port_data(port); portdata = usb_get_serial_port_data(port);
intfdata = serial->private; intfdata = usb_get_serial_data(serial);
if (port->interrupt_in_urb) { if (port->interrupt_in_urb) {
err = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); err = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
...@@ -424,7 +424,7 @@ void usb_wwan_close(struct usb_serial_port *port) ...@@ -424,7 +424,7 @@ void usb_wwan_close(struct usb_serial_port *port)
int i; int i;
struct usb_serial *serial = port->serial; struct usb_serial *serial = port->serial;
struct usb_wwan_port_private *portdata; struct usb_wwan_port_private *portdata;
struct usb_wwan_intf_private *intfdata = port->serial->private; struct usb_wwan_intf_private *intfdata = usb_get_serial_data(serial);
struct urb *urb; struct urb *urb;
portdata = usb_get_serial_port_data(port); portdata = usb_get_serial_port_data(port);
...@@ -584,7 +584,7 @@ static void stop_urbs(struct usb_serial *serial) ...@@ -584,7 +584,7 @@ static void stop_urbs(struct usb_serial *serial)
int usb_wwan_suspend(struct usb_serial *serial, pm_message_t message) int usb_wwan_suspend(struct usb_serial *serial, pm_message_t message)
{ {
struct usb_wwan_intf_private *intfdata = serial->private; struct usb_wwan_intf_private *intfdata = usb_get_serial_data(serial);
spin_lock_irq(&intfdata->susp_lock); spin_lock_irq(&intfdata->susp_lock);
if (PMSG_IS_AUTO(message)) { if (PMSG_IS_AUTO(message)) {
...@@ -605,14 +605,14 @@ EXPORT_SYMBOL(usb_wwan_suspend); ...@@ -605,14 +605,14 @@ EXPORT_SYMBOL(usb_wwan_suspend);
static int play_delayed(struct usb_serial_port *port) static int play_delayed(struct usb_serial_port *port)
{ {
struct usb_serial *serial = port->serial; struct usb_serial *serial = port->serial;
struct usb_wwan_intf_private *data; struct usb_wwan_intf_private *data = usb_get_serial_data(serial);
struct usb_wwan_port_private *portdata; struct usb_wwan_port_private *portdata;
struct urb *urb; struct urb *urb;
int err_count = 0; int err_count = 0;
int err; int err;
portdata = usb_get_serial_port_data(port); portdata = usb_get_serial_port_data(port);
data = port->serial->private;
while ((urb = usb_get_from_anchor(&portdata->delayed))) { while ((urb = usb_get_from_anchor(&portdata->delayed))) {
err = usb_submit_urb(urb, GFP_ATOMIC); err = usb_submit_urb(urb, GFP_ATOMIC);
if (err) { if (err) {
...@@ -637,7 +637,7 @@ int usb_wwan_resume(struct usb_serial *serial) ...@@ -637,7 +637,7 @@ int usb_wwan_resume(struct usb_serial *serial)
{ {
int i, j; int i, j;
struct usb_serial_port *port; struct usb_serial_port *port;
struct usb_wwan_intf_private *intfdata = serial->private; struct usb_wwan_intf_private *intfdata = usb_get_serial_data(serial);
struct usb_wwan_port_private *portdata; struct usb_wwan_port_private *portdata;
struct urb *urb; struct urb *urb;
int err; int err;
......
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