aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath5k/gpio.c10
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)
83int ath5k_hw_set_gpio_input(struct ath5k_hw *ah, u32 gpio) 83int ath5k_hw_set_gpio_input(struct ath5k_hw *ah, u32 gpio)
84{ 84{
85 ATH5K_TRACE(ah->ah_sc); 85 ATH5K_TRACE(ah->ah_sc);
86 if (gpio > AR5K_NUM_GPIO) 86 if (gpio >= AR5K_NUM_GPIO)
87 return -EINVAL; 87 return -EINVAL;
88 88
89 ath5k_hw_reg_write(ah, 89 ath5k_hw_reg_write(ah,
@@ -99,7 +99,7 @@ int ath5k_hw_set_gpio_input(struct ath5k_hw *ah, u32 gpio)
99int ath5k_hw_set_gpio_output(struct ath5k_hw *ah, u32 gpio) 99int ath5k_hw_set_gpio_output(struct ath5k_hw *ah, u32 gpio)
100{ 100{
101 ATH5K_TRACE(ah->ah_sc); 101 ATH5K_TRACE(ah->ah_sc);
102 if (gpio > AR5K_NUM_GPIO) 102 if (gpio >= AR5K_NUM_GPIO)
103 return -EINVAL; 103 return -EINVAL;
104 104
105 ath5k_hw_reg_write(ah, 105 ath5k_hw_reg_write(ah,
@@ -115,7 +115,7 @@ int ath5k_hw_set_gpio_output(struct ath5k_hw *ah, u32 gpio)
115u32 ath5k_hw_get_gpio(struct ath5k_hw *ah, u32 gpio) 115u32 ath5k_hw_get_gpio(struct ath5k_hw *ah, u32 gpio)
116{ 116{
117 ATH5K_TRACE(ah->ah_sc); 117 ATH5K_TRACE(ah->ah_sc);
118 if (gpio > AR5K_NUM_GPIO) 118 if (gpio >= AR5K_NUM_GPIO)
119 return 0xffffffff; 119 return 0xffffffff;
120 120
121 /* GPIO input magic */ 121 /* GPIO input magic */
@@ -131,7 +131,7 @@ int ath5k_hw_set_gpio(struct ath5k_hw *ah, u32 gpio, u32 val)
131 u32 data; 131 u32 data;
132 ATH5K_TRACE(ah->ah_sc); 132 ATH5K_TRACE(ah->ah_sc);
133 133
134 if (gpio > AR5K_NUM_GPIO) 134 if (gpio >= AR5K_NUM_GPIO)
135 return -EINVAL; 135 return -EINVAL;
136 136
137 /* GPIO output magic */ 137 /* GPIO output magic */
@@ -154,7 +154,7 @@ void ath5k_hw_set_gpio_intr(struct ath5k_hw *ah, unsigned int gpio,
154 u32 data; 154 u32 data;
155 155
156 ATH5K_TRACE(ah->ah_sc); 156 ATH5K_TRACE(ah->ah_sc);
157 if (gpio > AR5K_NUM_GPIO) 157 if (gpio >= AR5K_NUM_GPIO)
158 return; 158 return;
159 159
160 /* 160 /*