Skip to content

Commit dd4ced4

Browse files
andy-shevBartosz Golaszewski
authored andcommitted
ARM: sa1100: Open code gpio_request_array()
In order to prerare for removal of gpio_request_array(), open code the latter. Note, we are not using gpio_request_one() as it's also deprecated, hence reducing legacy API usage to the very basic ones. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 1a45e09 commit dd4ced4

File tree

1 file changed

+36
-11
lines changed

1 file changed

+36
-11
lines changed

arch/arm/mach-sa1100/h3600.c

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,6 @@
2020

2121
#include "generic.h"
2222

23-
/*
24-
* helper for sa1100fb
25-
*/
26-
static struct gpio h3600_lcd_gpio[] = {
27-
{ H3XXX_EGPIO_LCD_ON, GPIOF_OUT_INIT_LOW, "LCD power" },
28-
{ H3600_EGPIO_LCD_PCI, GPIOF_OUT_INIT_LOW, "LCD control" },
29-
{ H3600_EGPIO_LCD_5V_ON, GPIOF_OUT_INIT_LOW, "LCD 5v" },
30-
{ H3600_EGPIO_LVDD_ON, GPIOF_OUT_INIT_LOW, "LCD 9v/-6.5v" },
31-
};
32-
3323
static bool h3600_lcd_request(void)
3424
{
3525
static bool h3600_lcd_ok;
@@ -38,7 +28,42 @@ static bool h3600_lcd_request(void)
3828
if (h3600_lcd_ok)
3929
return true;
4030

41-
rc = gpio_request_array(h3600_lcd_gpio, ARRAY_SIZE(h3600_lcd_gpio));
31+
rc = gpio_request(H3XXX_EGPIO_LCD_ON, "LCD power");
32+
if (rc)
33+
goto out;
34+
rc = gpio_direction_output(H3XXX_EGPIO_LCD_ON, 0);
35+
if (rc)
36+
goto out_free_on;
37+
rc = gpio_request(H3600_EGPIO_LCD_PCI, "LCD control");
38+
if (rc)
39+
goto out_free_on;
40+
rc = gpio_direction_output(H3600_EGPIO_LCD_PCI, 0);
41+
if (rc)
42+
goto out_free_pci;
43+
rc = gpio_request(H3600_EGPIO_LCD_5V_ON, "LCD 5v");
44+
if (rc)
45+
goto out_free_pci;
46+
rc = gpio_direction_output(H3600_EGPIO_LCD_5V_ON, 0);
47+
if (rc)
48+
goto out_free_5v_on;
49+
rc = gpio_request(H3600_EGPIO_LVDD_ON, "LCD 9v/-6.5v");
50+
if (rc)
51+
goto out_free_5v_on;
52+
rc = gpio_direction_output(H3600_EGPIO_LVDD_ON, 0);
53+
if (rc)
54+
goto out_free_lvdd_on;
55+
56+
goto out;
57+
58+
out_free_lvdd_on:
59+
gpio_free(H3600_EGPIO_LVDD_ON);
60+
out_free_5v_on:
61+
gpio_free(H3600_EGPIO_LCD_5V_ON);
62+
out_free_pci:
63+
gpio_free(H3600_EGPIO_LCD_PCI);
64+
out_free_on:
65+
gpio_free(H3XXX_EGPIO_LCD_ON);
66+
out:
4267
if (rc)
4368
pr_err("%s: can't request GPIOs\n", __func__);
4469
else

0 commit comments

Comments
 (0)