ARM: at91/soc: use gpio_is_valid to check the gpio
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
This commit is contained in:

committed by
Arnd Bergmann

parent
63b4c29678
commit
cc9f9aef6a
@@ -118,7 +118,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data)
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
if (data->vbus_pin) {
|
||||
if (gpio_is_valid(data->vbus_pin)) {
|
||||
at91_set_gpio_input(data->vbus_pin, 0);
|
||||
at91_set_deglitch(data->vbus_pin, 1);
|
||||
}
|
||||
@@ -171,13 +171,13 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
|
||||
return;
|
||||
|
||||
/* input/irq */
|
||||
if (data->det_pin) {
|
||||
if (gpio_is_valid(data->det_pin)) {
|
||||
at91_set_gpio_input(data->det_pin, 1);
|
||||
at91_set_deglitch(data->det_pin, 1);
|
||||
}
|
||||
if (data->wp_pin)
|
||||
if (gpio_is_valid(data->wp_pin))
|
||||
at91_set_gpio_input(data->wp_pin, 1);
|
||||
if (data->vcc_pin)
|
||||
if (gpio_is_valid(data->vcc_pin))
|
||||
at91_set_gpio_output(data->vcc_pin, 0);
|
||||
|
||||
/* CLK */
|
||||
@@ -240,15 +240,15 @@ void __init at91_add_device_nand(struct atmel_nand_data *data)
|
||||
at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA);
|
||||
|
||||
/* enable pin */
|
||||
if (data->enable_pin)
|
||||
if (gpio_is_valid(data->enable_pin))
|
||||
at91_set_gpio_output(data->enable_pin, 1);
|
||||
|
||||
/* ready/busy pin */
|
||||
if (data->rdy_pin)
|
||||
if (gpio_is_valid(data->rdy_pin))
|
||||
at91_set_gpio_input(data->rdy_pin, 1);
|
||||
|
||||
/* card detect pin */
|
||||
if (data->det_pin)
|
||||
if (gpio_is_valid(data->det_pin))
|
||||
at91_set_gpio_input(data->det_pin, 1);
|
||||
|
||||
at91_set_A_periph(AT91_PIN_PC0, 0); /* NANDOE */
|
||||
|
Reference in New Issue
Block a user