aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath5k/reset.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-12-02 04:27:06 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-12-02 15:17:50 -0500
commit8efa5d7d6ad307ae2d220def37ca89594062c40d (patch)
treec56eac029c47751932a9b7c5a1432b53fbae3361 /drivers/net/wireless/ath/ath5k/reset.c
parent4aa5d783c9e1c72e4950ff34f388077ccecac74a (diff)
ath5k: Check if pci pdev struct is initialized in common functions.
To be able to support other busses than PCI check if pci device structure is initialized. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/reset.c')
-rw-r--r--drivers/net/wireless/ath/ath5k/reset.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath5k/reset.c b/drivers/net/wireless/ath/ath5k/reset.c
index 7d8ef8decf0..f2f889d0cf5 100644
--- a/drivers/net/wireless/ath/ath5k/reset.c
+++ b/drivers/net/wireless/ath/ath5k/reset.c
@@ -471,7 +471,7 @@ int ath5k_hw_on_hold(struct ath5k_hw *ah)
471 * we ingore that flag for PCI-E cards. On PCI cards 471 * we ingore that flag for PCI-E cards. On PCI cards
472 * this flag gets cleared after 64 PCI clocks. 472 * this flag gets cleared after 64 PCI clocks.
473 */ 473 */
474 bus_flags = (pdev->is_pcie) ? 0 : AR5K_RESET_CTL_PCI; 474 bus_flags = (pdev && pdev->is_pcie) ? 0 : AR5K_RESET_CTL_PCI;
475 475
476 if (ah->ah_version == AR5K_AR5210) { 476 if (ah->ah_version == AR5K_AR5210) {
477 ret = ath5k_hw_nic_reset(ah, AR5K_RESET_CTL_PCU | 477 ret = ath5k_hw_nic_reset(ah, AR5K_RESET_CTL_PCU |
@@ -526,7 +526,7 @@ int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, bool initial)
526 * we ingore that flag for PCI-E cards. On PCI cards 526 * we ingore that flag for PCI-E cards. On PCI cards
527 * this flag gets cleared after 64 PCI clocks. 527 * this flag gets cleared after 64 PCI clocks.
528 */ 528 */
529 bus_flags = (pdev->is_pcie) ? 0 : AR5K_RESET_CTL_PCI; 529 bus_flags = (pdev && pdev->is_pcie) ? 0 : AR5K_RESET_CTL_PCI;
530 530
531 if (ah->ah_version == AR5K_AR5210) { 531 if (ah->ah_version == AR5K_AR5210) {
532 ret = ath5k_hw_nic_reset(ah, AR5K_RESET_CTL_PCU | 532 ret = ath5k_hw_nic_reset(ah, AR5K_RESET_CTL_PCU |