diff options
Diffstat (limited to 'drivers/net/wireless/ath5k/gpio.c')
-rw-r--r-- | drivers/net/wireless/ath5k/gpio.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath5k/gpio.c b/drivers/net/wireless/ath5k/gpio.c index b77205adc180..64a27e73d02e 100644 --- a/drivers/net/wireless/ath5k/gpio.c +++ b/drivers/net/wireless/ath5k/gpio.c @@ -83,7 +83,7 @@ void ath5k_hw_set_ledstate(struct ath5k_hw *ah, unsigned int state) int ath5k_hw_set_gpio_input(struct ath5k_hw *ah, u32 gpio) { ATH5K_TRACE(ah->ah_sc); - if (gpio > AR5K_NUM_GPIO) + if (gpio >= AR5K_NUM_GPIO) return -EINVAL; ath5k_hw_reg_write(ah, @@ -99,7 +99,7 @@ int ath5k_hw_set_gpio_input(struct ath5k_hw *ah, u32 gpio) int ath5k_hw_set_gpio_output(struct ath5k_hw *ah, u32 gpio) { ATH5K_TRACE(ah->ah_sc); - if (gpio > AR5K_NUM_GPIO) + if (gpio >= AR5K_NUM_GPIO) return -EINVAL; ath5k_hw_reg_write(ah, @@ -115,7 +115,7 @@ int ath5k_hw_set_gpio_output(struct ath5k_hw *ah, u32 gpio) u32 ath5k_hw_get_gpio(struct ath5k_hw *ah, u32 gpio) { ATH5K_TRACE(ah->ah_sc); - if (gpio > AR5K_NUM_GPIO) + if (gpio >= AR5K_NUM_GPIO) return 0xffffffff; /* GPIO input magic */ @@ -131,7 +131,7 @@ int ath5k_hw_set_gpio(struct ath5k_hw *ah, u32 gpio, u32 val) u32 data; ATH5K_TRACE(ah->ah_sc); - if (gpio > AR5K_NUM_GPIO) + if (gpio >= AR5K_NUM_GPIO) return -EINVAL; /* GPIO output magic */ @@ -154,7 +154,7 @@ void ath5k_hw_set_gpio_intr(struct ath5k_hw *ah, unsigned int gpio, u32 data; ATH5K_TRACE(ah->ah_sc); - if (gpio > AR5K_NUM_GPIO) + if (gpio >= AR5K_NUM_GPIO) return; /* |