aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath/ath9k/hif_usb.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index 74872ca76f9a..453cf56eba78 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -735,6 +735,14 @@ err:
735 return -ENOMEM; 735 return -ENOMEM;
736} 736}
737 737
738static void ath9k_hif_usb_dealloc_urbs(struct hif_device_usb *hif_dev)
739{
740 usb_kill_anchored_urbs(&hif_dev->regout_submitted);
741 ath9k_hif_usb_dealloc_reg_in_urb(hif_dev);
742 ath9k_hif_usb_dealloc_tx_urbs(hif_dev);
743 ath9k_hif_usb_dealloc_rx_urbs(hif_dev);
744}
745
738static int ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev) 746static int ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev)
739{ 747{
740 int transfer, err; 748 int transfer, err;
@@ -794,14 +802,6 @@ static int ath9k_hif_usb_dev_init(struct hif_device_usb *hif_dev,
794 goto err_fw_req; 802 goto err_fw_req;
795 } 803 }
796 804
797 /* Download firmware */
798 ret = ath9k_hif_usb_download_fw(hif_dev);
799 if (ret) {
800 dev_err(&hif_dev->udev->dev,
801 "ath9k_htc: Firmware - %s download failed\n", fw_name);
802 goto err_fw_download;
803 }
804
805 /* Alloc URBs */ 805 /* Alloc URBs */
806 ret = ath9k_hif_usb_alloc_urbs(hif_dev); 806 ret = ath9k_hif_usb_alloc_urbs(hif_dev);
807 if (ret) { 807 if (ret) {
@@ -810,25 +810,25 @@ static int ath9k_hif_usb_dev_init(struct hif_device_usb *hif_dev,
810 goto err_urb; 810 goto err_urb;
811 } 811 }
812 812
813 /* Download firmware */
814 ret = ath9k_hif_usb_download_fw(hif_dev);
815 if (ret) {
816 dev_err(&hif_dev->udev->dev,
817 "ath9k_htc: Firmware - %s download failed\n", fw_name);
818 goto err_fw_download;
819 }
820
813 return 0; 821 return 0;
814 822
815err_urb:
816 /* Nothing */
817err_fw_download: 823err_fw_download:
824 ath9k_hif_usb_dealloc_urbs(hif_dev);
825err_urb:
818 release_firmware(hif_dev->firmware); 826 release_firmware(hif_dev->firmware);
819err_fw_req: 827err_fw_req:
820 hif_dev->firmware = NULL; 828 hif_dev->firmware = NULL;
821 return ret; 829 return ret;
822} 830}
823 831
824static void ath9k_hif_usb_dealloc_urbs(struct hif_device_usb *hif_dev)
825{
826 usb_kill_anchored_urbs(&hif_dev->regout_submitted);
827 ath9k_hif_usb_dealloc_reg_in_urb(hif_dev);
828 ath9k_hif_usb_dealloc_tx_urbs(hif_dev);
829 ath9k_hif_usb_dealloc_rx_urbs(hif_dev);
830}
831
832static void ath9k_hif_usb_dev_deinit(struct hif_device_usb *hif_dev) 832static void ath9k_hif_usb_dev_deinit(struct hif_device_usb *hif_dev)
833{ 833{
834 ath9k_hif_usb_dealloc_urbs(hif_dev); 834 ath9k_hif_usb_dealloc_urbs(hif_dev);