aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/wusbcore
diff options
context:
space:
mode:
authorDavid Vrabel2008-09-17 16:34:40 +0100
committerDavid Vrabel2008-09-17 16:54:35 +0100
commitb60066c141997ac2e4ef08459b75638ae86ae781 (patch)
treee7c89b8652a0f0416d0da338c31337991bf57c93 /drivers/usb/wusbcore
parentb63795fa3a41151040b86119750a7df508d40cda (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/wusbcore')
-rw-r--r--drivers/usb/wusbcore/pal.c3
-rw-r--r--drivers/usb/wusbcore/wusbhc.c16
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)
{
uwb_pal_init(&wusbhc->pal);
+ wusbhc->pal.name = "wusbhc";
+ wusbhc->pal.device = wusbhc->usb_hcd.self.controller;
+
return uwb_pal_register(wusbhc->uwb_rc, &wusbhc->pal);
}
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)
result = wusbhc_sec_create(wusbhc);
if (result < 0)
goto error_sec_create;
- result = wusbhc_pal_register(wusbhc);
- if (result < 0)
- goto error_pal_register;
return 0;
-error_pal_register:
- wusbhc_sec_destroy(wusbhc);
error_sec_create:
wusbhc_rh_destroy(wusbhc);
error_rh_create:
@@ -235,7 +230,14 @@ int wusbhc_b_create(struct wusbhc *wusbhc)
dev_err(dev, "Cannot register WUSBHC attributes: %d\n", result);
goto error_create_attr_group;
}
- /* Yep, I plan to add stuff here... */
+
+ result = wusbhc_pal_register(wusbhc);
+ if (result < 0)
+ goto error_pal_register;
+ return 0;
+
+error_pal_register:
+ sysfs_remove_group(wusbhc_kobj(wusbhc), &wusbhc_attr_group);
error_create_attr_group:
return result;
}
@@ -243,13 +245,13 @@ EXPORT_SYMBOL_GPL(wusbhc_b_create);
void wusbhc_b_destroy(struct wusbhc *wusbhc)
{
+ wusbhc_pal_unregister(wusbhc);
sysfs_remove_group(wusbhc_kobj(wusbhc), &wusbhc_attr_group);
}
EXPORT_SYMBOL_GPL(wusbhc_b_destroy);
void wusbhc_destroy(struct wusbhc *wusbhc)
{
- wusbhc_pal_unregister(wusbhc);
wusbhc_sec_destroy(wusbhc);
wusbhc_rh_destroy(wusbhc);
wusbhc_devconnect_destroy(wusbhc);