diff options
Diffstat (limited to 'drivers/usb/atm/ueagle-atm.c')
-rw-r--r-- | drivers/usb/atm/ueagle-atm.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c index ea071a5b6eee..99ac70e32556 100644 --- a/drivers/usb/atm/ueagle-atm.c +++ b/drivers/usb/atm/ueagle-atm.c | |||
@@ -2206,8 +2206,11 @@ static int uea_boot(struct uea_softc *sc) | |||
2206 | goto err1; | 2206 | goto err1; |
2207 | } | 2207 | } |
2208 | 2208 | ||
2209 | sc->kthread = kthread_run(uea_kthread, sc, "ueagle-atm"); | 2209 | /* Create worker thread, but don't start it here. Start it after |
2210 | if (sc->kthread == ERR_PTR(-ENOMEM)) { | 2210 | * all usbatm generic initialization is done. |
2211 | */ | ||
2212 | sc->kthread = kthread_create(uea_kthread, sc, "ueagle-atm"); | ||
2213 | if (IS_ERR(sc->kthread)) { | ||
2211 | uea_err(INS_TO_USBDEV(sc), "failed to create thread\n"); | 2214 | uea_err(INS_TO_USBDEV(sc), "failed to create thread\n"); |
2212 | goto err2; | 2215 | goto err2; |
2213 | } | 2216 | } |
@@ -2301,7 +2304,7 @@ out: | |||
2301 | return ret; | 2304 | return ret; |
2302 | } | 2305 | } |
2303 | 2306 | ||
2304 | static DEVICE_ATTR(stat_status, S_IWUGO | S_IRUGO, read_status, reboot); | 2307 | static DEVICE_ATTR(stat_status, S_IWUSR | S_IRUGO, read_status, reboot); |
2305 | 2308 | ||
2306 | static ssize_t read_human_status(struct device *dev, | 2309 | static ssize_t read_human_status(struct device *dev, |
2307 | struct device_attribute *attr, char *buf) | 2310 | struct device_attribute *attr, char *buf) |
@@ -2364,8 +2367,7 @@ out: | |||
2364 | return ret; | 2367 | return ret; |
2365 | } | 2368 | } |
2366 | 2369 | ||
2367 | static DEVICE_ATTR(stat_human_status, S_IWUGO | S_IRUGO, | 2370 | static DEVICE_ATTR(stat_human_status, S_IRUGO, read_human_status, NULL); |
2368 | read_human_status, NULL); | ||
2369 | 2371 | ||
2370 | static ssize_t read_delin(struct device *dev, struct device_attribute *attr, | 2372 | static ssize_t read_delin(struct device *dev, struct device_attribute *attr, |
2371 | char *buf) | 2373 | char *buf) |
@@ -2397,7 +2399,7 @@ out: | |||
2397 | return ret; | 2399 | return ret; |
2398 | } | 2400 | } |
2399 | 2401 | ||
2400 | static DEVICE_ATTR(stat_delin, S_IWUGO | S_IRUGO, read_delin, NULL); | 2402 | static DEVICE_ATTR(stat_delin, S_IRUGO, read_delin, NULL); |
2401 | 2403 | ||
2402 | #define UEA_ATTR(name, reset) \ | 2404 | #define UEA_ATTR(name, reset) \ |
2403 | \ | 2405 | \ |
@@ -2625,6 +2627,7 @@ static struct usbatm_driver uea_usbatm_driver = { | |||
2625 | static int uea_probe(struct usb_interface *intf, const struct usb_device_id *id) | 2627 | static int uea_probe(struct usb_interface *intf, const struct usb_device_id *id) |
2626 | { | 2628 | { |
2627 | struct usb_device *usb = interface_to_usbdev(intf); | 2629 | struct usb_device *usb = interface_to_usbdev(intf); |
2630 | int ret; | ||
2628 | 2631 | ||
2629 | uea_enters(usb); | 2632 | uea_enters(usb); |
2630 | uea_info(usb, "ADSL device founded vid (%#X) pid (%#X) Rev (%#X): %s\n", | 2633 | uea_info(usb, "ADSL device founded vid (%#X) pid (%#X) Rev (%#X): %s\n", |
@@ -2638,7 +2641,19 @@ static int uea_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
2638 | if (UEA_IS_PREFIRM(id)) | 2641 | if (UEA_IS_PREFIRM(id)) |
2639 | return uea_load_firmware(usb, UEA_CHIP_VERSION(id)); | 2642 | return uea_load_firmware(usb, UEA_CHIP_VERSION(id)); |
2640 | 2643 | ||
2641 | return usbatm_usb_probe(intf, id, &uea_usbatm_driver); | 2644 | ret = usbatm_usb_probe(intf, id, &uea_usbatm_driver); |
2645 | if (ret == 0) { | ||
2646 | struct usbatm_data *usbatm = usb_get_intfdata(intf); | ||
2647 | struct uea_softc *sc = usbatm->driver_data; | ||
2648 | |||
2649 | /* Ensure carrier is initialized to off as early as possible */ | ||
2650 | UPDATE_ATM_SIGNAL(ATM_PHY_SIG_LOST); | ||
2651 | |||
2652 | /* Only start the worker thread when all init is done */ | ||
2653 | wake_up_process(sc->kthread); | ||
2654 | } | ||
2655 | |||
2656 | return ret; | ||
2642 | } | 2657 | } |
2643 | 2658 | ||
2644 | static void uea_disconnect(struct usb_interface *intf) | 2659 | static void uea_disconnect(struct usb_interface *intf) |