1 --- a/arch/avr32/boards/atstk1000/atstk1002.c
2 +++ b/arch/avr32/boards/atstk1000/atstk1002.c
3 @@ -99,6 +99,7 @@ static struct mtd_partition *nand_part_i
4 static struct atmel_nand_data atstk1006_nand_data __initdata = {
7 + .det_pin = GPIO_PIN_NONE,
8 .rdy_pin = GPIO_PIN_PB(30),
9 .enable_pin = GPIO_PIN_PB(29),
10 .partition_info = nand_part_info,
11 --- a/arch/avr32/mach-at32ap/at32ap700x.c
12 +++ b/arch/avr32/mach-at32ap/at32ap700x.c
13 @@ -1969,13 +1969,14 @@ at32_add_device_nand(unsigned int id, st
16 hmatrix_sfr_set_bits(HMATRIX_SLAVE_EBI, HMATRIX_EBI_NAND_ENABLE);
17 - if (data->enable_pin)
19 + if (gpio_is_valid(data->enable_pin))
20 at32_select_gpio(data->enable_pin,
21 AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
23 - at32_select_gpio(data->rdy_pin, 0);
25 + if (gpio_is_valid(data->det_pin))
26 at32_select_gpio(data->det_pin, 0);
27 + if (gpio_is_valid(data->rdy_pin))
28 + at32_select_gpio(data->rdy_pin, 0);
30 platform_device_add(pdev);