aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/tty/serial/cpm_uart/cpm_uart_core.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_core.c b/drivers/tty/serial/cpm_uart/cpm_uart_core.c
index f7672cae5321..1a535f70dc41 100644
--- a/drivers/tty/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/tty/serial/cpm_uart/cpm_uart_core.c
@@ -1213,8 +1213,32 @@ static int cpm_uart_init_port(struct device_node *np,
1213 goto out_pram; 1213 goto out_pram;
1214 } 1214 }
1215 1215
1216 for (i = 0; i < NUM_GPIOS; i++) 1216 for (i = 0; i < NUM_GPIOS; i++) {
1217 pinfo->gpios[i] = of_get_gpio(np, i); 1217 int gpio;
1218
1219 pinfo->gpios[i] = -1;
1220
1221 gpio = of_get_gpio(np, i);
1222
1223 if (gpio_is_valid(gpio)) {
1224 ret = gpio_request(gpio, "cpm_uart");
1225 if (ret) {
1226 pr_err("can't request gpio #%d: %d\n", i, ret);
1227 continue;
1228 }
1229 if (i == GPIO_RTS || i == GPIO_DTR)
1230 ret = gpio_direction_output(gpio, 0);
1231 else
1232 ret = gpio_direction_input(gpio);
1233 if (ret) {
1234 pr_err("can't set direction for gpio #%d: %d\n",
1235 i, ret);
1236 gpio_free(gpio);
1237 continue;
1238 }
1239 pinfo->gpios[i] = gpio;
1240 }
1241 }
1218 1242
1219#ifdef CONFIG_PPC_EARLY_DEBUG_CPM 1243#ifdef CONFIG_PPC_EARLY_DEBUG_CPM
1220 udbg_putc = NULL; 1244 udbg_putc = NULL;