{
char fw_name[64];
const struct firmware *fw;
+ unsigned int speed;
int err;
BT_DBG("hu %p", hu);
goto finalize;
}
- if (hu->proto->init_speed)
- hci_uart_set_baudrate(hu, hu->proto->init_speed);
-
- if (hu->proto->oper_speed) {
- err = bcm_set_baudrate(hu, hu->proto->oper_speed);
+ /* Init speed if any */
+ if (hu->init_speed)
+ speed = hu->init_speed;
+ else if (hu->proto->init_speed)
+ speed = hu->proto->init_speed;
+ else
+ speed = 0;
+
+ if (speed)
+ hci_uart_set_baudrate(hu, speed);
+
+ /* Operational speed if any */
+ if (hu->oper_speed)
+ speed = hu->oper_speed;
+ else if (hu->proto->oper_speed)
+ speed = hu->proto->oper_speed;
+ else
+ speed = 0;
+
+ if (speed) {
+ err = bcm_set_baudrate(hu, speed);
if (!err)
- hci_uart_set_baudrate(hu, hu->proto->oper_speed);
+ hci_uart_set_baudrate(hu, speed);
}
finalize:
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;
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;