diff options
author | Frederic Danis <frederic.danis@linux.intel.com> | 2015-06-18 12:43:27 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-06-18 13:47:14 +0200 |
commit | 960ef1d72f60f1df927768b9818ece6d7d046d64 (patch) | |
tree | d717db9f42d95bcddeca27caafb45ec91d1d1283 /drivers/bluetooth/hci_ldisc.c | |
parent | 2a973dfada2bcd61e1ce31612677da1a9ecc2124 (diff) |
Bluetooth: hci_uart: Fix speed selection
hu->proto->*speed will always be used for all device where it is set.
But hu->*speed should be used if exist, so the test should be swapped.
The equivalent change is needed in bcm_setup() of hci_bcm.c.
Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth/hci_ldisc.c')
-rw-r--r-- | drivers/bluetooth/hci_ldisc.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c index 590bd8e66bfb..177dd69fdd95 100644 --- a/drivers/bluetooth/hci_ldisc.c +++ b/drivers/bluetooth/hci_ldisc.c @@ -370,10 +370,10 @@ static int hci_uart_setup(struct hci_dev *hdev) int err; /* Init speed if any */ - if (hu->proto->init_speed) - speed = hu->proto->init_speed; - else if (hu->init_speed) + if (hu->init_speed) speed = hu->init_speed; + else if (hu->proto->init_speed) + speed = hu->proto->init_speed; else speed = 0; @@ -381,10 +381,10 @@ static int hci_uart_setup(struct hci_dev *hdev) hci_uart_set_baudrate(hu, speed); /* Operational speed if any */ - if (hu->proto->oper_speed) - speed = hu->proto->oper_speed; - else if (hu->oper_speed) + if (hu->oper_speed) speed = hu->oper_speed; + else if (hu->proto->oper_speed) + speed = hu->proto->oper_speed; else speed = 0; |