aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/uwb/lc-dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/uwb/lc-dev.c')
-rw-r--r--drivers/uwb/lc-dev.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/uwb/lc-dev.c b/drivers/uwb/lc-dev.c
index 80079b8fed15..d0303f0dbe15 100644
--- a/drivers/uwb/lc-dev.c
+++ b/drivers/uwb/lc-dev.c
@@ -431,16 +431,19 @@ void uwbd_dev_onair(struct uwb_rc *rc, struct uwb_beca_e *bce)
431 uwb_dev->mac_addr = *bce->mac_addr; 431 uwb_dev->mac_addr = *bce->mac_addr;
432 uwb_dev->dev_addr = bce->dev_addr; 432 uwb_dev->dev_addr = bce->dev_addr;
433 dev_set_name(&uwb_dev->dev, "%s", macbuf); 433 dev_set_name(&uwb_dev->dev, "%s", macbuf);
434
435 /* plug the beacon cache */
436 bce->uwb_dev = uwb_dev;
437 uwb_dev->bce = bce;
438 uwb_bce_get(bce); /* released in uwb_dev_sys_release() */
439
434 result = uwb_dev_add(uwb_dev, &rc->uwb_dev.dev, rc); 440 result = uwb_dev_add(uwb_dev, &rc->uwb_dev.dev, rc);
435 if (result < 0) { 441 if (result < 0) {
436 dev_err(dev, "new device %s: cannot instantiate device\n", 442 dev_err(dev, "new device %s: cannot instantiate device\n",
437 macbuf); 443 macbuf);
438 goto error_dev_add; 444 goto error_dev_add;
439 } 445 }
440 /* plug the beacon cache */ 446
441 bce->uwb_dev = uwb_dev;
442 uwb_dev->bce = bce;
443 uwb_bce_get(bce); /* released in uwb_dev_sys_release() */
444 dev_info(dev, "uwb device (mac %s dev %s) connected to %s %s\n", 447 dev_info(dev, "uwb device (mac %s dev %s) connected to %s %s\n",
445 macbuf, devbuf, rc->uwb_dev.dev.parent->bus->name, 448 macbuf, devbuf, rc->uwb_dev.dev.parent->bus->name,
446 dev_name(rc->uwb_dev.dev.parent)); 449 dev_name(rc->uwb_dev.dev.parent));
@@ -448,6 +451,8 @@ void uwbd_dev_onair(struct uwb_rc *rc, struct uwb_beca_e *bce)
448 return; 451 return;
449 452
450error_dev_add: 453error_dev_add:
454 bce->uwb_dev = NULL;
455 uwb_bce_put(bce);
451 kfree(uwb_dev); 456 kfree(uwb_dev);
452 return; 457 return;
453} 458}