diff options
Diffstat (limited to 'arch/arm/plat-mxc/iomux-v1.c')
-rw-r--r-- | arch/arm/plat-mxc/iomux-v1.c | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/arch/arm/plat-mxc/iomux-v1.c b/arch/arm/plat-mxc/iomux-v1.c index 3238c10d4e02..1f73963bc13e 100644 --- a/arch/arm/plat-mxc/iomux-v1.c +++ b/arch/arm/plat-mxc/iomux-v1.c | |||
@@ -157,7 +157,7 @@ EXPORT_SYMBOL(mxc_gpio_mode); | |||
157 | static int imx_iomuxv1_setup_multiple(const int *list, unsigned count) | 157 | static int imx_iomuxv1_setup_multiple(const int *list, unsigned count) |
158 | { | 158 | { |
159 | size_t i; | 159 | size_t i; |
160 | int ret; | 160 | int ret = 0; |
161 | 161 | ||
162 | for (i = 0; i < count; ++i) { | 162 | for (i = 0; i < count; ++i) { |
163 | ret = mxc_gpio_mode(list[i]); | 163 | ret = mxc_gpio_mode(list[i]); |
@@ -172,45 +172,13 @@ static int imx_iomuxv1_setup_multiple(const int *list, unsigned count) | |||
172 | int mxc_gpio_setup_multiple_pins(const int *pin_list, unsigned count, | 172 | int mxc_gpio_setup_multiple_pins(const int *pin_list, unsigned count, |
173 | const char *label) | 173 | const char *label) |
174 | { | 174 | { |
175 | size_t i; | ||
176 | int ret; | 175 | int ret; |
177 | 176 | ||
178 | for (i = 0; i < count; ++i) { | ||
179 | unsigned gpio = pin_list[i] & (GPIO_PIN_MASK | GPIO_PORT_MASK); | ||
180 | |||
181 | ret = gpio_request(gpio, label); | ||
182 | if (ret) | ||
183 | goto err_gpio_request; | ||
184 | } | ||
185 | |||
186 | ret = imx_iomuxv1_setup_multiple(pin_list, count); | 177 | ret = imx_iomuxv1_setup_multiple(pin_list, count); |
187 | if (ret) | ||
188 | goto err_setup; | ||
189 | |||
190 | return 0; | ||
191 | |||
192 | err_setup: | ||
193 | BUG_ON(i != count); | ||
194 | |||
195 | err_gpio_request: | ||
196 | mxc_gpio_release_multiple_pins(pin_list, i); | ||
197 | |||
198 | return ret; | 178 | return ret; |
199 | } | 179 | } |
200 | EXPORT_SYMBOL(mxc_gpio_setup_multiple_pins); | 180 | EXPORT_SYMBOL(mxc_gpio_setup_multiple_pins); |
201 | 181 | ||
202 | void mxc_gpio_release_multiple_pins(const int *pin_list, int count) | ||
203 | { | ||
204 | size_t i; | ||
205 | |||
206 | for (i = 0; i < count; ++i) { | ||
207 | unsigned gpio = pin_list[i] & (GPIO_PIN_MASK | GPIO_PORT_MASK); | ||
208 | |||
209 | gpio_free(gpio); | ||
210 | } | ||
211 | } | ||
212 | EXPORT_SYMBOL(mxc_gpio_release_multiple_pins); | ||
213 | |||
214 | int __init imx_iomuxv1_init(void __iomem *base, int numports) | 182 | int __init imx_iomuxv1_init(void __iomem *base, int numports) |
215 | { | 183 | { |
216 | imx_iomuxv1_baseaddr = base; | 184 | imx_iomuxv1_baseaddr = base; |