Skip to content

Commit

Permalink
Bluetooth: btrtl: Ignore error return for hci_devcd_register()
Browse files Browse the repository at this point in the history
If CONFIG_DEV_COREDUMP was not set, it would return -EOPNOTSUPP for
hci_devcd_register().
In this commit, ignore error return for hci_devcd_register().
Otherwise Bluetooth initialization will be failed.

Fixes: 044014c ("Bluetooth: btrtl: Add Realtek devcoredump support")
Cc: stable@vger.kernel.org
Reported-by: Kirill A. Shutemov <kirill@shutemov.name>
Closes: https://lore.kernel.org/all/ZRyqIn0_qqEFBPdy@debian.me/T/
Signed-off-by: Max Chou <max.chou@realtek.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
  • Loading branch information
Max Chou authored and Luiz Augusto von Dentz committed Oct 14, 2023
1 parent 35d91d9 commit 9ee2528
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions drivers/bluetooth/btrtl.c
Original file line number Diff line number Diff line change
Expand Up @@ -962,13 +962,10 @@ static void btrtl_dmp_hdr(struct hci_dev *hdev, struct sk_buff *skb)
skb_put_data(skb, buf, strlen(buf));
}

static int btrtl_register_devcoredump_support(struct hci_dev *hdev)
static void btrtl_register_devcoredump_support(struct hci_dev *hdev)
{
int err;
hci_devcd_register(hdev, btrtl_coredump, btrtl_dmp_hdr, NULL);

err = hci_devcd_register(hdev, btrtl_coredump, btrtl_dmp_hdr, NULL);

return err;
}

void btrtl_set_driver_name(struct hci_dev *hdev, const char *driver_name)
Expand Down Expand Up @@ -1255,8 +1252,7 @@ int btrtl_download_firmware(struct hci_dev *hdev,
}

done:
if (!err)
err = btrtl_register_devcoredump_support(hdev);
btrtl_register_devcoredump_support(hdev);

return err;
}
Expand Down

0 comments on commit 9ee2528

Please sign in to comment.