diff options
Diffstat (limited to 'drivers/usb/serial/io_edgeport.c')
-rw-r--r-- | drivers/usb/serial/io_edgeport.c | 66 |
1 files changed, 5 insertions, 61 deletions
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c index 0497575e4799..323e87235711 100644 --- a/drivers/usb/serial/io_edgeport.c +++ b/drivers/usb/serial/io_edgeport.c | |||
@@ -193,7 +193,8 @@ static const struct divisor_table_entry divisor_table[] = { | |||
193 | /* local variables */ | 193 | /* local variables */ |
194 | static bool debug; | 194 | static bool debug; |
195 | 195 | ||
196 | static atomic_t CmdUrbs; /* Number of outstanding Command Write Urbs */ | 196 | /* Number of outstanding Command Write Urbs */ |
197 | static atomic_t CmdUrbs = ATOMIC_INIT(0); | ||
197 | 198 | ||
198 | 199 | ||
199 | /* local function prototypes */ | 200 | /* local function prototypes */ |
@@ -1286,7 +1287,7 @@ static void send_more_port_data(struct edgeport_serial *edge_serial, | |||
1286 | count = fifo->count; | 1287 | count = fifo->count; |
1287 | buffer = kmalloc(count+2, GFP_ATOMIC); | 1288 | buffer = kmalloc(count+2, GFP_ATOMIC); |
1288 | if (buffer == NULL) { | 1289 | if (buffer == NULL) { |
1289 | dev_err(&edge_port->port->dev, | 1290 | dev_err_console(edge_port->port, |
1290 | "%s - no more kernel memory...\n", __func__); | 1291 | "%s - no more kernel memory...\n", __func__); |
1291 | edge_port->write_in_progress = false; | 1292 | edge_port->write_in_progress = false; |
1292 | goto exit_send; | 1293 | goto exit_send; |
@@ -1331,7 +1332,7 @@ static void send_more_port_data(struct edgeport_serial *edge_serial, | |||
1331 | status = usb_submit_urb(urb, GFP_ATOMIC); | 1332 | status = usb_submit_urb(urb, GFP_ATOMIC); |
1332 | if (status) { | 1333 | if (status) { |
1333 | /* something went wrong */ | 1334 | /* something went wrong */ |
1334 | dev_err(&edge_port->port->dev, | 1335 | dev_err_console(edge_port->port, |
1335 | "%s - usb_submit_urb(write bulk) failed, status = %d, data lost\n", | 1336 | "%s - usb_submit_urb(write bulk) failed, status = %d, data lost\n", |
1336 | __func__, status); | 1337 | __func__, status); |
1337 | edge_port->write_in_progress = false; | 1338 | edge_port->write_in_progress = false; |
@@ -3180,65 +3181,8 @@ static void edge_release(struct usb_serial *serial) | |||
3180 | kfree(edge_serial); | 3181 | kfree(edge_serial); |
3181 | } | 3182 | } |
3182 | 3183 | ||
3184 | module_usb_serial_driver(io_driver, serial_drivers); | ||
3183 | 3185 | ||
3184 | /**************************************************************************** | ||
3185 | * edgeport_init | ||
3186 | * This is called by the module subsystem, or on startup to initialize us | ||
3187 | ****************************************************************************/ | ||
3188 | static int __init edgeport_init(void) | ||
3189 | { | ||
3190 | int retval; | ||
3191 | |||
3192 | retval = usb_serial_register(&edgeport_2port_device); | ||
3193 | if (retval) | ||
3194 | goto failed_2port_device_register; | ||
3195 | retval = usb_serial_register(&edgeport_4port_device); | ||
3196 | if (retval) | ||
3197 | goto failed_4port_device_register; | ||
3198 | retval = usb_serial_register(&edgeport_8port_device); | ||
3199 | if (retval) | ||
3200 | goto failed_8port_device_register; | ||
3201 | retval = usb_serial_register(&epic_device); | ||
3202 | if (retval) | ||
3203 | goto failed_epic_device_register; | ||
3204 | retval = usb_register(&io_driver); | ||
3205 | if (retval) | ||
3206 | goto failed_usb_register; | ||
3207 | atomic_set(&CmdUrbs, 0); | ||
3208 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
3209 | DRIVER_DESC "\n"); | ||
3210 | return 0; | ||
3211 | |||
3212 | failed_usb_register: | ||
3213 | usb_serial_deregister(&epic_device); | ||
3214 | failed_epic_device_register: | ||
3215 | usb_serial_deregister(&edgeport_8port_device); | ||
3216 | failed_8port_device_register: | ||
3217 | usb_serial_deregister(&edgeport_4port_device); | ||
3218 | failed_4port_device_register: | ||
3219 | usb_serial_deregister(&edgeport_2port_device); | ||
3220 | failed_2port_device_register: | ||
3221 | return retval; | ||
3222 | } | ||
3223 | |||
3224 | |||
3225 | /**************************************************************************** | ||
3226 | * edgeport_exit | ||
3227 | * Called when the driver is about to be unloaded. | ||
3228 | ****************************************************************************/ | ||
3229 | static void __exit edgeport_exit (void) | ||
3230 | { | ||
3231 | usb_deregister(&io_driver); | ||
3232 | usb_serial_deregister(&edgeport_2port_device); | ||
3233 | usb_serial_deregister(&edgeport_4port_device); | ||
3234 | usb_serial_deregister(&edgeport_8port_device); | ||
3235 | usb_serial_deregister(&epic_device); | ||
3236 | } | ||
3237 | |||
3238 | module_init(edgeport_init); | ||
3239 | module_exit(edgeport_exit); | ||
3240 | |||
3241 | /* Module information */ | ||
3242 | MODULE_AUTHOR(DRIVER_AUTHOR); | 3186 | MODULE_AUTHOR(DRIVER_AUTHOR); |
3243 | MODULE_DESCRIPTION(DRIVER_DESC); | 3187 | MODULE_DESCRIPTION(DRIVER_DESC); |
3244 | MODULE_LICENSE("GPL"); | 3188 | MODULE_LICENSE("GPL"); |