aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/atm/usbatm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/atm/usbatm.c')
-rw-r--r--drivers/usb/atm/usbatm.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c
index d3e2c5f90a26..b3f779f5933a 100644
--- a/drivers/usb/atm/usbatm.c
+++ b/drivers/usb/atm/usbatm.c
@@ -274,6 +274,9 @@ static void usbatm_complete(struct urb *urb)
274 (!(channel->usbatm->flags & UDSL_IGNORE_EILSEQ) || 274 (!(channel->usbatm->flags & UDSL_IGNORE_EILSEQ) ||
275 urb->status != -EILSEQ )) 275 urb->status != -EILSEQ ))
276 { 276 {
277 if (urb->status == -ESHUTDOWN)
278 return;
279
277 if (printk_ratelimit()) 280 if (printk_ratelimit())
278 atm_warn(channel->usbatm, "%s: urb 0x%p failed (%d)!\n", 281 atm_warn(channel->usbatm, "%s: urb 0x%p failed (%d)!\n",
279 __func__, urb, urb->status); 282 __func__, urb, urb->status);
@@ -968,6 +971,14 @@ static int usbatm_atm_init(struct usbatm_data *instance)
968 /* temp init ATM device, set to 128kbit */ 971 /* temp init ATM device, set to 128kbit */
969 atm_dev->link_rate = 128 * 1000 / 424; 972 atm_dev->link_rate = 128 * 1000 / 424;
970 973
974 ret = sysfs_create_link(&atm_dev->class_dev.kobj,
975 &instance->usb_intf->dev.kobj, "device");
976 if (ret) {
977 atm_err(instance, "%s: sysfs_create_link failed: %d\n",
978 __func__, ret);
979 goto fail_sysfs;
980 }
981
971 if (instance->driver->atm_start && ((ret = instance->driver->atm_start(instance, atm_dev)) < 0)) { 982 if (instance->driver->atm_start && ((ret = instance->driver->atm_start(instance, atm_dev)) < 0)) {
972 atm_err(instance, "%s: atm_start failed: %d!\n", __func__, ret); 983 atm_err(instance, "%s: atm_start failed: %d!\n", __func__, ret);
973 goto fail; 984 goto fail;
@@ -986,6 +997,8 @@ static int usbatm_atm_init(struct usbatm_data *instance)
986 return 0; 997 return 0;
987 998
988 fail: 999 fail:
1000 sysfs_remove_link(&atm_dev->class_dev.kobj, "device");
1001 fail_sysfs:
989 instance->atm_dev = NULL; 1002 instance->atm_dev = NULL;
990 atm_dev_deregister(atm_dev); /* usbatm_atm_dev_close will eventually be called */ 1003 atm_dev_deregister(atm_dev); /* usbatm_atm_dev_close will eventually be called */
991 return ret; 1004 return ret;
@@ -1318,8 +1331,10 @@ void usbatm_usb_disconnect(struct usb_interface *intf)
1318 kfree(instance->cell_buf); 1331 kfree(instance->cell_buf);
1319 1332
1320 /* ATM finalize */ 1333 /* ATM finalize */
1321 if (instance->atm_dev) 1334 if (instance->atm_dev) {
1335 sysfs_remove_link(&instance->atm_dev->class_dev.kobj, "device");
1322 atm_dev_deregister(instance->atm_dev); 1336 atm_dev_deregister(instance->atm_dev);
1337 }
1323 1338
1324 usbatm_put_instance(instance); /* taken in usbatm_usb_probe */ 1339 usbatm_put_instance(instance); /* taken in usbatm_usb_probe */
1325} 1340}