forked from Minki/linux
ARM: at91: fix check of valid GPIO for SPI and USB
SPI chip select pins have to be checked by gpio_is_valid(). The USB host overcurrent_pin checking was missing. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
This commit is contained in:
parent
9475375a5e
commit
0c2c1f624d
@ -598,6 +598,9 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
|
||||
else
|
||||
cs_pin = spi1_standard_cs[devices[i].chip_select];
|
||||
|
||||
if (!gpio_is_valid(cs_pin))
|
||||
continue;
|
||||
|
||||
if (devices[i].bus_num == 0)
|
||||
enable_spi0 = 1;
|
||||
else
|
||||
|
@ -415,6 +415,9 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
|
||||
else
|
||||
cs_pin = spi1_standard_cs[devices[i].chip_select];
|
||||
|
||||
if (!gpio_is_valid(cs_pin))
|
||||
continue;
|
||||
|
||||
if (devices[i].bus_num == 0)
|
||||
enable_spi0 = 1;
|
||||
else
|
||||
|
@ -672,6 +672,9 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
|
||||
else
|
||||
cs_pin = spi1_standard_cs[devices[i].chip_select];
|
||||
|
||||
if (!gpio_is_valid(cs_pin))
|
||||
continue;
|
||||
|
||||
if (devices[i].bus_num == 0)
|
||||
enable_spi0 = 1;
|
||||
else
|
||||
|
@ -133,7 +133,7 @@ void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data)
|
||||
|
||||
/* Enable overcurrent notification */
|
||||
for (i = 0; i < data->ports; i++) {
|
||||
if (data->overcurrent_pin[i])
|
||||
if (gpio_is_valid(data->overcurrent_pin[i]))
|
||||
at91_set_gpio_input(data->overcurrent_pin[i], 1);
|
||||
}
|
||||
|
||||
@ -787,6 +787,9 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
|
||||
else
|
||||
cs_pin = spi1_standard_cs[devices[i].chip_select];
|
||||
|
||||
if (!gpio_is_valid(cs_pin))
|
||||
continue;
|
||||
|
||||
if (devices[i].bus_num == 0)
|
||||
enable_spi0 = 1;
|
||||
else
|
||||
|
@ -419,6 +419,9 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
|
||||
else
|
||||
cs_pin = spi_standard_cs[devices[i].chip_select];
|
||||
|
||||
if (!gpio_is_valid(cs_pin))
|
||||
continue;
|
||||
|
||||
/* enable chip-select pin */
|
||||
at91_set_gpio_output(cs_pin, 1);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user