diff options
author | Hans de Goede <hdegoede@redhat.com> | 2020-04-17 19:15:29 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2020-04-22 19:43:58 +0200 |
commit | 0383f16a87c4dec6840cdbb80c2a30ecfdc2ffb0 (patch) | |
tree | d67fb005ec71acf22334e776cf84a518d6447868 /drivers/bluetooth/btbcm.c | |
parent | 2fcdd562b91bdc29dddd406f7278102e4d90b1fa (diff) | |
download | lwn-0383f16a87c4dec6840cdbb80c2a30ecfdc2ffb0.tar.gz lwn-0383f16a87c4dec6840cdbb80c2a30ecfdc2ffb0.zip |
Bluetooth: btbcm: Make btbcm_setup_patchram use btbcm_finalize
On UART attached devices we do:
1. btbcm_initialize()
2. Setup UART baudrate, etc.
3. btbcm_finalize()
After our previous changes we can now also use btbcm_finalize() from
the btbcm_setup_patchram() function used on USB devices without any
functional changes. This completes unifying the USB and UART paths
as much as possible.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth/btbcm.c')
-rw-r--r-- | drivers/bluetooth/btbcm.c | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c index 3404021b10bd..cc3628cace35 100644 --- a/drivers/bluetooth/btbcm.c +++ b/drivers/bluetooth/btbcm.c @@ -502,15 +502,16 @@ int btbcm_initialize(struct hci_dev *hdev, bool *fw_load_done) } EXPORT_SYMBOL_GPL(btbcm_initialize); -int btbcm_finalize(struct hci_dev *hdev) +int btbcm_finalize(struct hci_dev *hdev, bool *fw_load_done) { - bool fw_load_done = true; int err; - /* Re-initialize */ - err = btbcm_initialize(hdev, &fw_load_done); - if (err) - return err; + /* Re-initialize if necessary */ + if (*fw_load_done) { + err = btbcm_initialize(hdev, fw_load_done); + if (err) + return err; + } btbcm_check_bdaddr(hdev); @@ -530,20 +531,8 @@ int btbcm_setup_patchram(struct hci_dev *hdev) if (err) return err; - if (!fw_load_done) - goto done; - /* Re-initialize after loading Patch */ - err = btbcm_initialize(hdev, &fw_load_done); - if (err) - return err; - -done: - btbcm_check_bdaddr(hdev); - - set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks); - - return 0; + return btbcm_finalize(hdev, &fw_load_done); } EXPORT_SYMBOL_GPL(btbcm_setup_patchram); |