summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/hal.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/hal.c b/plugins/hal.c
index 130c76de..1adab4d8 100644
--- a/plugins/hal.c
+++ b/plugins/hal.c
@@ -66,16 +66,18 @@ static void formfactor_reply(DBusPendingCall *call, void *user_data)
minor += 1 << 4;
}
- if (adapter_get_class(adapter, cls) < 0)
+ dd = hci_open_dev(adapter_get_dev_id(adapter));
+ if (dd < 0)
return;
+ if (hci_read_class_of_dev(dd, cls, 500) < 0) {
+ hci_close_dev(dd);
+ return;
+ }
+
debug("Current device class is 0x%02x%02x%02x\n",
cls[2], cls[1], cls[0]);
- dd = hci_open_dev(adapter_get_dev_id(adapter));
- if (dd < 0)
- return;
-
/* Computer major class */
debug("Setting 0x%06x for major/minor device class", (1 << 8) | minor);