[PATCH] USB Serial: get rid of the .owner field in usb_serial_driver
authorGreg Kroah-Hartman <gregkh@suse.de>
Tue, 21 Jun 2005 04:15:16 +0000 (21:15 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 28 Oct 2005 23:47:48 +0000 (16:47 -0700)
Don't duplicate something that's already in struct driver.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
31 files changed:
drivers/usb/serial/airprime.c
drivers/usb/serial/belkin_sa.c
drivers/usb/serial/bus.c
drivers/usb/serial/cp2101.c
drivers/usb/serial/cyberjack.c
drivers/usb/serial/cypress_m8.c
drivers/usb/serial/digi_acceleport.c
drivers/usb/serial/empeg.c
drivers/usb/serial/ftdi_sio.c
drivers/usb/serial/garmin_gps.c
drivers/usb/serial/generic.c
drivers/usb/serial/hp4x.c
drivers/usb/serial/io_tables.h
drivers/usb/serial/io_ti.c
drivers/usb/serial/ipaq.c
drivers/usb/serial/ipw.c
drivers/usb/serial/ir-usb.c
drivers/usb/serial/keyspan.h
drivers/usb/serial/keyspan_pda.c
drivers/usb/serial/kl5kusb105.c
drivers/usb/serial/kobil_sct.c
drivers/usb/serial/mct_u232.c
drivers/usb/serial/omninet.c
drivers/usb/serial/option.c
drivers/usb/serial/pl2303.c
drivers/usb/serial/safe_serial.c
drivers/usb/serial/ti_usb_3410_5052.c
drivers/usb/serial/usb-serial.c
drivers/usb/serial/usb-serial.h
drivers/usb/serial/visor.c
drivers/usb/serial/whiteheat.c

index 104c04385bb9d73d9f71e4fc06f27d8fe29e6870..fbc5b9b447497725547c8effd41b6a3f963e346e 100644 (file)
@@ -31,7 +31,9 @@ static struct usb_driver airprime_driver = {
 };
 
 static struct usb_serial_driver airprime_device = {
-       .owner =                THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name =                 "airprime",
        .id_table =             id_table,
        .num_interrupt_in =     NUM_DONT_CARE,
index 6d84de40cb7b63a7b83ea0bce26047678452f027..4878961a0900a0cacc5d5bf9f2b39cf6f085490d 100644 (file)
@@ -122,7 +122,9 @@ static struct usb_driver belkin_driver = {
 
 /* All of the device info needed for the serial converters */
 static struct usb_serial_driver belkin_device = {
-       .owner =                THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name =                 "Belkin / Peracom / GoHubs USB Serial Adapter",
        .short_name =           "belkin",
        .id_table =             id_table_combined,
index 5a0bcd34bb6df9c77b43fdeb1f0303121543a9a8..b8364a8de7df485bdabfbeb6d1978feb3ca5f483 100644 (file)
@@ -57,13 +57,13 @@ static int usb_serial_device_probe (struct device *dev)
 
        driver = port->serial->type;
        if (driver->port_probe) {
-               if (!try_module_get(driver->owner)) {
+               if (!try_module_get(driver->driver.owner)) {
                        dev_err(dev, "module get failed, exiting\n");
                        retval = -EIO;
                        goto exit;
                }
                retval = driver->port_probe (port);
-               module_put(driver->owner);
+               module_put(driver->driver.owner);
                if (retval)
                        goto exit;
        }
@@ -92,13 +92,13 @@ static int usb_serial_device_remove (struct device *dev)
 
        driver = port->serial->type;
        if (driver->port_remove) {
-               if (!try_module_get(driver->owner)) {
+               if (!try_module_get(driver->driver.owner)) {
                        dev_err(dev, "module get failed, exiting\n");
                        retval = -EIO;
                        goto exit;
                }
                retval = driver->port_remove (port);
-               module_put(driver->owner);
+               module_put(driver->driver.owner);
        }
 exit:
        minor = port->number;
@@ -120,7 +120,6 @@ int usb_serial_bus_register(struct usb_serial_driver *driver)
        driver->driver.bus = &usb_serial_bus_type;
        driver->driver.probe = usb_serial_device_probe;
        driver->driver.remove = usb_serial_device_remove;
-       driver->driver.owner = driver->owner;
 
        retval = driver_register(&driver->driver);
 
index 0b45b58bef5fa13d0a28b20af3021992ff5930d1..81dd720a122b52781d52f463cc98ed4fb1bd929f 100644 (file)
@@ -74,7 +74,9 @@ static struct usb_driver cp2101_driver = {
 };
 
 static struct usb_serial_driver cp2101_device = {
-       .owner                  = THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name                   = "CP2101",
        .id_table               = id_table,
        .num_interrupt_in       = 0,
index 9f421a3c47e8aec6aa401341a4c21b8b5070da21..3441bad74f7b11d7b63934acf65eb355b34a0c65 100644 (file)
@@ -84,7 +84,9 @@ static struct usb_driver cyberjack_driver = {
 };
 
 static struct usb_serial_driver cyberjack_device = {
-       .owner =                THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name =                 "Reiner SCT Cyberjack USB card reader",
        .short_name =           "cyberjack",
        .id_table =             id_table,
index 4fb8e59d15275b2fa94fba954e33cb2a3e8b9f91..b4069af4d56589344f3526961aa2c586922b1cf5 100644 (file)
@@ -177,7 +177,9 @@ static unsigned int   cypress_buf_get(struct cypress_buf *cb, char *buf, unsigne
 
 
 static struct usb_serial_driver cypress_earthmate_device = {
-       .owner =                        THIS_MODULE,
+       .driver = {
+               .owner =                THIS_MODULE,
+       },
        .name =                         "DeLorme Earthmate USB",
        .short_name =                   "earthmate",
        .id_table =                     id_table_earthmate,
@@ -204,7 +206,9 @@ static struct usb_serial_driver cypress_earthmate_device = {
 };
 
 static struct usb_serial_driver cypress_hidcom_device = {
-       .owner =                        THIS_MODULE,
+       .driver = {
+               .owner =                THIS_MODULE,
+       },
        .name =                         "HID->COM RS232 Adapter",
        .short_name =                   "cyphidcom",
        .id_table =                     id_table_cyphidcomrs232,
index 66feb88b43163c19aec07b9e0f4c8abe4705695d..be9b495d2491d83298f553abcb05c9bc023295a8 100644 (file)
@@ -504,7 +504,9 @@ static struct usb_driver digi_driver = {
 /* device info needed for the Digi serial converter */
 
 static struct usb_serial_driver digi_acceleport_2_device = {
-       .owner =                        THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name =                         "Digi 2 port USB adapter",
        .short_name =                   "digi_2",
        .id_table =                     id_table_2,
@@ -531,7 +533,9 @@ static struct usb_serial_driver digi_acceleport_2_device = {
 };
 
 static struct usb_serial_driver digi_acceleport_4_device = {
-       .owner =                        THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name =                         "Digi 4 port USB adapter",
        .short_name =                   "digi_4",
        .id_table =                     id_table_4,
index cbea8b38b60ee61c22b221a93db0539e9586978e..3e6c4ba7667b1eba0d86d24e9900ce87f9e5659a 100644 (file)
@@ -113,7 +113,9 @@ static struct usb_driver empeg_driver = {
 };
 
 static struct usb_serial_driver empeg_device = {
-       .owner =                THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name =                 "Empeg",
        .id_table =             id_table,
        .num_interrupt_in =     0,
index 529e1a7ccfa06698fbaf6019de55c1e461f787fd..9d945de0acacbb1abd9ed4bafe2a66f918dbf055 100644 (file)
@@ -563,7 +563,9 @@ static __u32 ftdi_232bm_baud_base_to_divisor (int baud, int base);
 static __u32 ftdi_232bm_baud_to_divisor (int baud);
 
 static struct usb_serial_driver ftdi_sio_device = {
-       .owner =                THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name =                 "FTDI USB Serial Device",
        .short_name =           "ftdi_sio",
        .id_table =             id_table_combined,
index 7361194f1d666f8eba904139842ed2e3e35176d5..3fd98c00cd6addb38f647613ba1441922a9915e6 100644 (file)
@@ -1470,7 +1470,9 @@ static void garmin_shutdown (struct usb_serial *serial)
 
 /* All of the device info needed */
 static struct usb_serial_driver garmin_device = {
-       .owner               = THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name                = "Garmin GPS usb/tty",
        .short_name          = "garmin_gps",
        .id_table            = id_table,
index 7f567bf96549c11584f5bdfe12c4aa64099b52ff..779bea0c6242dc575edbda7600c97b34e0813a1b 100644 (file)
@@ -37,7 +37,9 @@ static struct usb_device_id generic_device_ids[2]; /* Initially all zeroes. */
 
 /* All of the device info needed for the Generic Serial Converter */
 struct usb_serial_driver usb_serial_generic_device = {
-       .owner =                THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name =                 "Generic",
        .short_name =           "generic",
        .id_table =             generic_device_ids,
index b49469907a87f70a80c0f69005bad7b8b0678fe6..4f3cbc08c4ee3e6d729717f74c84e5fb6a3f0234 100644 (file)
@@ -45,7 +45,9 @@ static struct usb_driver hp49gp_driver = {
 };
 
 static struct usb_serial_driver hp49gp_device = {
-       .owner =                THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name =                 "HP4X",
        .id_table =             id_table,
        .num_interrupt_in =     NUM_DONT_CARE,
index 7314c04727fe46f62c6578d0e906ee841ec978d2..28fb0d42a1662e2b31e73c5a0ee9d8ec90d67c7a 100644 (file)
@@ -76,7 +76,9 @@ static struct usb_device_id id_table_combined [] = {
 MODULE_DEVICE_TABLE (usb, id_table_combined);
 
 static struct usb_serial_driver edgeport_2port_device = {
-       .owner                  = THIS_MODULE,
+       .driver = {
+               .owner          = THIS_MODULE,
+       },
        .name                   = "Edgeport 2 port adapter",
        .short_name             = "edgeport_2",
        .id_table               = edgeport_2port_id_table,
@@ -104,7 +106,9 @@ static struct usb_serial_driver edgeport_2port_device = {
 };
 
 static struct usb_serial_driver edgeport_4port_device = {
-       .owner                  = THIS_MODULE,
+       .driver = {
+               .owner          = THIS_MODULE,
+       },
        .name                   = "Edgeport 4 port adapter",
        .short_name             = "edgeport_4",
        .id_table               = edgeport_4port_id_table,
@@ -132,7 +136,9 @@ static struct usb_serial_driver edgeport_4port_device = {
 };
 
 static struct usb_serial_driver edgeport_8port_device = {
-       .owner                  = THIS_MODULE,
+       .driver = {
+               .owner          = THIS_MODULE,
+       },
        .name                   = "Edgeport 8 port adapter",
        .short_name             = "edgeport_8",
        .id_table               = edgeport_8port_id_table,
index 4328cc702ef70fafa3c6a49da1adcc710c9db69f..74228a072643b3975f41d3593d340c5546a6bfbf 100644 (file)
@@ -2983,7 +2983,9 @@ static unsigned int edge_buf_get(struct edge_buf *eb, char *buf,
 
 
 static struct usb_serial_driver edgeport_1port_device = {
-       .owner                  = THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name                   = "Edgeport TI 1 port adapter",
        .short_name             = "edgeport_ti_1",
        .id_table               = edgeport_1port_id_table,
@@ -3011,7 +3013,9 @@ static struct usb_serial_driver edgeport_1port_device = {
 };
 
 static struct usb_serial_driver edgeport_2port_device = {
-       .owner                  = THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name                   = "Edgeport TI 2 port adapter",
        .short_name             = "edgeport_ti_2",
        .id_table               = edgeport_2port_id_table,
index 9a79ad8d7a5f0707742a01037e8f92658a0ba9b9..9aedfb91b20cdc58968b1d9ce409ca09b656ab98 100644 (file)
@@ -548,7 +548,9 @@ static struct usb_driver ipaq_driver = {
 
 /* All of the device info needed for the Compaq iPAQ */
 static struct usb_serial_driver ipaq_device = {
-       .owner =                THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name =                 "PocketPC PDA",
        .id_table =             ipaq_id_table,
        .num_interrupt_in =     NUM_DONT_CARE,
index 04524d34de3b1489c7cdd4df35ba2143131fa865..2ba69623ac05bb896417014b713760c8d8597f61 100644 (file)
@@ -444,7 +444,9 @@ static int ipw_disconnect(struct usb_serial_port *port)
 }
 
 static struct usb_serial_driver ipw_device = {
-       .owner =                THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name =                 "IPWireless converter",
        .short_name =           "ipw",
        .id_table =             usb_ipw_ids,
index ecfb2060ea0ff2ccbdea138a653acf8e85f7b890..bf079059819e0202afd2b8be43b3ff52e92ee870 100644 (file)
@@ -134,7 +134,9 @@ static struct usb_driver ir_driver = {
 
 
 static struct usb_serial_driver ir_device = {
-       .owner =                THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name =                 "IR Dongle",
        .id_table =             id_table,
        .num_interrupt_in =     1,
index 97e7d9e53e399a687d85277aada3c0601d0f8940..124d46e76a2e464748500110c82034ffd6fd4ddf 100644 (file)
@@ -571,7 +571,9 @@ static struct usb_device_id keyspan_4port_ids[] = {
 
 /* Structs for the devices, pre and post renumeration. */
 static struct usb_serial_driver keyspan_pre_device = {
-       .owner                  = THIS_MODULE,
+       .driver = {
+               .owner          = THIS_MODULE,
+       },
        .name                   = "Keyspan - (without firmware)",
        .short_name             = "keyspan_no_firm",
        .id_table               = keyspan_pre_ids,
@@ -583,7 +585,9 @@ static struct usb_serial_driver keyspan_pre_device = {
 };
 
 static struct usb_serial_driver keyspan_1port_device = {
-       .owner                  = THIS_MODULE,
+       .driver = {
+               .owner          = THIS_MODULE,
+       },
        .name                   = "Keyspan 1 port adapter",
        .short_name             = "keyspan_1",
        .id_table               = keyspan_1port_ids,
@@ -608,7 +612,9 @@ static struct usb_serial_driver keyspan_1port_device = {
 };
 
 static struct usb_serial_driver keyspan_2port_device = {
-       .owner                  = THIS_MODULE,
+       .driver = {
+               .owner          = THIS_MODULE,
+       },
        .name                   = "Keyspan 2 port adapter",
        .short_name             = "keyspan_2",
        .id_table               = keyspan_2port_ids,
@@ -633,7 +639,9 @@ static struct usb_serial_driver keyspan_2port_device = {
 };
 
 static struct usb_serial_driver keyspan_4port_device = {
-       .owner                  = THIS_MODULE,
+       .driver = {
+               .owner          = THIS_MODULE,
+       },
        .name                   = "Keyspan 4 port adapter",
        .short_name             = "keyspan_4",
        .id_table               = keyspan_4port_ids,
index 8fad0e963dd3c0beb3963ef7626d31e428ac712e..389b7833e3ae2d2f193ba03c8af03f5d6a60ae1a 100644 (file)
@@ -784,7 +784,9 @@ static void keyspan_pda_shutdown (struct usb_serial *serial)
 
 #ifdef KEYSPAN
 static struct usb_serial_driver keyspan_pda_fake_device = {
-       .owner =                THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name =                 "Keyspan PDA - (prerenumeration)",
        .short_name =           "keyspan_pda_pre",
        .id_table =             id_table_fake,
@@ -798,7 +800,9 @@ static struct usb_serial_driver keyspan_pda_fake_device = {
 
 #ifdef XIRCOM
 static struct usb_serial_driver xircom_pgs_fake_device = {
-       .owner =                THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name =                 "Xircom / Entregra PGS - (prerenumeration)",
        .short_name =           "xircom_no_firm",
        .id_table =             id_table_fake_xircom,
@@ -811,7 +815,9 @@ static struct usb_serial_driver xircom_pgs_fake_device = {
 #endif
 
 static struct usb_serial_driver keyspan_pda_device = {
-       .owner =                THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name =                 "Keyspan PDA",
        .short_name =           "keyspan_pda",
        .id_table =             id_table_std,
index be082706b95246b67034c846ee8716a78e3fcecd..586108ce7897b801ad7e0fcf56875afd40c4409b 100644 (file)
@@ -124,7 +124,9 @@ static struct usb_driver kl5kusb105d_driver = {
 };
 
 static struct usb_serial_driver kl5kusb105d_device = {
-       .owner =             THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name =              "KL5KUSB105D / PalmConnect",
        .short_name =        "kl5kusb105d",
        .id_table =          id_table,
index 94944340bb8d1317554a999c1c46b7042aacb133..a9578e05b22fe6e0d8791d28afd3bfafdb1e6fab 100644 (file)
@@ -106,7 +106,9 @@ static struct usb_driver kobil_driver = {
 
 
 static struct usb_serial_driver kobil_device = {
-       .owner =                THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name =                 "KOBIL USB smart card terminal",
        .id_table =             id_table,
        .num_interrupt_in =     NUM_DONT_CARE,
index 9470964316a7732945ae65bd817ba837826a3a52..7dcf91c5f83d6cd4f9ecd634ebb625ec66df330b 100644 (file)
@@ -133,7 +133,9 @@ static struct usb_driver mct_u232_driver = {
 };
 
 static struct usb_serial_driver mct_u232_device = {
-       .owner =             THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name =              "MCT U232",
        .short_name =        "mct_u232",
        .id_table =          id_table_combined,
index 53c0588877c027cc22b0b57a2df00c44655bd483..f6327cc1b2e7b3ac7e636d91ef4543c27ce354b9 100644 (file)
@@ -89,7 +89,9 @@ static struct usb_driver omninet_driver = {
 
 
 static struct usb_serial_driver zyxel_omninet_device = {
-       .owner =                THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name =                 "ZyXEL - omni.net lcd plus usb",
        .short_name =           "omninet",
        .id_table =             id_table,
index 6ec9266e2e96b6f62c22586c756c2e3e09b9004f..a2b5adf34868fc8ecbae0739f4751ef068fcd78f 100644 (file)
@@ -106,7 +106,9 @@ static struct usb_driver option_driver = {
  * recognizes separately, thus num_port=1.
  */
 static struct usb_serial_driver option_3port_device = {
-       .owner             = THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name              = "Option 3G data card",
        .short_name        = "option",
        .id_table          = option_ids,
index 7134648e078dcc1bdcc6ad316b5f027583916735..beef3c4cee6eb49a5e58f93d2a77726ec6e4c5f9 100644 (file)
@@ -176,7 +176,9 @@ static unsigned int pl2303_buf_get(struct pl2303_buf *pb, char *buf,
 
 /* All of the device info needed for the PL2303 SIO serial converter */
 static struct usb_serial_driver pl2303_device = {
-       .owner =                THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name =                 "PL-2303",
        .id_table =             id_table,
        .num_interrupt_in =     NUM_DONT_CARE,
index 87871bb647dfdd288bcc575b6d4e9476ce085e6a..42a86ab689f4664010131fcea730652bc75a48a5 100644 (file)
@@ -398,7 +398,9 @@ static int safe_startup (struct usb_serial *serial)
 }
 
 static struct usb_serial_driver safe_device = {
-       .owner =                THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name =                 "Safe",
        .id_table =             id_table,
        .num_interrupt_in =     NUM_DONT_CARE,
index f2efaf6f3d768854e2d74cca88f2a7391fb9092d..eab8a6de0925b21c3fd15151c42f2c33f209dea9 100644 (file)
@@ -256,7 +256,9 @@ static struct usb_driver ti_usb_driver = {
 };
 
 static struct usb_serial_driver ti_1port_device = {
-       .owner                  = THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name                   = "TI USB 3410 1 port adapter",
        .id_table               = ti_id_table_3410,
        .num_interrupt_in       = 1,
@@ -283,7 +285,9 @@ static struct usb_serial_driver ti_1port_device = {
 };
 
 static struct usb_serial_driver ti_2port_device = {
-       .owner                  = THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name                   = "TI USB 5052 2 port adapter",
        .id_table               = ti_id_table_5052,
        .num_interrupt_in       = 1,
index cf083da15eb435ae3db80574d7d3a448cad24595..08f600327db40055650baa3b87459222b818f1ce 100644 (file)
@@ -507,7 +507,7 @@ static int serial_open (struct tty_struct *tty, struct file * filp)
                /* lock this module before we call it
                 * this may fail, which means we must bail out,
                 * safe because we are called with BKL held */
-               if (!try_module_get(serial->type->owner)) {
+               if (!try_module_get(serial->type->driver.owner)) {
                        retval = -ENODEV;
                        goto bailout_kref_put;
                }
@@ -522,7 +522,7 @@ static int serial_open (struct tty_struct *tty, struct file * filp)
        return 0;
 
 bailout_module_put:
-       module_put(serial->type->owner);
+       module_put(serial->type->driver.owner);
 bailout_kref_put:
        kref_put(&serial->kref, destroy_serial);
        port->open_count = 0;
@@ -553,7 +553,7 @@ static void serial_close(struct tty_struct *tty, struct file * filp)
                        port->tty = NULL;
                }
 
-               module_put(port->serial->type->owner);
+               module_put(port->serial->type->driver.owner);
        }
 
        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
                        continue;
 
                length += sprintf (page+length, "%d:", i);
-               if (serial->type->owner)
-                       length += sprintf (page+length, " module:%s", module_name(serial->type->owner));
+               if (serial->type->driver.owner)
+                       length += sprintf (page+length, " module:%s", module_name(serial->type->driver.owner));
                length += sprintf (page+length, " name:\"%s\"", serial->type->name);
                length += sprintf (page+length, " vendor:%04x product:%04x", 
                                   le16_to_cpu(serial->dev->descriptor.idVendor), 
@@ -900,7 +900,7 @@ int usb_serial_probe(struct usb_interface *interface,
        if (type->probe) {
                const struct usb_device_id *id;
 
-               if (!try_module_get(type->owner)) {
+               if (!try_module_get(type->driver.owner)) {
                        dev_err(&interface->dev, "module get failed, exiting\n");
                        kfree (serial);
                        return -EIO;
@@ -908,7 +908,7 @@ int usb_serial_probe(struct usb_interface *interface,
 
                id = usb_match_id(interface, type->id_table);
                retval = type->probe(serial, id);
-               module_put(type->owner);
+               module_put(type->driver.owner);
 
                if (retval) {
                        dbg ("sub driver rejected device");
@@ -1007,13 +1007,13 @@ int usb_serial_probe(struct usb_interface *interface,
        if (!num_ports) {
                /* if this device type has a calc_num_ports function, call it */
                if (type->calc_num_ports) {
-                       if (!try_module_get(type->owner)) {
+                       if (!try_module_get(type->driver.owner)) {
                                dev_err(&interface->dev, "module get failed, exiting\n");
                                kfree (serial);
                                return -EIO;
                        }
                        num_ports = type->calc_num_ports (serial);
-                       module_put(type->owner);
+                       module_put(type->driver.owner);
                }
                if (!num_ports)
                        num_ports = type->num_ports;
@@ -1158,12 +1158,12 @@ int usb_serial_probe(struct usb_interface *interface,
        
        /* if this device type has an attach function, call it */
        if (type->attach) {
-               if (!try_module_get(type->owner)) {
+               if (!try_module_get(type->driver.owner)) {
                        dev_err(&interface->dev, "module get failed, exiting\n");
                        goto probe_error;
                }
                retval = type->attach (serial);
-               module_put(type->owner);
+               module_put(type->driver.owner);
                if (retval < 0)
                        goto probe_error;
                if (retval > 0) {
index d6738b1b0429f2a7f859836cbe9a6cfb854b975c..4ca5e0c0561137b569384af80559115a80599574 100644 (file)
@@ -189,7 +189,6 @@ static inline void usb_set_serial_data (struct usb_serial *serial, void *data)
 
 /**
  * usb_serial_driver - describes a usb serial driver
- * @owner: pointer to the module that owns this driver.
  * @name: pointer to a string that describes this driver.  This string used
  *     in the syslog messages when a device is inserted or removed.
  * @short_name: a pointer to a string that describes this driver in
@@ -226,9 +225,11 @@ static inline void usb_set_serial_data (struct usb_serial *serial, void *data)
  * pointers are defined, then the USB serial core code will call them when
  * the corresponding tty port functions are called.  If they are not
  * called, the generic serial function will be used instead.
+ *
+ * The driver.owner field should be set to the module owner of this driver.
+ *
  */
 struct usb_serial_driver {
-       struct module *owner;
        char    *name;
        char    *short_name;
        const struct usb_device_id *id_table;
index 825451b3788ca44927db88653e3883871b7e57dd..0ac0377e8683c3426da2cef2533fa5394bccb4b4 100644 (file)
@@ -312,7 +312,9 @@ static struct usb_driver visor_driver = {
 
 /* All of the device info needed for the Handspring Visor, and Palm 4.0 devices */
 static struct usb_serial_driver handspring_device = {
-       .owner =                THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name =                 "Handspring Visor / Palm OS",
        .short_name =           "visor",
        .id_table =             id_table,
@@ -340,7 +342,9 @@ static struct usb_serial_driver handspring_device = {
 
 /* All of the device info needed for the Clie UX50, TH55 Palm 5.0 devices */
 static struct usb_serial_driver clie_5_device = {
-       .owner =                THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name =                 "Sony Clie 5.0",
        .short_name =           "clie_5",
        .id_table =             clie_id_5_table,
@@ -368,7 +372,9 @@ static struct usb_serial_driver clie_5_device = {
 
 /* device info for the Sony Clie OS version 3.5 */
 static struct usb_serial_driver clie_3_5_device = {
-       .owner =                THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name =                 "Sony Clie 3.5",
        .short_name =           "clie_3.5",
        .id_table =             clie_id_3_5_table,
index dc06664bfa0eb9e5749a759d164460b43e249a6d..fb95a34a1cf72e6210802ceb0d4af27bc7cf7258 100644 (file)
@@ -157,7 +157,9 @@ static void whiteheat_read_callback (struct urb *urb, struct pt_regs *regs);
 static void whiteheat_write_callback   (struct urb *urb, struct pt_regs *regs);
 
 static struct usb_serial_driver whiteheat_fake_device = {
-       .owner =                THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name =                 "Connect Tech - WhiteHEAT - (prerenumeration)",
        .short_name =           "whiteheatnofirm",
        .id_table =             id_table_prerenumeration,
@@ -170,7 +172,9 @@ static struct usb_serial_driver whiteheat_fake_device = {
 };
 
 static struct usb_serial_driver whiteheat_device = {
-       .owner =                THIS_MODULE,
+       .driver = {
+               .owner =        THIS_MODULE,
+       },
        .name =                 "Connect Tech - WhiteHEAT",
        .short_name =           "whiteheat",
        .id_table =             id_table_std,