aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/usb-serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/usb-serial.c')
-rw-r--r--drivers/usb/serial/usb-serial.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index cf083da15eb4..08f600327db4 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -507,7 +507,7 @@ static int serial_open (struct tty_struct *tty, struct file * filp)
507 /* lock this module before we call it 507 /* lock this module before we call it
508 * this may fail, which means we must bail out, 508 * this may fail, which means we must bail out,
509 * safe because we are called with BKL held */ 509 * safe because we are called with BKL held */
510 if (!try_module_get(serial->type->owner)) { 510 if (!try_module_get(serial->type->driver.owner)) {
511 retval = -ENODEV; 511 retval = -ENODEV;
512 goto bailout_kref_put; 512 goto bailout_kref_put;
513 } 513 }
@@ -522,7 +522,7 @@ static int serial_open (struct tty_struct *tty, struct file * filp)
522 return 0; 522 return 0;
523 523
524bailout_module_put: 524bailout_module_put:
525 module_put(serial->type->owner); 525 module_put(serial->type->driver.owner);
526bailout_kref_put: 526bailout_kref_put:
527 kref_put(&serial->kref, destroy_serial); 527 kref_put(&serial->kref, destroy_serial);
528 port->open_count = 0; 528 port->open_count = 0;
@@ -553,7 +553,7 @@ static void serial_close(struct tty_struct *tty, struct file * filp)
553 port->tty = NULL; 553 port->tty = NULL;
554 } 554 }
555 555
556 module_put(port->serial->type->owner); 556 module_put(port->serial->type->driver.owner);
557 } 557 }
558 558
559 kref_put(&port->serial->kref, destroy_serial); 559 kref_put(&port->serial->kref, destroy_serial);
@@ -718,8 +718,8 @@ static int serial_read_proc (char *page, char **start, off_t off, int count, int
718 continue; 718 continue;
719 719
720 length += sprintf (page+length, "%d:", i); 720 length += sprintf (page+length, "%d:", i);
721 if (serial->type->owner) 721 if (serial->type->driver.owner)
722 length += sprintf (page+length, " module:%s", module_name(serial->type->owner)); 722 length += sprintf (page+length, " module:%s", module_name(serial->type->driver.owner));
723 length += sprintf (page+length, " name:\"%s\"", serial->type->name); 723 length += sprintf (page+length, " name:\"%s\"", serial->type->name);
724 length += sprintf (page+length, " vendor:%04x product:%04x", 724 length += sprintf (page+length, " vendor:%04x product:%04x",
725 le16_to_cpu(serial->dev->descriptor.idVendor), 725 le16_to_cpu(serial->dev->descriptor.idVendor),
@@ -900,7 +900,7 @@ int usb_serial_probe(struct usb_interface *interface,
900 if (type->probe) { 900 if (type->probe) {
901 const struct usb_device_id *id; 901 const struct usb_device_id *id;
902 902
903 if (!try_module_get(type->owner)) { 903 if (!try_module_get(type->driver.owner)) {
904 dev_err(&interface->dev, "module get failed, exiting\n"); 904 dev_err(&interface->dev, "module get failed, exiting\n");
905 kfree (serial); 905 kfree (serial);
906 return -EIO; 906 return -EIO;
@@ -908,7 +908,7 @@ int usb_serial_probe(struct usb_interface *interface,
908 908
909 id = usb_match_id(interface, type->id_table); 909 id = usb_match_id(interface, type->id_table);
910 retval = type->probe(serial, id); 910 retval = type->probe(serial, id);
911 module_put(type->owner); 911 module_put(type->driver.owner);
912 912
913 if (retval) { 913 if (retval) {
914 dbg ("sub driver rejected device"); 914 dbg ("sub driver rejected device");
@@ -1007,13 +1007,13 @@ int usb_serial_probe(struct usb_interface *interface,
1007 if (!num_ports) { 1007 if (!num_ports) {
1008 /* if this device type has a calc_num_ports function, call it */ 1008 /* if this device type has a calc_num_ports function, call it */
1009 if (type->calc_num_ports) { 1009 if (type->calc_num_ports) {
1010 if (!try_module_get(type->owner)) { 1010 if (!try_module_get(type->driver.owner)) {
1011 dev_err(&interface->dev, "module get failed, exiting\n"); 1011 dev_err(&interface->dev, "module get failed, exiting\n");
1012 kfree (serial); 1012 kfree (serial);
1013 return -EIO; 1013 return -EIO;
1014 } 1014 }
1015 num_ports = type->calc_num_ports (serial); 1015 num_ports = type->calc_num_ports (serial);
1016 module_put(type->owner); 1016 module_put(type->driver.owner);
1017 } 1017 }
1018 if (!num_ports) 1018 if (!num_ports)
1019 num_ports = type->num_ports; 1019 num_ports = type->num_ports;
@@ -1158,12 +1158,12 @@ int usb_serial_probe(struct usb_interface *interface,
1158 1158
1159 /* if this device type has an attach function, call it */ 1159 /* if this device type has an attach function, call it */
1160 if (type->attach) { 1160 if (type->attach) {
1161 if (!try_module_get(type->owner)) { 1161 if (!try_module_get(type->driver.owner)) {
1162 dev_err(&interface->dev, "module get failed, exiting\n"); 1162 dev_err(&interface->dev, "module get failed, exiting\n");
1163 goto probe_error; 1163 goto probe_error;
1164 } 1164 }
1165 retval = type->attach (serial); 1165 retval = type->attach (serial);
1166 module_put(type->owner); 1166 module_put(type->driver.owner);
1167 if (retval < 0) 1167 if (retval < 0)
1168 goto probe_error; 1168 goto probe_error;
1169 if (retval > 0) { 1169 if (retval > 0) {