diff options
Diffstat (limited to 'drivers/uwb')
-rw-r--r-- | drivers/uwb/pal.c | 2 | ||||
-rw-r--r-- | drivers/uwb/uwb-internal.h | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/drivers/uwb/pal.c b/drivers/uwb/pal.c index 8ee7d90..690577d 100644 --- a/drivers/uwb/pal.c +++ b/drivers/uwb/pal.c @@ -44,10 +44,12 @@ int uwb_pal_register(struct uwb_pal *pal) int ret; if (pal->device) { + /* create a link to the uwb_rc in the PAL device's directory. */ ret = sysfs_create_link(&pal->device->kobj, &rc->uwb_dev.dev.kobj, "uwb_rc"); if (ret < 0) return ret; + /* create a link to the PAL in the UWB device's directory. */ ret = sysfs_create_link(&rc->uwb_dev.dev.kobj, &pal->device->kobj, pal->name); if (ret < 0) { diff --git a/drivers/uwb/uwb-internal.h b/drivers/uwb/uwb-internal.h index a7494bf..9a103b1 100644 --- a/drivers/uwb/uwb-internal.h +++ b/drivers/uwb/uwb-internal.h @@ -55,7 +55,8 @@ static inline struct uwb_rc *__uwb_rc_get(struct uwb_rc *rc) static inline void __uwb_rc_put(struct uwb_rc *rc) { - uwb_dev_put(&rc->uwb_dev); + if (rc) + uwb_dev_put(&rc->uwb_dev); } extern int uwb_rc_reset(struct uwb_rc *rc); |