Commit 269bda1c123c7caf88e1deb2264f9086f0344192
1 parent
502b95c1cc
Exists in
master
and in
7 other branches
[PATCH] USB Serial: move name to driver structure
This fixes up a lot of problems in sysfs with some of the usb serial drivers, they had incorrect driver names. Also saves a tiny ammount of memory. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Showing 31 changed files with 115 additions and 114 deletions Side-by-side Diff
- 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
drivers/usb/serial/airprime.c
drivers/usb/serial/belkin_sa.c
... | ... | @@ -124,9 +124,9 @@ |
124 | 124 | static struct usb_serial_driver belkin_device = { |
125 | 125 | .driver = { |
126 | 126 | .owner = THIS_MODULE, |
127 | + .name = "belkin", | |
127 | 128 | }, |
128 | - .name = "Belkin / Peracom / GoHubs USB Serial Adapter", | |
129 | - .short_name = "belkin", | |
129 | + .description = "Belkin / Peracom / GoHubs USB Serial Adapter", | |
130 | 130 | .id_table = id_table_combined, |
131 | 131 | .num_interrupt_in = 1, |
132 | 132 | .num_bulk_in = 1, |
drivers/usb/serial/bus.c
... | ... | @@ -72,7 +72,7 @@ |
72 | 72 | tty_register_device (usb_serial_tty_driver, minor, dev); |
73 | 73 | dev_info(&port->serial->dev->dev, |
74 | 74 | "%s converter now attached to ttyUSB%d\n", |
75 | - driver->name, minor); | |
75 | + driver->description, minor); | |
76 | 76 | |
77 | 77 | exit: |
78 | 78 | return retval; |
... | ... | @@ -104,7 +104,7 @@ |
104 | 104 | minor = port->number; |
105 | 105 | tty_unregister_device (usb_serial_tty_driver, minor); |
106 | 106 | dev_info(dev, "%s converter now disconnected from ttyUSB%d\n", |
107 | - driver->name, minor); | |
107 | + driver->description, minor); | |
108 | 108 | |
109 | 109 | return retval; |
110 | 110 | } |
... | ... | @@ -113,10 +113,6 @@ |
113 | 113 | { |
114 | 114 | int retval; |
115 | 115 | |
116 | - if (driver->short_name) | |
117 | - driver->driver.name = (char *)driver->short_name; | |
118 | - else | |
119 | - driver->driver.name = (char *)driver->name; | |
120 | 116 | driver->driver.bus = &usb_serial_bus_type; |
121 | 117 | driver->driver.probe = usb_serial_device_probe; |
122 | 118 | driver->driver.remove = usb_serial_device_remove; |
drivers/usb/serial/cp2101.c
... | ... | @@ -67,7 +67,7 @@ |
67 | 67 | |
68 | 68 | static struct usb_driver cp2101_driver = { |
69 | 69 | .owner = THIS_MODULE, |
70 | - .name = "CP2101", | |
70 | + .name = "cp2101", | |
71 | 71 | .probe = usb_serial_probe, |
72 | 72 | .disconnect = usb_serial_disconnect, |
73 | 73 | .id_table = id_table, |
74 | 74 | |
... | ... | @@ -76,8 +76,8 @@ |
76 | 76 | static struct usb_serial_driver cp2101_device = { |
77 | 77 | .driver = { |
78 | 78 | .owner = THIS_MODULE, |
79 | + .name = "cp2101", | |
79 | 80 | }, |
80 | - .name = "CP2101", | |
81 | 81 | .id_table = id_table, |
82 | 82 | .num_interrupt_in = 0, |
83 | 83 | .num_bulk_in = 0, |
drivers/usb/serial/cyberjack.c
... | ... | @@ -86,9 +86,9 @@ |
86 | 86 | static struct usb_serial_driver cyberjack_device = { |
87 | 87 | .driver = { |
88 | 88 | .owner = THIS_MODULE, |
89 | + .name = "cyberjack", | |
89 | 90 | }, |
90 | - .name = "Reiner SCT Cyberjack USB card reader", | |
91 | - .short_name = "cyberjack", | |
91 | + .description = "Reiner SCT Cyberjack USB card reader", | |
92 | 92 | .id_table = id_table, |
93 | 93 | .num_interrupt_in = 1, |
94 | 94 | .num_bulk_in = 1, |
drivers/usb/serial/cypress_m8.c
... | ... | @@ -179,9 +179,9 @@ |
179 | 179 | static struct usb_serial_driver cypress_earthmate_device = { |
180 | 180 | .driver = { |
181 | 181 | .owner = THIS_MODULE, |
182 | + .name = "earthmate", | |
182 | 183 | }, |
183 | - .name = "DeLorme Earthmate USB", | |
184 | - .short_name = "earthmate", | |
184 | + .description = "DeLorme Earthmate USB", | |
185 | 185 | .id_table = id_table_earthmate, |
186 | 186 | .num_interrupt_in = 1, |
187 | 187 | .num_interrupt_out = 1, |
188 | 188 | |
... | ... | @@ -208,9 +208,9 @@ |
208 | 208 | static struct usb_serial_driver cypress_hidcom_device = { |
209 | 209 | .driver = { |
210 | 210 | .owner = THIS_MODULE, |
211 | + .name = "cyphidcom", | |
211 | 212 | }, |
212 | - .name = "HID->COM RS232 Adapter", | |
213 | - .short_name = "cyphidcom", | |
213 | + .description = "HID->COM RS232 Adapter", | |
214 | 214 | .id_table = id_table_cyphidcomrs232, |
215 | 215 | .num_interrupt_in = 1, |
216 | 216 | .num_interrupt_out = 1, |
drivers/usb/serial/digi_acceleport.c
... | ... | @@ -505,10 +505,10 @@ |
505 | 505 | |
506 | 506 | static struct usb_serial_driver digi_acceleport_2_device = { |
507 | 507 | .driver = { |
508 | - .owner = THIS_MODULE, | |
508 | + .owner = THIS_MODULE, | |
509 | + .name = "digi_2", | |
509 | 510 | }, |
510 | - .name = "Digi 2 port USB adapter", | |
511 | - .short_name = "digi_2", | |
511 | + .description = "Digi 2 port USB adapter", | |
512 | 512 | .id_table = id_table_2, |
513 | 513 | .num_interrupt_in = 0, |
514 | 514 | .num_bulk_in = 4, |
515 | 515 | |
... | ... | @@ -534,10 +534,10 @@ |
534 | 534 | |
535 | 535 | static struct usb_serial_driver digi_acceleport_4_device = { |
536 | 536 | .driver = { |
537 | - .owner = THIS_MODULE, | |
537 | + .owner = THIS_MODULE, | |
538 | + .name = "digi_4", | |
538 | 539 | }, |
539 | - .name = "Digi 4 port USB adapter", | |
540 | - .short_name = "digi_4", | |
540 | + .description = "Digi 4 port USB adapter", | |
541 | 541 | .id_table = id_table_4, |
542 | 542 | .num_interrupt_in = 0, |
543 | 543 | .num_bulk_in = 5, |
drivers/usb/serial/empeg.c
drivers/usb/serial/ftdi_sio.c
... | ... | @@ -565,9 +565,9 @@ |
565 | 565 | static struct usb_serial_driver ftdi_sio_device = { |
566 | 566 | .driver = { |
567 | 567 | .owner = THIS_MODULE, |
568 | + .name = "ftdi_sio", | |
568 | 569 | }, |
569 | - .name = "FTDI USB Serial Device", | |
570 | - .short_name = "ftdi_sio", | |
570 | + .description = "FTDI USB Serial Device", | |
571 | 571 | .id_table = id_table_combined, |
572 | 572 | .num_interrupt_in = 0, |
573 | 573 | .num_bulk_in = 1, |
drivers/usb/serial/garmin_gps.c
... | ... | @@ -1472,9 +1472,9 @@ |
1472 | 1472 | static struct usb_serial_driver garmin_device = { |
1473 | 1473 | .driver = { |
1474 | 1474 | .owner = THIS_MODULE, |
1475 | + .name = "garmin_gps", | |
1475 | 1476 | }, |
1476 | - .name = "Garmin GPS usb/tty", | |
1477 | - .short_name = "garmin_gps", | |
1477 | + .description = "Garmin GPS usb/tty", | |
1478 | 1478 | .id_table = id_table, |
1479 | 1479 | .num_interrupt_in = 1, |
1480 | 1480 | .num_bulk_in = 1, |
drivers/usb/serial/generic.c
... | ... | @@ -39,9 +39,8 @@ |
39 | 39 | struct usb_serial_driver usb_serial_generic_device = { |
40 | 40 | .driver = { |
41 | 41 | .owner = THIS_MODULE, |
42 | + .name = "generic", | |
42 | 43 | }, |
43 | - .name = "Generic", | |
44 | - .short_name = "generic", | |
45 | 44 | .id_table = generic_device_ids, |
46 | 45 | .num_interrupt_in = NUM_DONT_CARE, |
47 | 46 | .num_bulk_in = NUM_DONT_CARE, |
drivers/usb/serial/hp4x.c
... | ... | @@ -38,7 +38,7 @@ |
38 | 38 | |
39 | 39 | static struct usb_driver hp49gp_driver = { |
40 | 40 | .owner = THIS_MODULE, |
41 | - .name = "HP4X", | |
41 | + .name = "hp4X", | |
42 | 42 | .probe = usb_serial_probe, |
43 | 43 | .disconnect = usb_serial_disconnect, |
44 | 44 | .id_table = id_table, |
45 | 45 | |
... | ... | @@ -47,8 +47,8 @@ |
47 | 47 | static struct usb_serial_driver hp49gp_device = { |
48 | 48 | .driver = { |
49 | 49 | .owner = THIS_MODULE, |
50 | + .name = "hp4X", | |
50 | 51 | }, |
51 | - .name = "HP4X", | |
52 | 52 | .id_table = id_table, |
53 | 53 | .num_interrupt_in = NUM_DONT_CARE, |
54 | 54 | .num_bulk_in = NUM_DONT_CARE, |
drivers/usb/serial/io_tables.h
... | ... | @@ -78,9 +78,9 @@ |
78 | 78 | static struct usb_serial_driver edgeport_2port_device = { |
79 | 79 | .driver = { |
80 | 80 | .owner = THIS_MODULE, |
81 | + .name = "edgeport_2", | |
81 | 82 | }, |
82 | - .name = "Edgeport 2 port adapter", | |
83 | - .short_name = "edgeport_2", | |
83 | + .description = "Edgeport 2 port adapter", | |
84 | 84 | .id_table = edgeport_2port_id_table, |
85 | 85 | .num_interrupt_in = 1, |
86 | 86 | .num_bulk_in = 1, |
87 | 87 | |
... | ... | @@ -108,9 +108,9 @@ |
108 | 108 | static struct usb_serial_driver edgeport_4port_device = { |
109 | 109 | .driver = { |
110 | 110 | .owner = THIS_MODULE, |
111 | + .name = "edgeport_4", | |
111 | 112 | }, |
112 | - .name = "Edgeport 4 port adapter", | |
113 | - .short_name = "edgeport_4", | |
113 | + .description = "Edgeport 4 port adapter", | |
114 | 114 | .id_table = edgeport_4port_id_table, |
115 | 115 | .num_interrupt_in = 1, |
116 | 116 | .num_bulk_in = 1, |
117 | 117 | |
... | ... | @@ -138,9 +138,9 @@ |
138 | 138 | static struct usb_serial_driver edgeport_8port_device = { |
139 | 139 | .driver = { |
140 | 140 | .owner = THIS_MODULE, |
141 | + .name = "edgeport_8", | |
141 | 142 | }, |
142 | - .name = "Edgeport 8 port adapter", | |
143 | - .short_name = "edgeport_8", | |
143 | + .description = "Edgeport 8 port adapter", | |
144 | 144 | .id_table = edgeport_8port_id_table, |
145 | 145 | .num_interrupt_in = 1, |
146 | 146 | .num_bulk_in = 1, |
drivers/usb/serial/io_ti.c
... | ... | @@ -2984,10 +2984,10 @@ |
2984 | 2984 | |
2985 | 2985 | static struct usb_serial_driver edgeport_1port_device = { |
2986 | 2986 | .driver = { |
2987 | - .owner = THIS_MODULE, | |
2987 | + .owner = THIS_MODULE, | |
2988 | + .name = "edgeport_ti_1", | |
2988 | 2989 | }, |
2989 | - .name = "Edgeport TI 1 port adapter", | |
2990 | - .short_name = "edgeport_ti_1", | |
2990 | + .description = "Edgeport TI 1 port adapter", | |
2991 | 2991 | .id_table = edgeport_1port_id_table, |
2992 | 2992 | .num_interrupt_in = 1, |
2993 | 2993 | .num_bulk_in = 1, |
2994 | 2994 | |
... | ... | @@ -3014,10 +3014,10 @@ |
3014 | 3014 | |
3015 | 3015 | static struct usb_serial_driver edgeport_2port_device = { |
3016 | 3016 | .driver = { |
3017 | - .owner = THIS_MODULE, | |
3017 | + .owner = THIS_MODULE, | |
3018 | + .name = "edgeport_ti_2", | |
3018 | 3019 | }, |
3019 | - .name = "Edgeport TI 2 port adapter", | |
3020 | - .short_name = "edgeport_ti_2", | |
3020 | + .description = "Edgeport TI 2 port adapter", | |
3021 | 3021 | .id_table = edgeport_2port_id_table, |
3022 | 3022 | .num_interrupt_in = 1, |
3023 | 3023 | .num_bulk_in = 2, |
drivers/usb/serial/ipaq.c
... | ... | @@ -550,8 +550,9 @@ |
550 | 550 | static struct usb_serial_driver ipaq_device = { |
551 | 551 | .driver = { |
552 | 552 | .owner = THIS_MODULE, |
553 | + .name = "ipaq", | |
553 | 554 | }, |
554 | - .name = "PocketPC PDA", | |
555 | + .description = "PocketPC PDA", | |
555 | 556 | .id_table = ipaq_id_table, |
556 | 557 | .num_interrupt_in = NUM_DONT_CARE, |
557 | 558 | .num_bulk_in = 1, |
drivers/usb/serial/ipw.c
... | ... | @@ -446,9 +446,9 @@ |
446 | 446 | static struct usb_serial_driver ipw_device = { |
447 | 447 | .driver = { |
448 | 448 | .owner = THIS_MODULE, |
449 | + .name = "ipw", | |
449 | 450 | }, |
450 | - .name = "IPWireless converter", | |
451 | - .short_name = "ipw", | |
451 | + .description = "IPWireless converter", | |
452 | 452 | .id_table = usb_ipw_ids, |
453 | 453 | .num_interrupt_in = NUM_DONT_CARE, |
454 | 454 | .num_bulk_in = 1, |
drivers/usb/serial/ir-usb.c
... | ... | @@ -136,8 +136,9 @@ |
136 | 136 | static struct usb_serial_driver ir_device = { |
137 | 137 | .driver = { |
138 | 138 | .owner = THIS_MODULE, |
139 | + .name = "ir-usb", | |
139 | 140 | }, |
140 | - .name = "IR Dongle", | |
141 | + .description = "IR Dongle", | |
141 | 142 | .id_table = id_table, |
142 | 143 | .num_interrupt_in = 1, |
143 | 144 | .num_bulk_in = 1, |
drivers/usb/serial/keyspan.h
... | ... | @@ -573,9 +573,9 @@ |
573 | 573 | static struct usb_serial_driver keyspan_pre_device = { |
574 | 574 | .driver = { |
575 | 575 | .owner = THIS_MODULE, |
576 | + .name = "keyspan_no_firm", | |
576 | 577 | }, |
577 | - .name = "Keyspan - (without firmware)", | |
578 | - .short_name = "keyspan_no_firm", | |
578 | + .description = "Keyspan - (without firmware)", | |
579 | 579 | .id_table = keyspan_pre_ids, |
580 | 580 | .num_interrupt_in = NUM_DONT_CARE, |
581 | 581 | .num_bulk_in = NUM_DONT_CARE, |
582 | 582 | |
... | ... | @@ -587,9 +587,9 @@ |
587 | 587 | static struct usb_serial_driver keyspan_1port_device = { |
588 | 588 | .driver = { |
589 | 589 | .owner = THIS_MODULE, |
590 | + .name = "keyspan_1", | |
590 | 591 | }, |
591 | - .name = "Keyspan 1 port adapter", | |
592 | - .short_name = "keyspan_1", | |
592 | + .description = "Keyspan 1 port adapter", | |
593 | 593 | .id_table = keyspan_1port_ids, |
594 | 594 | .num_interrupt_in = NUM_DONT_CARE, |
595 | 595 | .num_bulk_in = NUM_DONT_CARE, |
596 | 596 | |
... | ... | @@ -614,9 +614,9 @@ |
614 | 614 | static struct usb_serial_driver keyspan_2port_device = { |
615 | 615 | .driver = { |
616 | 616 | .owner = THIS_MODULE, |
617 | + .name = "keyspan_2", | |
617 | 618 | }, |
618 | - .name = "Keyspan 2 port adapter", | |
619 | - .short_name = "keyspan_2", | |
619 | + .description = "Keyspan 2 port adapter", | |
620 | 620 | .id_table = keyspan_2port_ids, |
621 | 621 | .num_interrupt_in = NUM_DONT_CARE, |
622 | 622 | .num_bulk_in = NUM_DONT_CARE, |
623 | 623 | |
... | ... | @@ -641,9 +641,9 @@ |
641 | 641 | static struct usb_serial_driver keyspan_4port_device = { |
642 | 642 | .driver = { |
643 | 643 | .owner = THIS_MODULE, |
644 | + .name = "keyspan_4", | |
644 | 645 | }, |
645 | - .name = "Keyspan 4 port adapter", | |
646 | - .short_name = "keyspan_4", | |
646 | + .description = "Keyspan 4 port adapter", | |
647 | 647 | .id_table = keyspan_4port_ids, |
648 | 648 | .num_interrupt_in = NUM_DONT_CARE, |
649 | 649 | .num_bulk_in = 5, |
drivers/usb/serial/keyspan_pda.c
... | ... | @@ -786,9 +786,9 @@ |
786 | 786 | static struct usb_serial_driver keyspan_pda_fake_device = { |
787 | 787 | .driver = { |
788 | 788 | .owner = THIS_MODULE, |
789 | + .name = "keyspan_pda_pre", | |
789 | 790 | }, |
790 | - .name = "Keyspan PDA - (prerenumeration)", | |
791 | - .short_name = "keyspan_pda_pre", | |
791 | + .description = "Keyspan PDA - (prerenumeration)", | |
792 | 792 | .id_table = id_table_fake, |
793 | 793 | .num_interrupt_in = NUM_DONT_CARE, |
794 | 794 | .num_bulk_in = NUM_DONT_CARE, |
795 | 795 | |
... | ... | @@ -802,9 +802,9 @@ |
802 | 802 | static struct usb_serial_driver xircom_pgs_fake_device = { |
803 | 803 | .driver = { |
804 | 804 | .owner = THIS_MODULE, |
805 | + .name = "xircom_no_firm", | |
805 | 806 | }, |
806 | - .name = "Xircom / Entregra PGS - (prerenumeration)", | |
807 | - .short_name = "xircom_no_firm", | |
807 | + .description = "Xircom / Entregra PGS - (prerenumeration)", | |
808 | 808 | .id_table = id_table_fake_xircom, |
809 | 809 | .num_interrupt_in = NUM_DONT_CARE, |
810 | 810 | .num_bulk_in = NUM_DONT_CARE, |
811 | 811 | |
... | ... | @@ -817,9 +817,9 @@ |
817 | 817 | static struct usb_serial_driver keyspan_pda_device = { |
818 | 818 | .driver = { |
819 | 819 | .owner = THIS_MODULE, |
820 | + .name = "keyspan_pda", | |
820 | 821 | }, |
821 | - .name = "Keyspan PDA", | |
822 | - .short_name = "keyspan_pda", | |
822 | + .description = "Keyspan PDA", | |
823 | 823 | .id_table = id_table_std, |
824 | 824 | .num_interrupt_in = 1, |
825 | 825 | .num_bulk_in = 0, |
drivers/usb/serial/kl5kusb105.c
... | ... | @@ -126,9 +126,9 @@ |
126 | 126 | static struct usb_serial_driver kl5kusb105d_device = { |
127 | 127 | .driver = { |
128 | 128 | .owner = THIS_MODULE, |
129 | + .name = "kl5kusb105d", | |
129 | 130 | }, |
130 | - .name = "KL5KUSB105D / PalmConnect", | |
131 | - .short_name = "kl5kusb105d", | |
131 | + .description = "KL5KUSB105D / PalmConnect", | |
132 | 132 | .id_table = id_table, |
133 | 133 | .num_interrupt_in = 1, |
134 | 134 | .num_bulk_in = 1, |
drivers/usb/serial/kobil_sct.c
... | ... | @@ -108,8 +108,9 @@ |
108 | 108 | static struct usb_serial_driver kobil_device = { |
109 | 109 | .driver = { |
110 | 110 | .owner = THIS_MODULE, |
111 | + .name = "kobil", | |
111 | 112 | }, |
112 | - .name = "KOBIL USB smart card terminal", | |
113 | + .description = "KOBIL USB smart card terminal", | |
113 | 114 | .id_table = id_table, |
114 | 115 | .num_interrupt_in = NUM_DONT_CARE, |
115 | 116 | .num_bulk_in = 0, |
drivers/usb/serial/mct_u232.c
... | ... | @@ -135,9 +135,9 @@ |
135 | 135 | static struct usb_serial_driver mct_u232_device = { |
136 | 136 | .driver = { |
137 | 137 | .owner = THIS_MODULE, |
138 | + .name = "mct_u232", | |
138 | 139 | }, |
139 | - .name = "MCT U232", | |
140 | - .short_name = "mct_u232", | |
140 | + .description = "MCT U232", | |
141 | 141 | .id_table = id_table_combined, |
142 | 142 | .num_interrupt_in = 2, |
143 | 143 | .num_bulk_in = 0, |
drivers/usb/serial/omninet.c
... | ... | @@ -91,9 +91,9 @@ |
91 | 91 | static struct usb_serial_driver zyxel_omninet_device = { |
92 | 92 | .driver = { |
93 | 93 | .owner = THIS_MODULE, |
94 | + .name = "omninet", | |
94 | 95 | }, |
95 | - .name = "ZyXEL - omni.net lcd plus usb", | |
96 | - .short_name = "omninet", | |
96 | + .description = "ZyXEL - omni.net lcd plus usb", | |
97 | 97 | .id_table = id_table, |
98 | 98 | .num_interrupt_in = 1, |
99 | 99 | .num_bulk_in = 1, |
drivers/usb/serial/option.c
... | ... | @@ -108,9 +108,9 @@ |
108 | 108 | static struct usb_serial_driver option_3port_device = { |
109 | 109 | .driver = { |
110 | 110 | .owner = THIS_MODULE, |
111 | + .name = "option", | |
111 | 112 | }, |
112 | - .name = "Option 3G data card", | |
113 | - .short_name = "option", | |
113 | + .description = "Option 3G data card", | |
114 | 114 | .id_table = option_ids, |
115 | 115 | .num_interrupt_in = NUM_DONT_CARE, |
116 | 116 | .num_bulk_in = NUM_DONT_CARE, |
drivers/usb/serial/pl2303.c
drivers/usb/serial/safe_serial.c
... | ... | @@ -400,8 +400,8 @@ |
400 | 400 | static struct usb_serial_driver safe_device = { |
401 | 401 | .driver = { |
402 | 402 | .owner = THIS_MODULE, |
403 | + .name = "safe_serial", | |
403 | 404 | }, |
404 | - .name = "Safe", | |
405 | 405 | .id_table = id_table, |
406 | 406 | .num_interrupt_in = NUM_DONT_CARE, |
407 | 407 | .num_bulk_in = NUM_DONT_CARE, |
drivers/usb/serial/ti_usb_3410_5052.c
... | ... | @@ -257,9 +257,10 @@ |
257 | 257 | |
258 | 258 | static struct usb_serial_driver ti_1port_device = { |
259 | 259 | .driver = { |
260 | - .owner = THIS_MODULE, | |
260 | + .owner = THIS_MODULE, | |
261 | + .name = "ti_usb_3410_5052_1", | |
261 | 262 | }, |
262 | - .name = "TI USB 3410 1 port adapter", | |
263 | + .description = "TI USB 3410 1 port adapter", | |
263 | 264 | .id_table = ti_id_table_3410, |
264 | 265 | .num_interrupt_in = 1, |
265 | 266 | .num_bulk_in = 1, |
266 | 267 | |
... | ... | @@ -286,9 +287,10 @@ |
286 | 287 | |
287 | 288 | static struct usb_serial_driver ti_2port_device = { |
288 | 289 | .driver = { |
289 | - .owner = THIS_MODULE, | |
290 | + .owner = THIS_MODULE, | |
291 | + .name = "ti_usb_3410_5052_2", | |
290 | 292 | }, |
291 | - .name = "TI USB 5052 2 port adapter", | |
293 | + .description = "TI USB 5052 2 port adapter", | |
292 | 294 | .id_table = ti_id_table_5052, |
293 | 295 | .num_interrupt_in = 1, |
294 | 296 | .num_bulk_in = 2, |
drivers/usb/serial/usb-serial.c
... | ... | @@ -122,7 +122,7 @@ |
122 | 122 | |
123 | 123 | serial = to_usb_serial(kref); |
124 | 124 | |
125 | - dbg ("%s - %s", __FUNCTION__, serial->type->name); | |
125 | + dbg("%s - %s", __FUNCTION__, serial->type->description); | |
126 | 126 | |
127 | 127 | serial->type->shutdown(serial); |
128 | 128 | |
... | ... | @@ -415,7 +415,7 @@ |
415 | 415 | length += sprintf (page+length, "%d:", i); |
416 | 416 | if (serial->type->driver.owner) |
417 | 417 | length += sprintf (page+length, " module:%s", module_name(serial->type->driver.owner)); |
418 | - length += sprintf (page+length, " name:\"%s\"", serial->type->name); | |
418 | + length += sprintf (page+length, " name:\"%s\"", serial->type->description); | |
419 | 419 | length += sprintf (page+length, " vendor:%04x product:%04x", |
420 | 420 | le16_to_cpu(serial->dev->descriptor.idVendor), |
421 | 421 | le16_to_cpu(serial->dev->descriptor.idProduct)); |
... | ... | @@ -687,7 +687,7 @@ |
687 | 687 | #endif |
688 | 688 | |
689 | 689 | /* found all that we need */ |
690 | - dev_info(&interface->dev, "%s converter detected\n", type->name); | |
690 | + dev_info(&interface->dev, "%s converter detected\n", type->description); | |
691 | 691 | |
692 | 692 | #ifdef CONFIG_USB_SERIAL_GENERIC |
693 | 693 | if (type == &usb_serial_generic_device) { |
694 | 694 | |
695 | 695 | |
... | ... | @@ -1088,16 +1088,19 @@ |
1088 | 1088 | |
1089 | 1089 | fixup_generic(driver); |
1090 | 1090 | |
1091 | + if (!driver->description) | |
1092 | + driver->description = driver->driver.name; | |
1093 | + | |
1091 | 1094 | /* Add this device to our list of devices */ |
1092 | 1095 | list_add(&driver->driver_list, &usb_serial_driver_list); |
1093 | 1096 | |
1094 | 1097 | retval = usb_serial_bus_register(driver); |
1095 | 1098 | if (retval) { |
1096 | - err("problem %d when registering driver %s", retval, driver->name); | |
1099 | + err("problem %d when registering driver %s", retval, driver->description); | |
1097 | 1100 | list_del(&driver->driver_list); |
1098 | 1101 | } |
1099 | 1102 | else |
1100 | - info("USB Serial support registered for %s", driver->name); | |
1103 | + info("USB Serial support registered for %s", driver->description); | |
1101 | 1104 | |
1102 | 1105 | return retval; |
1103 | 1106 | } |
... | ... | @@ -1105,7 +1108,7 @@ |
1105 | 1108 | |
1106 | 1109 | void usb_serial_deregister(struct usb_serial_driver *device) |
1107 | 1110 | { |
1108 | - info("USB Serial deregistering driver %s", device->name); | |
1111 | + info("USB Serial deregistering driver %s", device->description); | |
1109 | 1112 | list_del(&device->driver_list); |
1110 | 1113 | usb_serial_bus_deregister(device); |
1111 | 1114 | } |
drivers/usb/serial/usb-serial.h
... | ... | @@ -149,11 +149,8 @@ |
149 | 149 | |
150 | 150 | /** |
151 | 151 | * usb_serial_driver - describes a usb serial driver |
152 | - * @name: pointer to a string that describes this driver. This string used | |
152 | + * @description: pointer to a string that describes this driver. This string used | |
153 | 153 | * in the syslog messages when a device is inserted or removed. |
154 | - * @short_name: a pointer to a string that describes this driver in | |
155 | - * KOBJ_NAME_LEN characters or less. This is used for the sysfs interface | |
156 | - * to describe the driver. | |
157 | 154 | * @id_table: pointer to a list of usb_device_id structures that define all |
158 | 155 | * of the devices this structure can support. |
159 | 156 | * @num_interrupt_in: the number of interrupt in endpoints this device will |
160 | 157 | |
... | ... | @@ -187,11 +184,12 @@ |
187 | 184 | * called, the generic serial function will be used instead. |
188 | 185 | * |
189 | 186 | * The driver.owner field should be set to the module owner of this driver. |
190 | - * | |
187 | + * The driver.name field should be set to the name of this driver (remember | |
188 | + * it will show up in sysfs, so it needs to be short and to the point. | |
189 | + * Useing the module name is a good idea.) | |
191 | 190 | */ |
192 | 191 | struct usb_serial_driver { |
193 | - char *name; | |
194 | - char *short_name; | |
192 | + const char *description; | |
195 | 193 | const struct usb_device_id *id_table; |
196 | 194 | char num_interrupt_in; |
197 | 195 | char num_interrupt_out; |
drivers/usb/serial/visor.c
... | ... | @@ -185,9 +185,9 @@ |
185 | 185 | static struct usb_serial_driver handspring_device = { |
186 | 186 | .driver = { |
187 | 187 | .owner = THIS_MODULE, |
188 | + .name = "visor", | |
188 | 189 | }, |
189 | - .name = "Handspring Visor / Palm OS", | |
190 | - .short_name = "visor", | |
190 | + .description = "Handspring Visor / Palm OS", | |
191 | 191 | .id_table = id_table, |
192 | 192 | .num_interrupt_in = NUM_DONT_CARE, |
193 | 193 | .num_bulk_in = 2, |
194 | 194 | |
... | ... | @@ -215,9 +215,9 @@ |
215 | 215 | static struct usb_serial_driver clie_5_device = { |
216 | 216 | .driver = { |
217 | 217 | .owner = THIS_MODULE, |
218 | + .name = "clie_5", | |
218 | 219 | }, |
219 | - .name = "Sony Clie 5.0", | |
220 | - .short_name = "clie_5", | |
220 | + .description = "Sony Clie 5.0", | |
221 | 221 | .id_table = clie_id_5_table, |
222 | 222 | .num_interrupt_in = NUM_DONT_CARE, |
223 | 223 | .num_bulk_in = 2, |
224 | 224 | |
... | ... | @@ -245,9 +245,9 @@ |
245 | 245 | static struct usb_serial_driver clie_3_5_device = { |
246 | 246 | .driver = { |
247 | 247 | .owner = THIS_MODULE, |
248 | + .name = "clie_3.5", | |
248 | 249 | }, |
249 | - .name = "Sony Clie 3.5", | |
250 | - .short_name = "clie_3.5", | |
250 | + .description = "Sony Clie 3.5", | |
251 | 251 | .id_table = clie_id_3_5_table, |
252 | 252 | .num_interrupt_in = 0, |
253 | 253 | .num_bulk_in = 1, |
... | ... | @@ -659,7 +659,7 @@ |
659 | 659 | break; |
660 | 660 | } |
661 | 661 | dev_info(dev, "%s: port %d, is for %s use\n", |
662 | - serial->type->name, | |
662 | + serial->type->description, | |
663 | 663 | connection_info->connections[i].port, string); |
664 | 664 | } |
665 | 665 | } |
666 | 666 | |
... | ... | @@ -668,11 +668,11 @@ |
668 | 668 | */ |
669 | 669 | if (num_ports == 0 || num_ports > 2) { |
670 | 670 | dev_warn (dev, "%s: No valid connect info available\n", |
671 | - serial->type->name); | |
671 | + serial->type->description); | |
672 | 672 | num_ports = 2; |
673 | 673 | } |
674 | 674 | |
675 | - dev_info(dev, "%s: Number of ports: %d\n", serial->type->name, | |
675 | + dev_info(dev, "%s: Number of ports: %d\n", serial->type->description, | |
676 | 676 | num_ports); |
677 | 677 | |
678 | 678 | /* |
drivers/usb/serial/whiteheat.c
... | ... | @@ -159,9 +159,9 @@ |
159 | 159 | static struct usb_serial_driver whiteheat_fake_device = { |
160 | 160 | .driver = { |
161 | 161 | .owner = THIS_MODULE, |
162 | + .name = "whiteheatnofirm", | |
162 | 163 | }, |
163 | - .name = "Connect Tech - WhiteHEAT - (prerenumeration)", | |
164 | - .short_name = "whiteheatnofirm", | |
164 | + .description = "Connect Tech - WhiteHEAT - (prerenumeration)", | |
165 | 165 | .id_table = id_table_prerenumeration, |
166 | 166 | .num_interrupt_in = NUM_DONT_CARE, |
167 | 167 | .num_bulk_in = NUM_DONT_CARE, |
168 | 168 | |
... | ... | @@ -174,9 +174,9 @@ |
174 | 174 | static struct usb_serial_driver whiteheat_device = { |
175 | 175 | .driver = { |
176 | 176 | .owner = THIS_MODULE, |
177 | + .name = "whiteheat", | |
177 | 178 | }, |
178 | - .name = "Connect Tech - WhiteHEAT", | |
179 | - .short_name = "whiteheat", | |
179 | + .description = "Connect Tech - WhiteHEAT", | |
180 | 180 | .id_table = id_table_std, |
181 | 181 | .num_interrupt_in = NUM_DONT_CARE, |
182 | 182 | .num_bulk_in = NUM_DONT_CARE, |
183 | 183 | |
... | ... | @@ -386,10 +386,10 @@ |
386 | 386 | usb_clear_halt(serial->dev, pipe); |
387 | 387 | ret = usb_bulk_msg (serial->dev, pipe, command, 2, &alen, COMMAND_TIMEOUT_MS); |
388 | 388 | if (ret) { |
389 | - err("%s: Couldn't send command [%d]", serial->type->name, ret); | |
389 | + err("%s: Couldn't send command [%d]", serial->type->description, ret); | |
390 | 390 | goto no_firmware; |
391 | 391 | } else if (alen != sizeof(command)) { |
392 | - err("%s: Send command incomplete [%d]", serial->type->name, alen); | |
392 | + err("%s: Send command incomplete [%d]", serial->type->description, alen); | |
393 | 393 | goto no_firmware; |
394 | 394 | } |
395 | 395 | |
396 | 396 | |
397 | 397 | |
398 | 398 | |
... | ... | @@ -398,19 +398,19 @@ |
398 | 398 | usb_clear_halt(serial->dev, pipe); |
399 | 399 | ret = usb_bulk_msg (serial->dev, pipe, result, sizeof(*hw_info) + 1, &alen, COMMAND_TIMEOUT_MS); |
400 | 400 | if (ret) { |
401 | - err("%s: Couldn't get results [%d]", serial->type->name, ret); | |
401 | + err("%s: Couldn't get results [%d]", serial->type->description, ret); | |
402 | 402 | goto no_firmware; |
403 | 403 | } else if (alen != sizeof(result)) { |
404 | - err("%s: Get results incomplete [%d]", serial->type->name, alen); | |
404 | + err("%s: Get results incomplete [%d]", serial->type->description, alen); | |
405 | 405 | goto no_firmware; |
406 | 406 | } else if (result[0] != command[0]) { |
407 | - err("%s: Command failed [%d]", serial->type->name, result[0]); | |
407 | + err("%s: Command failed [%d]", serial->type->description, result[0]); | |
408 | 408 | goto no_firmware; |
409 | 409 | } |
410 | 410 | |
411 | 411 | hw_info = (struct whiteheat_hw_info *)&result[1]; |
412 | 412 | |
413 | - info("%s: Driver %s: Firmware v%d.%02d", serial->type->name, | |
413 | + info("%s: Driver %s: Firmware v%d.%02d", serial->type->description, | |
414 | 414 | DRIVER_VERSION, hw_info->sw_major_rev, hw_info->sw_minor_rev); |
415 | 415 | |
416 | 416 | for (i = 0; i < serial->num_ports; i++) { |
... | ... | @@ -418,7 +418,7 @@ |
418 | 418 | |
419 | 419 | info = (struct whiteheat_private *)kmalloc(sizeof(struct whiteheat_private), GFP_KERNEL); |
420 | 420 | if (info == NULL) { |
421 | - err("%s: Out of memory for port structures\n", serial->type->name); | |
421 | + err("%s: Out of memory for port structures\n", serial->type->description); | |
422 | 422 | goto no_private; |
423 | 423 | } |
424 | 424 | |
... | ... | @@ -488,7 +488,7 @@ |
488 | 488 | |
489 | 489 | command_info = (struct whiteheat_command_private *)kmalloc(sizeof(struct whiteheat_command_private), GFP_KERNEL); |
490 | 490 | if (command_info == NULL) { |
491 | - err("%s: Out of memory for port structures\n", serial->type->name); | |
491 | + err("%s: Out of memory for port structures\n", serial->type->description); | |
492 | 492 | goto no_command_private; |
493 | 493 | } |
494 | 494 | |
... | ... | @@ -505,9 +505,9 @@ |
505 | 505 | |
506 | 506 | no_firmware: |
507 | 507 | /* Firmware likely not running */ |
508 | - err("%s: Unable to retrieve firmware version, try replugging\n", serial->type->name); | |
509 | - err("%s: If the firmware is not running (status led not blinking)\n", serial->type->name); | |
510 | - err("%s: please contact support@connecttech.com\n", serial->type->name); | |
508 | + err("%s: Unable to retrieve firmware version, try replugging\n", serial->type->description); | |
509 | + err("%s: If the firmware is not running (status led not blinking)\n", serial->type->description); | |
510 | + err("%s: please contact support@connecttech.com\n", serial->type->description); | |
511 | 511 | return -ENODEV; |
512 | 512 | |
513 | 513 | no_command_private: |