diff options
author | David Vrabel <david.vrabel@csr.com> | 2008-09-17 11:34:40 -0400 |
---|---|---|
committer | David Vrabel <dv02@dv02pc01.europe.root.pri> | 2008-09-17 11:54:35 -0400 |
commit | b60066c141997ac2e4ef08459b75638ae86ae781 (patch) | |
tree | e7c89b8652a0f0416d0da338c31337991bf57c93 /drivers/uwb | |
parent | b63795fa3a41151040b86119750a7df508d40cda (diff) |
uwb: add symlinks in sysfs between radio controllers and PALs
Add a facility for PALs to have symlinks to their radio controller
(and vice-versa) and make WUSB host controllers use this.
Signed-off-by: David Vrabel <david.vrabel@csr.com>
Diffstat (limited to 'drivers/uwb')
-rw-r--r-- | drivers/uwb/pal.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/uwb/pal.c b/drivers/uwb/pal.c index 5508993a820e..1afb38eacb9a 100644 --- a/drivers/uwb/pal.c +++ b/drivers/uwb/pal.c | |||
@@ -39,6 +39,21 @@ EXPORT_SYMBOL_GPL(uwb_pal_init); | |||
39 | */ | 39 | */ |
40 | int uwb_pal_register(struct uwb_rc *rc, struct uwb_pal *pal) | 40 | int uwb_pal_register(struct uwb_rc *rc, struct uwb_pal *pal) |
41 | { | 41 | { |
42 | int ret; | ||
43 | |||
44 | if (pal->device) { | ||
45 | ret = sysfs_create_link(&pal->device->kobj, | ||
46 | &rc->uwb_dev.dev.kobj, "uwb_rc"); | ||
47 | if (ret < 0) | ||
48 | return ret; | ||
49 | ret = sysfs_create_link(&rc->uwb_dev.dev.kobj, | ||
50 | &pal->device->kobj, pal->name); | ||
51 | if (ret < 0) { | ||
52 | sysfs_remove_link(&pal->device->kobj, "uwb_rc"); | ||
53 | return ret; | ||
54 | } | ||
55 | } | ||
56 | |||
42 | spin_lock(&rc->pal_lock); | 57 | spin_lock(&rc->pal_lock); |
43 | list_add(&pal->node, &rc->pals); | 58 | list_add(&pal->node, &rc->pals); |
44 | spin_unlock(&rc->pal_lock); | 59 | spin_unlock(&rc->pal_lock); |
@@ -57,6 +72,11 @@ void uwb_pal_unregister(struct uwb_rc *rc, struct uwb_pal *pal) | |||
57 | spin_lock(&rc->pal_lock); | 72 | spin_lock(&rc->pal_lock); |
58 | list_del(&pal->node); | 73 | list_del(&pal->node); |
59 | spin_unlock(&rc->pal_lock); | 74 | spin_unlock(&rc->pal_lock); |
75 | |||
76 | if (pal->device) { | ||
77 | sysfs_remove_link(&rc->uwb_dev.dev.kobj, pal->name); | ||
78 | sysfs_remove_link(&pal->device->kobj, "uwb_rc"); | ||
79 | } | ||
60 | } | 80 | } |
61 | EXPORT_SYMBOL_GPL(uwb_pal_unregister); | 81 | EXPORT_SYMBOL_GPL(uwb_pal_unregister); |
62 | 82 | ||