diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2011-09-19 03:28:25 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2011-11-29 10:46:14 -0500 |
commit | cc9f9aef6ad3ebdda911e25b38222c215f7634f9 (patch) | |
tree | 26382188e2876795ae2573c4e0b6bf46463948bc /arch/arm/mach-at91/at91sam9261_devices.c | |
parent | 63b4c2967850033de0a488d2ba7cd09052199d99 (diff) |
ARM: at91/soc: use gpio_is_valid to check the gpio
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'arch/arm/mach-at91/at91sam9261_devices.c')
-rw-r--r-- | arch/arm/mach-at91/at91sam9261_devices.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index e5cff1d902d0..dff4c2de20c7 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c | |||
@@ -118,7 +118,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data) | |||
118 | if (!data) | 118 | if (!data) |
119 | return; | 119 | return; |
120 | 120 | ||
121 | if (data->vbus_pin) { | 121 | if (gpio_is_valid(data->vbus_pin)) { |
122 | at91_set_gpio_input(data->vbus_pin, 0); | 122 | at91_set_gpio_input(data->vbus_pin, 0); |
123 | at91_set_deglitch(data->vbus_pin, 1); | 123 | at91_set_deglitch(data->vbus_pin, 1); |
124 | } | 124 | } |
@@ -171,13 +171,13 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) | |||
171 | return; | 171 | return; |
172 | 172 | ||
173 | /* input/irq */ | 173 | /* input/irq */ |
174 | if (data->det_pin) { | 174 | if (gpio_is_valid(data->det_pin)) { |
175 | at91_set_gpio_input(data->det_pin, 1); | 175 | at91_set_gpio_input(data->det_pin, 1); |
176 | at91_set_deglitch(data->det_pin, 1); | 176 | at91_set_deglitch(data->det_pin, 1); |
177 | } | 177 | } |
178 | if (data->wp_pin) | 178 | if (gpio_is_valid(data->wp_pin)) |
179 | at91_set_gpio_input(data->wp_pin, 1); | 179 | at91_set_gpio_input(data->wp_pin, 1); |
180 | if (data->vcc_pin) | 180 | if (gpio_is_valid(data->vcc_pin)) |
181 | at91_set_gpio_output(data->vcc_pin, 0); | 181 | at91_set_gpio_output(data->vcc_pin, 0); |
182 | 182 | ||
183 | /* CLK */ | 183 | /* CLK */ |
@@ -240,15 +240,15 @@ void __init at91_add_device_nand(struct atmel_nand_data *data) | |||
240 | at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA); | 240 | at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA); |
241 | 241 | ||
242 | /* enable pin */ | 242 | /* enable pin */ |
243 | if (data->enable_pin) | 243 | if (gpio_is_valid(data->enable_pin)) |
244 | at91_set_gpio_output(data->enable_pin, 1); | 244 | at91_set_gpio_output(data->enable_pin, 1); |
245 | 245 | ||
246 | /* ready/busy pin */ | 246 | /* ready/busy pin */ |
247 | if (data->rdy_pin) | 247 | if (gpio_is_valid(data->rdy_pin)) |
248 | at91_set_gpio_input(data->rdy_pin, 1); | 248 | at91_set_gpio_input(data->rdy_pin, 1); |
249 | 249 | ||
250 | /* card detect pin */ | 250 | /* card detect pin */ |
251 | if (data->det_pin) | 251 | if (gpio_is_valid(data->det_pin)) |
252 | at91_set_gpio_input(data->det_pin, 1); | 252 | at91_set_gpio_input(data->det_pin, 1); |
253 | 253 | ||
254 | at91_set_A_periph(AT91_PIN_PC0, 0); /* NANDOE */ | 254 | at91_set_A_periph(AT91_PIN_PC0, 0); /* NANDOE */ |