summaryrefslogtreecommitdiffstats
path: root/drivers/uwb/driver.c
diff options
context:
space:
mode:
authorThomas Pugliese <thomas.pugliese@gmail.com>2014-09-16 22:53:08 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-09-24 07:04:44 +0200
commit848879340a7d220fd9801396eba82ecac2f2a739 (patch)
treee61a90d95d576c10e55b0296d7be17ef79a64acf /drivers/uwb/driver.c
parentuwb: remove UWB build dependency on PCI (diff)
downloadlinux-848879340a7d220fd9801396eba82ecac2f2a739.tar.xz
linux-848879340a7d220fd9801396eba82ecac2f2a739.zip
uwb: create a uwb bus type and add in-range peer devices to it
Documentation/usb/WUSB-Design-overview.txt states that UWB devices seen by a UWB radio controller are added to /sys/bus/uwb/devices, but this was not actually being done. This functionality is needed in order for UWB peer devices to be enumerated by user mode tools. This patch creates a uwb bus type and adds UWB peer devices to it as they are discovered by the radio controller. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/uwb/driver.c')
-rw-r--r--drivers/uwb/driver.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/uwb/driver.c b/drivers/uwb/driver.c
index 3e5454aba5d4..776bcb3c2140 100644
--- a/drivers/uwb/driver.c
+++ b/drivers/uwb/driver.c
@@ -121,9 +121,19 @@ static int __init uwb_subsys_init(void)
result = class_register(&uwb_rc_class);
if (result < 0)
goto error_uwb_rc_class_register;
+
+ /* Register the UWB bus */
+ result = bus_register(&uwb_bus_type);
+ if (result) {
+ pr_err("%s - registering bus driver failed\n", __func__);
+ goto exit_bus;
+ }
+
uwb_dbg_init();
return 0;
+exit_bus:
+ class_unregister(&uwb_rc_class);
error_uwb_rc_class_register:
uwb_est_destroy();
error_est_init:
@@ -134,6 +144,7 @@ module_init(uwb_subsys_init);
static void __exit uwb_subsys_exit(void)
{
uwb_dbg_exit();
+ bus_unregister(&uwb_bus_type);
class_unregister(&uwb_rc_class);
uwb_est_destroy();
return;