aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/atm
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/usb/atm
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'drivers/usb/atm')
-rw-r--r--drivers/usb/atm/Makefile6
-rw-r--r--drivers/usb/atm/cxacru.c20
-rw-r--r--drivers/usb/atm/speedtch.c28
-rw-r--r--drivers/usb/atm/ueagle-atm.c56
-rw-r--r--drivers/usb/atm/usbatm.c15
5 files changed, 69 insertions, 56 deletions
diff --git a/drivers/usb/atm/Makefile b/drivers/usb/atm/Makefile
index 4c4a776ab1cd..a5d792ec3ad5 100644
--- a/drivers/usb/atm/Makefile
+++ b/drivers/usb/atm/Makefile
@@ -2,12 +2,10 @@
2# Makefile for USB ATM/xDSL drivers 2# Makefile for USB ATM/xDSL drivers
3# 3#
4 4
5ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG
6
5obj-$(CONFIG_USB_CXACRU) += cxacru.o 7obj-$(CONFIG_USB_CXACRU) += cxacru.o
6obj-$(CONFIG_USB_SPEEDTOUCH) += speedtch.o 8obj-$(CONFIG_USB_SPEEDTOUCH) += speedtch.o
7obj-$(CONFIG_USB_UEAGLEATM) += ueagle-atm.o 9obj-$(CONFIG_USB_UEAGLEATM) += ueagle-atm.o
8obj-$(CONFIG_USB_ATM) += usbatm.o 10obj-$(CONFIG_USB_ATM) += usbatm.o
9obj-$(CONFIG_USB_XUSBATM) += xusbatm.o 11obj-$(CONFIG_USB_XUSBATM) += xusbatm.o
10
11ifeq ($(CONFIG_USB_DEBUG),y)
12EXTRA_CFLAGS += -DDEBUG
13endif
diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c
index 5af23cc5ea9f..a845f8b8382f 100644
--- a/drivers/usb/atm/cxacru.c
+++ b/drivers/usb/atm/cxacru.c
@@ -1247,7 +1247,7 @@ static void cxacru_unbind(struct usbatm_data *usbatm_instance,
1247 mutex_unlock(&instance->poll_state_serialize); 1247 mutex_unlock(&instance->poll_state_serialize);
1248 1248
1249 if (is_polling) 1249 if (is_polling)
1250 cancel_rearming_delayed_work(&instance->poll_work); 1250 cancel_delayed_work_sync(&instance->poll_work);
1251 1251
1252 usb_kill_urb(instance->snd_urb); 1252 usb_kill_urb(instance->snd_urb);
1253 usb_kill_urb(instance->rcv_urb); 1253 usb_kill_urb(instance->rcv_urb);
@@ -1344,8 +1344,24 @@ static struct usbatm_driver cxacru_driver = {
1344 .tx_padding = 11, 1344 .tx_padding = 11,
1345}; 1345};
1346 1346
1347static int cxacru_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) 1347static int cxacru_usb_probe(struct usb_interface *intf,
1348 const struct usb_device_id *id)
1348{ 1349{
1350 struct usb_device *usb_dev = interface_to_usbdev(intf);
1351 char buf[15];
1352
1353 /* Avoid ADSL routers (cx82310_eth).
1354 * Abort if bDeviceClass is 0xff and iProduct is "USB NET CARD".
1355 */
1356 if (usb_dev->descriptor.bDeviceClass == USB_CLASS_VENDOR_SPEC
1357 && usb_string(usb_dev, usb_dev->descriptor.iProduct,
1358 buf, sizeof(buf)) > 0) {
1359 if (!strcmp(buf, "USB NET CARD")) {
1360 dev_info(&intf->dev, "ignoring cx82310_eth device\n");
1361 return -ENODEV;
1362 }
1363 }
1364
1349 return usbatm_usb_probe(intf, id, &cxacru_driver); 1365 return usbatm_usb_probe(intf, id, &cxacru_driver);
1350} 1366}
1351 1367
diff --git a/drivers/usb/atm/speedtch.c b/drivers/usb/atm/speedtch.c
index 4716e707de59..0842cfbf60cf 100644
--- a/drivers/usb/atm/speedtch.c
+++ b/drivers/usb/atm/speedtch.c
@@ -139,7 +139,8 @@ struct speedtch_instance_data {
139 139
140 struct speedtch_params params; /* set in probe, constant afterwards */ 140 struct speedtch_params params; /* set in probe, constant afterwards */
141 141
142 struct delayed_work status_checker; 142 struct timer_list status_check_timer;
143 struct work_struct status_check_work;
143 144
144 unsigned char last_status; 145 unsigned char last_status;
145 146
@@ -498,7 +499,7 @@ static void speedtch_check_status(struct work_struct *work)
498{ 499{
499 struct speedtch_instance_data *instance = 500 struct speedtch_instance_data *instance =
500 container_of(work, struct speedtch_instance_data, 501 container_of(work, struct speedtch_instance_data,
501 status_checker.work); 502 status_check_work);
502 struct usbatm_data *usbatm = instance->usbatm; 503 struct usbatm_data *usbatm = instance->usbatm;
503 struct atm_dev *atm_dev = usbatm->atm_dev; 504 struct atm_dev *atm_dev = usbatm->atm_dev;
504 unsigned char *buf = instance->scratch_buffer; 505 unsigned char *buf = instance->scratch_buffer;
@@ -575,11 +576,11 @@ static void speedtch_status_poll(unsigned long data)
575{ 576{
576 struct speedtch_instance_data *instance = (void *)data; 577 struct speedtch_instance_data *instance = (void *)data;
577 578
578 schedule_delayed_work(&instance->status_checker, 0); 579 schedule_work(&instance->status_check_work);
579 580
580 /* The following check is racy, but the race is harmless */ 581 /* The following check is racy, but the race is harmless */
581 if (instance->poll_delay < MAX_POLL_DELAY) 582 if (instance->poll_delay < MAX_POLL_DELAY)
582 mod_timer(&instance->status_checker.timer, jiffies + msecs_to_jiffies(instance->poll_delay)); 583 mod_timer(&instance->status_check_timer, jiffies + msecs_to_jiffies(instance->poll_delay));
583 else 584 else
584 atm_warn(instance->usbatm, "Too many failures - disabling line status polling\n"); 585 atm_warn(instance->usbatm, "Too many failures - disabling line status polling\n");
585} 586}
@@ -595,7 +596,7 @@ static void speedtch_resubmit_int(unsigned long data)
595 if (int_urb) { 596 if (int_urb) {
596 ret = usb_submit_urb(int_urb, GFP_ATOMIC); 597 ret = usb_submit_urb(int_urb, GFP_ATOMIC);
597 if (!ret) 598 if (!ret)
598 schedule_delayed_work(&instance->status_checker, 0); 599 schedule_work(&instance->status_check_work);
599 else { 600 else {
600 atm_dbg(instance->usbatm, "%s: usb_submit_urb failed with result %d\n", __func__, ret); 601 atm_dbg(instance->usbatm, "%s: usb_submit_urb failed with result %d\n", __func__, ret);
601 mod_timer(&instance->resubmit_timer, jiffies + msecs_to_jiffies(RESUBMIT_DELAY)); 602 mod_timer(&instance->resubmit_timer, jiffies + msecs_to_jiffies(RESUBMIT_DELAY));
@@ -624,7 +625,7 @@ static void speedtch_handle_int(struct urb *int_urb)
624 } 625 }
625 626
626 if ((count == 6) && !memcmp(up_int, instance->int_data, 6)) { 627 if ((count == 6) && !memcmp(up_int, instance->int_data, 6)) {
627 del_timer(&instance->status_checker.timer); 628 del_timer(&instance->status_check_timer);
628 atm_info(usbatm, "DSL line goes up\n"); 629 atm_info(usbatm, "DSL line goes up\n");
629 } else if ((count == 6) && !memcmp(down_int, instance->int_data, 6)) { 630 } else if ((count == 6) && !memcmp(down_int, instance->int_data, 6)) {
630 atm_info(usbatm, "DSL line goes down\n"); 631 atm_info(usbatm, "DSL line goes down\n");
@@ -640,7 +641,7 @@ static void speedtch_handle_int(struct urb *int_urb)
640 641
641 if ((int_urb = instance->int_urb)) { 642 if ((int_urb = instance->int_urb)) {
642 ret = usb_submit_urb(int_urb, GFP_ATOMIC); 643 ret = usb_submit_urb(int_urb, GFP_ATOMIC);
643 schedule_delayed_work(&instance->status_checker, 0); 644 schedule_work(&instance->status_check_work);
644 if (ret < 0) { 645 if (ret < 0) {
645 atm_dbg(usbatm, "%s: usb_submit_urb failed with result %d\n", __func__, ret); 646 atm_dbg(usbatm, "%s: usb_submit_urb failed with result %d\n", __func__, ret);
646 goto fail; 647 goto fail;
@@ -686,7 +687,7 @@ static int speedtch_atm_start(struct usbatm_data *usbatm, struct atm_dev *atm_de
686 } 687 }
687 688
688 /* Start status polling */ 689 /* Start status polling */
689 mod_timer(&instance->status_checker.timer, jiffies + msecs_to_jiffies(1000)); 690 mod_timer(&instance->status_check_timer, jiffies + msecs_to_jiffies(1000));
690 691
691 return 0; 692 return 0;
692} 693}
@@ -698,7 +699,7 @@ static void speedtch_atm_stop(struct usbatm_data *usbatm, struct atm_dev *atm_de
698 699
699 atm_dbg(usbatm, "%s entered\n", __func__); 700 atm_dbg(usbatm, "%s entered\n", __func__);
700 701
701 del_timer_sync(&instance->status_checker.timer); 702 del_timer_sync(&instance->status_check_timer);
702 703
703 /* 704 /*
704 * Since resubmit_timer and int_urb can schedule themselves and 705 * Since resubmit_timer and int_urb can schedule themselves and
@@ -717,7 +718,7 @@ static void speedtch_atm_stop(struct usbatm_data *usbatm, struct atm_dev *atm_de
717 del_timer_sync(&instance->resubmit_timer); 718 del_timer_sync(&instance->resubmit_timer);
718 usb_free_urb(int_urb); 719 usb_free_urb(int_urb);
719 720
720 flush_scheduled_work(); 721 flush_work_sync(&instance->status_check_work);
721} 722}
722 723
723static int speedtch_pre_reset(struct usb_interface *intf) 724static int speedtch_pre_reset(struct usb_interface *intf)
@@ -869,10 +870,11 @@ static int speedtch_bind(struct usbatm_data *usbatm,
869 870
870 usbatm->flags |= (use_isoc ? UDSL_USE_ISOC : 0); 871 usbatm->flags |= (use_isoc ? UDSL_USE_ISOC : 0);
871 872
872 INIT_DELAYED_WORK(&instance->status_checker, speedtch_check_status); 873 INIT_WORK(&instance->status_check_work, speedtch_check_status);
874 init_timer(&instance->status_check_timer);
873 875
874 instance->status_checker.timer.function = speedtch_status_poll; 876 instance->status_check_timer.function = speedtch_status_poll;
875 instance->status_checker.timer.data = (unsigned long)instance; 877 instance->status_check_timer.data = (unsigned long)instance;
876 instance->last_status = 0xff; 878 instance->last_status = 0xff;
877 instance->poll_delay = MIN_POLL_DELAY; 879 instance->poll_delay = MIN_POLL_DELAY;
878 880
diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c
index ea071a5b6eee..e71521ce3010 100644
--- a/drivers/usb/atm/ueagle-atm.c
+++ b/drivers/usb/atm/ueagle-atm.c
@@ -168,7 +168,6 @@ struct uea_softc {
168 union cmv_dsc cmv_dsc; 168 union cmv_dsc cmv_dsc;
169 169
170 struct work_struct task; 170 struct work_struct task;
171 struct workqueue_struct *work_q;
172 u16 pageno; 171 u16 pageno;
173 u16 ovl; 172 u16 ovl;
174 173
@@ -1284,7 +1283,7 @@ static void uea_set_bulk_timeout(struct uea_softc *sc, u32 dsrate)
1284 1283
1285 /* in bulk mode the modem have problem with high rate 1284 /* in bulk mode the modem have problem with high rate
1286 * changing internal timing could improve things, but the 1285 * changing internal timing could improve things, but the
1287 * value is misterious. 1286 * value is mysterious.
1288 * ADI930 don't support it (-EPIPE error). 1287 * ADI930 don't support it (-EPIPE error).
1289 */ 1288 */
1290 1289
@@ -1744,7 +1743,7 @@ static int uea_send_cmvs_e1(struct uea_softc *sc)
1744 goto out; 1743 goto out;
1745 } 1744 }
1746 } else { 1745 } else {
1747 /* This realy should not happen */ 1746 /* This really should not happen */
1748 uea_err(INS_TO_USBDEV(sc), "bad cmvs version %d\n", ver); 1747 uea_err(INS_TO_USBDEV(sc), "bad cmvs version %d\n", ver);
1749 goto out; 1748 goto out;
1750 } 1749 }
@@ -1799,7 +1798,7 @@ static int uea_send_cmvs_e4(struct uea_softc *sc)
1799 goto out; 1798 goto out;
1800 } 1799 }
1801 } else { 1800 } else {
1802 /* This realy should not happen */ 1801 /* This really should not happen */
1803 uea_err(INS_TO_USBDEV(sc), "bad cmvs version %d\n", ver); 1802 uea_err(INS_TO_USBDEV(sc), "bad cmvs version %d\n", ver);
1804 goto out; 1803 goto out;
1805 } 1804 }
@@ -1830,7 +1829,7 @@ static int uea_start_reset(struct uea_softc *sc)
1830 1829
1831 /* mask interrupt */ 1830 /* mask interrupt */
1832 sc->booting = 1; 1831 sc->booting = 1;
1833 /* We need to set this here because, a ack timeout could have occured, 1832 /* We need to set this here because, a ack timeout could have occurred,
1834 * but before we start the reboot, the ack occurs and set this to 1. 1833 * but before we start the reboot, the ack occurs and set this to 1.
1835 * So we will failed to wait Ready CMV. 1834 * So we will failed to wait Ready CMV.
1836 */ 1835 */
@@ -1879,7 +1878,7 @@ static int uea_start_reset(struct uea_softc *sc)
1879 /* start loading DSP */ 1878 /* start loading DSP */
1880 sc->pageno = 0; 1879 sc->pageno = 0;
1881 sc->ovl = 0; 1880 sc->ovl = 0;
1882 queue_work(sc->work_q, &sc->task); 1881 schedule_work(&sc->task);
1883 1882
1884 /* wait for modem ready CMV */ 1883 /* wait for modem ready CMV */
1885 ret = wait_cmv_ack(sc); 1884 ret = wait_cmv_ack(sc);
@@ -2091,14 +2090,14 @@ static void uea_schedule_load_page_e1(struct uea_softc *sc,
2091{ 2090{
2092 sc->pageno = intr->e1_bSwapPageNo; 2091 sc->pageno = intr->e1_bSwapPageNo;
2093 sc->ovl = intr->e1_bOvl >> 4 | intr->e1_bOvl << 4; 2092 sc->ovl = intr->e1_bOvl >> 4 | intr->e1_bOvl << 4;
2094 queue_work(sc->work_q, &sc->task); 2093 schedule_work(&sc->task);
2095} 2094}
2096 2095
2097static void uea_schedule_load_page_e4(struct uea_softc *sc, 2096static void uea_schedule_load_page_e4(struct uea_softc *sc,
2098 struct intr_pkt *intr) 2097 struct intr_pkt *intr)
2099{ 2098{
2100 sc->pageno = intr->e4_bSwapPageNo; 2099 sc->pageno = intr->e4_bSwapPageNo;
2101 queue_work(sc->work_q, &sc->task); 2100 schedule_work(&sc->task);
2102} 2101}
2103 2102
2104/* 2103/*
@@ -2170,13 +2169,6 @@ static int uea_boot(struct uea_softc *sc)
2170 2169
2171 init_waitqueue_head(&sc->sync_q); 2170 init_waitqueue_head(&sc->sync_q);
2172 2171
2173 sc->work_q = create_workqueue("ueagle-dsp");
2174 if (!sc->work_q) {
2175 uea_err(INS_TO_USBDEV(sc), "cannot allocate workqueue\n");
2176 uea_leaves(INS_TO_USBDEV(sc));
2177 return -ENOMEM;
2178 }
2179
2180 if (UEA_CHIP_VERSION(sc) == ADI930) 2172 if (UEA_CHIP_VERSION(sc) == ADI930)
2181 load_XILINX_firmware(sc); 2173 load_XILINX_firmware(sc);
2182 2174
@@ -2206,8 +2198,11 @@ static int uea_boot(struct uea_softc *sc)
2206 goto err1; 2198 goto err1;
2207 } 2199 }
2208 2200
2209 sc->kthread = kthread_run(uea_kthread, sc, "ueagle-atm"); 2201 /* Create worker thread, but don't start it here. Start it after
2210 if (sc->kthread == ERR_PTR(-ENOMEM)) { 2202 * all usbatm generic initialization is done.
2203 */
2204 sc->kthread = kthread_create(uea_kthread, sc, "ueagle-atm");
2205 if (IS_ERR(sc->kthread)) {
2211 uea_err(INS_TO_USBDEV(sc), "failed to create thread\n"); 2206 uea_err(INS_TO_USBDEV(sc), "failed to create thread\n");
2212 goto err2; 2207 goto err2;
2213 } 2208 }
@@ -2222,7 +2217,6 @@ err1:
2222 sc->urb_int = NULL; 2217 sc->urb_int = NULL;
2223 kfree(intr); 2218 kfree(intr);
2224err0: 2219err0:
2225 destroy_workqueue(sc->work_q);
2226 uea_leaves(INS_TO_USBDEV(sc)); 2220 uea_leaves(INS_TO_USBDEV(sc));
2227 return -ENOMEM; 2221 return -ENOMEM;
2228} 2222}
@@ -2243,8 +2237,8 @@ static void uea_stop(struct uea_softc *sc)
2243 kfree(sc->urb_int->transfer_buffer); 2237 kfree(sc->urb_int->transfer_buffer);
2244 usb_free_urb(sc->urb_int); 2238 usb_free_urb(sc->urb_int);
2245 2239
2246 /* stop any pending boot process, when no one can schedule work */ 2240 /* flush the work item, when no one can schedule it */
2247 destroy_workqueue(sc->work_q); 2241 flush_work_sync(&sc->task);
2248 2242
2249 if (sc->dsp_firm) 2243 if (sc->dsp_firm)
2250 release_firmware(sc->dsp_firm); 2244 release_firmware(sc->dsp_firm);
@@ -2301,7 +2295,7 @@ out:
2301 return ret; 2295 return ret;
2302} 2296}
2303 2297
2304static DEVICE_ATTR(stat_status, S_IWUGO | S_IRUGO, read_status, reboot); 2298static DEVICE_ATTR(stat_status, S_IWUSR | S_IRUGO, read_status, reboot);
2305 2299
2306static ssize_t read_human_status(struct device *dev, 2300static ssize_t read_human_status(struct device *dev,
2307 struct device_attribute *attr, char *buf) 2301 struct device_attribute *attr, char *buf)
@@ -2364,8 +2358,7 @@ out:
2364 return ret; 2358 return ret;
2365} 2359}
2366 2360
2367static DEVICE_ATTR(stat_human_status, S_IWUGO | S_IRUGO, 2361static DEVICE_ATTR(stat_human_status, S_IRUGO, read_human_status, NULL);
2368 read_human_status, NULL);
2369 2362
2370static ssize_t read_delin(struct device *dev, struct device_attribute *attr, 2363static ssize_t read_delin(struct device *dev, struct device_attribute *attr,
2371 char *buf) 2364 char *buf)
@@ -2397,7 +2390,7 @@ out:
2397 return ret; 2390 return ret;
2398} 2391}
2399 2392
2400static DEVICE_ATTR(stat_delin, S_IWUGO | S_IRUGO, read_delin, NULL); 2393static DEVICE_ATTR(stat_delin, S_IRUGO, read_delin, NULL);
2401 2394
2402#define UEA_ATTR(name, reset) \ 2395#define UEA_ATTR(name, reset) \
2403 \ 2396 \
@@ -2625,6 +2618,7 @@ static struct usbatm_driver uea_usbatm_driver = {
2625static int uea_probe(struct usb_interface *intf, const struct usb_device_id *id) 2618static int uea_probe(struct usb_interface *intf, const struct usb_device_id *id)
2626{ 2619{
2627 struct usb_device *usb = interface_to_usbdev(intf); 2620 struct usb_device *usb = interface_to_usbdev(intf);
2621 int ret;
2628 2622
2629 uea_enters(usb); 2623 uea_enters(usb);
2630 uea_info(usb, "ADSL device founded vid (%#X) pid (%#X) Rev (%#X): %s\n", 2624 uea_info(usb, "ADSL device founded vid (%#X) pid (%#X) Rev (%#X): %s\n",
@@ -2638,7 +2632,19 @@ static int uea_probe(struct usb_interface *intf, const struct usb_device_id *id)
2638 if (UEA_IS_PREFIRM(id)) 2632 if (UEA_IS_PREFIRM(id))
2639 return uea_load_firmware(usb, UEA_CHIP_VERSION(id)); 2633 return uea_load_firmware(usb, UEA_CHIP_VERSION(id));
2640 2634
2641 return usbatm_usb_probe(intf, id, &uea_usbatm_driver); 2635 ret = usbatm_usb_probe(intf, id, &uea_usbatm_driver);
2636 if (ret == 0) {
2637 struct usbatm_data *usbatm = usb_get_intfdata(intf);
2638 struct uea_softc *sc = usbatm->driver_data;
2639
2640 /* Ensure carrier is initialized to off as early as possible */
2641 UPDATE_ATM_SIGNAL(ATM_PHY_SIG_LOST);
2642
2643 /* Only start the worker thread when all init is done */
2644 wake_up_process(sc->kthread);
2645 }
2646
2647 return ret;
2642} 2648}
2643 2649
2644static void uea_disconnect(struct usb_interface *intf) 2650static void uea_disconnect(struct usb_interface *intf)
diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c
index 05bf5a27b5b0..989e16e4ab5c 100644
--- a/drivers/usb/atm/usbatm.c
+++ b/drivers/usb/atm/usbatm.c
@@ -951,7 +951,9 @@ static int usbatm_atm_init(struct usbatm_data *instance)
951 * condition: callbacks we register can be executed at once, before we have 951 * condition: callbacks we register can be executed at once, before we have
952 * initialized the struct atm_dev. To protect against this, all callbacks 952 * initialized the struct atm_dev. To protect against this, all callbacks
953 * abort if atm_dev->dev_data is NULL. */ 953 * abort if atm_dev->dev_data is NULL. */
954 atm_dev = atm_dev_register(instance->driver_name, &usbatm_atm_devops, -1, NULL); 954 atm_dev = atm_dev_register(instance->driver_name,
955 &instance->usb_intf->dev, &usbatm_atm_devops,
956 -1, NULL);
955 if (!atm_dev) { 957 if (!atm_dev) {
956 usb_err(instance, "%s: failed to register ATM device!\n", __func__); 958 usb_err(instance, "%s: failed to register ATM device!\n", __func__);
957 return -1; 959 return -1;
@@ -966,14 +968,6 @@ static int usbatm_atm_init(struct usbatm_data *instance)
966 /* temp init ATM device, set to 128kbit */ 968 /* temp init ATM device, set to 128kbit */
967 atm_dev->link_rate = 128 * 1000 / 424; 969 atm_dev->link_rate = 128 * 1000 / 424;
968 970
969 ret = sysfs_create_link(&atm_dev->class_dev.kobj,
970 &instance->usb_intf->dev.kobj, "device");
971 if (ret) {
972 atm_err(instance, "%s: sysfs_create_link failed: %d\n",
973 __func__, ret);
974 goto fail_sysfs;
975 }
976
977 if (instance->driver->atm_start && ((ret = instance->driver->atm_start(instance, atm_dev)) < 0)) { 971 if (instance->driver->atm_start && ((ret = instance->driver->atm_start(instance, atm_dev)) < 0)) {
978 atm_err(instance, "%s: atm_start failed: %d!\n", __func__, ret); 972 atm_err(instance, "%s: atm_start failed: %d!\n", __func__, ret);
979 goto fail; 973 goto fail;
@@ -992,8 +986,6 @@ static int usbatm_atm_init(struct usbatm_data *instance)
992 return 0; 986 return 0;
993 987
994 fail: 988 fail:
995 sysfs_remove_link(&atm_dev->class_dev.kobj, "device");
996 fail_sysfs:
997 instance->atm_dev = NULL; 989 instance->atm_dev = NULL;
998 atm_dev_deregister(atm_dev); /* usbatm_atm_dev_close will eventually be called */ 990 atm_dev_deregister(atm_dev); /* usbatm_atm_dev_close will eventually be called */
999 return ret; 991 return ret;
@@ -1329,7 +1321,6 @@ void usbatm_usb_disconnect(struct usb_interface *intf)
1329 1321
1330 /* ATM finalize */ 1322 /* ATM finalize */
1331 if (instance->atm_dev) { 1323 if (instance->atm_dev) {
1332 sysfs_remove_link(&instance->atm_dev->class_dev.kobj, "device");
1333 atm_dev_deregister(instance->atm_dev); 1324 atm_dev_deregister(instance->atm_dev);
1334 instance->atm_dev = NULL; 1325 instance->atm_dev = NULL;
1335 } 1326 }