Skip to content

Commit c0a349e

Browse files
carlescufijhedberg
authored andcommitted
drivers: bluetooth: rpmsg: Send reset only when the Host is included
The rpmsg_close() call uses the HCI reset command to reset the controller. But when building as controller-only we do not bring in the infrastructure to send HCI commands (nor should we) and rpmsg_close() will not be called anyway. Fixes #63534. Signed-off-by: Carles Cufi <[email protected]>
1 parent ee0314a commit c0a349e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/bluetooth/hci/rpmsg.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,12 @@ static int bt_rpmsg_close(void)
339339
{
340340
int err;
341341

342-
err = bt_hci_cmd_send_sync(BT_HCI_OP_RESET, NULL, NULL);
343-
if (err) {
344-
LOG_ERR("Sending reset command failed with: %d", err);
345-
return err;
342+
if (IS_ENABLED(CONFIG_BT_HCI_HOST)) {
343+
err = bt_hci_cmd_send_sync(BT_HCI_OP_RESET, NULL, NULL);
344+
if (err) {
345+
LOG_ERR("Sending reset command failed with: %d", err);
346+
return err;
347+
}
346348
}
347349

348350
err = ipc_service_deregister_endpoint(&hci_ept);

0 commit comments

Comments
 (0)