diff options
Diffstat (limited to 'drivers/isdn/gigaset/bas-gigaset.c')
-rw-r--r-- | drivers/isdn/gigaset/bas-gigaset.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c index 580831d9dba1..1cf48cfad1de 100644 --- a/drivers/isdn/gigaset/bas-gigaset.c +++ b/drivers/isdn/gigaset/bas-gigaset.c | |||
@@ -2217,7 +2217,7 @@ static int gigaset_probe(struct usb_interface *interface, | |||
2217 | usb_get_dev(udev); | 2217 | usb_get_dev(udev); |
2218 | ucs->udev = udev; | 2218 | ucs->udev = udev; |
2219 | ucs->interface = interface; | 2219 | ucs->interface = interface; |
2220 | cs->dev = &udev->dev; | 2220 | cs->dev = &interface->dev; |
2221 | 2221 | ||
2222 | /* allocate URBs: | 2222 | /* allocate URBs: |
2223 | * - one for the interrupt pipe | 2223 | * - one for the interrupt pipe |
@@ -2289,14 +2289,13 @@ static int gigaset_probe(struct usb_interface *interface, | |||
2289 | /* tell common part that the device is ready */ | 2289 | /* tell common part that the device is ready */ |
2290 | if (startmode == SM_LOCKED) | 2290 | if (startmode == SM_LOCKED) |
2291 | atomic_set(&cs->mstate, MS_LOCKED); | 2291 | atomic_set(&cs->mstate, MS_LOCKED); |
2292 | if (!gigaset_start(cs)) | ||
2293 | goto error; | ||
2294 | 2292 | ||
2295 | /* save address of controller structure */ | 2293 | /* save address of controller structure */ |
2296 | usb_set_intfdata(interface, cs); | 2294 | usb_set_intfdata(interface, cs); |
2297 | 2295 | ||
2298 | /* set up device sysfs */ | 2296 | if (!gigaset_start(cs)) |
2299 | gigaset_init_dev_sysfs(interface); | 2297 | goto error; |
2298 | |||
2300 | return 0; | 2299 | return 0; |
2301 | 2300 | ||
2302 | error: | 2301 | error: |
@@ -2313,23 +2312,24 @@ static void gigaset_disconnect(struct usb_interface *interface) | |||
2313 | struct cardstate *cs; | 2312 | struct cardstate *cs; |
2314 | struct bas_cardstate *ucs; | 2313 | struct bas_cardstate *ucs; |
2315 | 2314 | ||
2316 | /* clear device sysfs */ | ||
2317 | gigaset_free_dev_sysfs(interface); | ||
2318 | |||
2319 | cs = usb_get_intfdata(interface); | 2315 | cs = usb_get_intfdata(interface); |
2320 | usb_set_intfdata(interface, NULL); | ||
2321 | 2316 | ||
2322 | IFNULLRET(cs); | 2317 | IFNULLRET(cs); |
2323 | ucs = cs->hw.bas; | 2318 | ucs = cs->hw.bas; |
2324 | IFNULLRET(ucs); | 2319 | IFNULLRET(ucs); |
2325 | 2320 | ||
2326 | dev_info(cs->dev, "disconnecting GigaSet base"); | 2321 | dev_info(cs->dev, "disconnecting Gigaset base\n"); |
2327 | gigaset_stop(cs); | 2322 | gigaset_stop(cs); |
2328 | freeurbs(cs); | 2323 | freeurbs(cs); |
2324 | usb_set_intfdata(interface, NULL); | ||
2329 | kfree(ucs->rcvbuf); | 2325 | kfree(ucs->rcvbuf); |
2330 | ucs->rcvbuf = NULL; | 2326 | ucs->rcvbuf = NULL; |
2331 | ucs->rcvbuf_size = 0; | 2327 | ucs->rcvbuf_size = 0; |
2332 | atomic_set(&ucs->basstate, 0); | 2328 | atomic_set(&ucs->basstate, 0); |
2329 | usb_put_dev(ucs->udev); | ||
2330 | ucs->interface = NULL; | ||
2331 | ucs->udev = NULL; | ||
2332 | cs->dev = NULL; | ||
2333 | gigaset_unassign(cs); | 2333 | gigaset_unassign(cs); |
2334 | } | 2334 | } |
2335 | 2335 | ||