diff options
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hif_usb.c | 36 |
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 | ||
738 | static 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 | |||
738 | static int ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev) | 746 | static 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 | ||
815 | err_urb: | ||
816 | /* Nothing */ | ||
817 | err_fw_download: | 823 | err_fw_download: |
824 | ath9k_hif_usb_dealloc_urbs(hif_dev); | ||
825 | err_urb: | ||
818 | release_firmware(hif_dev->firmware); | 826 | release_firmware(hif_dev->firmware); |
819 | err_fw_req: | 827 | err_fw_req: |
820 | hif_dev->firmware = NULL; | 828 | hif_dev->firmware = NULL; |
821 | return ret; | 829 | return ret; |
822 | } | 830 | } |
823 | 831 | ||
824 | static 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 | |||
832 | static void ath9k_hif_usb_dev_deinit(struct hif_device_usb *hif_dev) | 832 | static 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); |