mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
USB: option: use usb_{get,set}_serial_data
Use usb_{get,set}_serial_data to access usb-serial data. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c2e935a7db
commit
a276400d14
@ -1347,12 +1347,15 @@ static int option_probe(struct usb_serial *serial,
|
|||||||
serial->interface->cur_altsetting->desc.bInterfaceClass != USB_CLASS_CDC_DATA)
|
serial->interface->cur_altsetting->desc.bInterfaceClass != USB_CLASS_CDC_DATA)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
data = serial->private = kzalloc(sizeof(struct usb_wwan_intf_private), GFP_KERNEL);
|
data = kzalloc(sizeof(struct usb_wwan_intf_private), GFP_KERNEL);
|
||||||
if (!data)
|
if (!data)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
data->send_setup = option_send_setup;
|
data->send_setup = option_send_setup;
|
||||||
spin_lock_init(&data->susp_lock);
|
spin_lock_init(&data->susp_lock);
|
||||||
data->private = (void *)id->driver_info;
|
data->private = (void *)id->driver_info;
|
||||||
|
|
||||||
|
usb_set_serial_data(serial, data);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1419,8 +1422,7 @@ static void option_instat_callback(struct urb *urb)
|
|||||||
static int option_send_setup(struct usb_serial_port *port)
|
static int option_send_setup(struct usb_serial_port *port)
|
||||||
{
|
{
|
||||||
struct usb_serial *serial = port->serial;
|
struct usb_serial *serial = port->serial;
|
||||||
struct usb_wwan_intf_private *intfdata =
|
struct usb_wwan_intf_private *intfdata = usb_get_serial_data(serial);
|
||||||
(struct usb_wwan_intf_private *) serial->private;
|
|
||||||
struct option_port_private *portdata;
|
struct option_port_private *portdata;
|
||||||
int ifNum = serial->interface->cur_altsetting->desc.bInterfaceNumber;
|
int ifNum = serial->interface->cur_altsetting->desc.bInterfaceNumber;
|
||||||
int val = 0;
|
int val = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user