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/usb | |
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/usb')
-rw-r--r-- | drivers/usb/wusbcore/pal.c | 3 | ||||
-rw-r--r-- | drivers/usb/wusbcore/wusbhc.c | 16 |
2 files changed, 12 insertions, 7 deletions
diff --git a/drivers/usb/wusbcore/pal.c b/drivers/usb/wusbcore/pal.c index cc126b444734..7cc51e9905cf 100644 --- a/drivers/usb/wusbcore/pal.c +++ b/drivers/usb/wusbcore/pal.c | |||
@@ -26,6 +26,9 @@ int wusbhc_pal_register(struct wusbhc *wusbhc) | |||
26 | { | 26 | { |
27 | uwb_pal_init(&wusbhc->pal); | 27 | uwb_pal_init(&wusbhc->pal); |
28 | 28 | ||
29 | wusbhc->pal.name = "wusbhc"; | ||
30 | wusbhc->pal.device = wusbhc->usb_hcd.self.controller; | ||
31 | |||
29 | return uwb_pal_register(wusbhc->uwb_rc, &wusbhc->pal); | 32 | return uwb_pal_register(wusbhc->uwb_rc, &wusbhc->pal); |
30 | } | 33 | } |
31 | 34 | ||
diff --git a/drivers/usb/wusbcore/wusbhc.c b/drivers/usb/wusbcore/wusbhc.c index 1149b1e59c86..07c63a31c799 100644 --- a/drivers/usb/wusbcore/wusbhc.c +++ b/drivers/usb/wusbcore/wusbhc.c | |||
@@ -192,13 +192,8 @@ int wusbhc_create(struct wusbhc *wusbhc) | |||
192 | result = wusbhc_sec_create(wusbhc); | 192 | result = wusbhc_sec_create(wusbhc); |
193 | if (result < 0) | 193 | if (result < 0) |
194 | goto error_sec_create; | 194 | goto error_sec_create; |
195 | result = wusbhc_pal_register(wusbhc); | ||
196 | if (result < 0) | ||
197 | goto error_pal_register; | ||
198 | return 0; | 195 | return 0; |
199 | 196 | ||
200 | error_pal_register: | ||
201 | wusbhc_sec_destroy(wusbhc); | ||
202 | error_sec_create: | 197 | error_sec_create: |
203 | wusbhc_rh_destroy(wusbhc); | 198 | wusbhc_rh_destroy(wusbhc); |
204 | error_rh_create: | 199 | error_rh_create: |
@@ -235,7 +230,14 @@ int wusbhc_b_create(struct wusbhc *wusbhc) | |||
235 | dev_err(dev, "Cannot register WUSBHC attributes: %d\n", result); | 230 | dev_err(dev, "Cannot register WUSBHC attributes: %d\n", result); |
236 | goto error_create_attr_group; | 231 | goto error_create_attr_group; |
237 | } | 232 | } |
238 | /* Yep, I plan to add stuff here... */ | 233 | |
234 | result = wusbhc_pal_register(wusbhc); | ||
235 | if (result < 0) | ||
236 | goto error_pal_register; | ||
237 | return 0; | ||
238 | |||
239 | error_pal_register: | ||
240 | sysfs_remove_group(wusbhc_kobj(wusbhc), &wusbhc_attr_group); | ||
239 | error_create_attr_group: | 241 | error_create_attr_group: |
240 | return result; | 242 | return result; |
241 | } | 243 | } |
@@ -243,13 +245,13 @@ EXPORT_SYMBOL_GPL(wusbhc_b_create); | |||
243 | 245 | ||
244 | void wusbhc_b_destroy(struct wusbhc *wusbhc) | 246 | void wusbhc_b_destroy(struct wusbhc *wusbhc) |
245 | { | 247 | { |
248 | wusbhc_pal_unregister(wusbhc); | ||
246 | sysfs_remove_group(wusbhc_kobj(wusbhc), &wusbhc_attr_group); | 249 | sysfs_remove_group(wusbhc_kobj(wusbhc), &wusbhc_attr_group); |
247 | } | 250 | } |
248 | EXPORT_SYMBOL_GPL(wusbhc_b_destroy); | 251 | EXPORT_SYMBOL_GPL(wusbhc_b_destroy); |
249 | 252 | ||
250 | void wusbhc_destroy(struct wusbhc *wusbhc) | 253 | void wusbhc_destroy(struct wusbhc *wusbhc) |
251 | { | 254 | { |
252 | wusbhc_pal_unregister(wusbhc); | ||
253 | wusbhc_sec_destroy(wusbhc); | 255 | wusbhc_sec_destroy(wusbhc); |
254 | wusbhc_rh_destroy(wusbhc); | 256 | wusbhc_rh_destroy(wusbhc); |
255 | wusbhc_devconnect_destroy(wusbhc); | 257 | wusbhc_devconnect_destroy(wusbhc); |