summaryrefslogtreecommitdiff
path: root/drivers/bluetooth/btusb.c
diff options
context:
space:
mode:
authorTedd Ho-Jeong An <tedd.an@intel.com>2017-03-06 15:38:26 -0800
committerMarcel Holtmann <marcel@holtmann.org>2017-04-12 22:02:37 +0200
commit9268834b60c0b08101c7a8522b6901cf4cd57a14 (patch)
tree8c71b035f8282ca8e08de3fac3ff989ebb24cd81 /drivers/bluetooth/btusb.c
parentd8edd9ed156a1a840f1b1c2dbbf458684d6eea6e (diff)
downloadlwn-9268834b60c0b08101c7a8522b6901cf4cd57a14.tar.gz
lwn-9268834b60c0b08101c7a8522b6901cf4cd57a14.zip
Bluetooth: Use switch statement for Intel hardware variants
Multiple new hardware variants are planned and the simple if statement would get really complicated and unreadable. So instead replace it with a simple switch statement. The change is applied to both USB and UART. Based-on-patch-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth/btusb.c')
-rw-r--r--drivers/bluetooth/btusb.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 1c8094ef3f22..b599be805eb3 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -2024,13 +2024,17 @@ static int btusb_setup_intel_new(struct hci_dev *hdev)
return -EINVAL;
}
- /* At the moment the iBT 3.0 hardware variants 0x0b (LnP/SfP)
- * and 0x0c (WsP) are supported by this firmware loading method.
+ /* Check for supported iBT hardware variants of this firmware
+ * loading method.
*
* This check has been put in place to ensure correct forward
* compatibility options when newer hardware variants come along.
*/
- if (ver.hw_variant != 0x0b && ver.hw_variant != 0x0c) {
+ switch (ver.hw_variant) {
+ case 0x0b: /* SfP */
+ case 0x0c: /* WsP */
+ break;
+ default:
BT_ERR("%s: Unsupported Intel hardware variant (%u)",
hdev->name, ver.hw_variant);
return -EINVAL;