Commit 8c44f9b5 authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Greg Kroah-Hartman

tty: st-asc: switch to using devm_gpiod_get()

The node pointer in question is not a child node, but the node assigned
to the port device itself, so we should not be using
devm_fwnode_get_gpiod_from_child() [that is going away], but standard
devm_gpiod_get().

To maintain the previous labeling we use gpiod_set_consumer_name() after
we acquire the GPIO.
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/20200104202314.GA13591@dtor-wsSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cdcc41a2
...@@ -504,7 +504,6 @@ static void asc_set_termios(struct uart_port *port, struct ktermios *termios, ...@@ -504,7 +504,6 @@ static void asc_set_termios(struct uart_port *port, struct ktermios *termios,
struct ktermios *old) struct ktermios *old)
{ {
struct asc_port *ascport = to_asc_port(port); struct asc_port *ascport = to_asc_port(port);
struct device_node *np = port->dev->of_node;
struct gpio_desc *gpiod; struct gpio_desc *gpiod;
unsigned int baud; unsigned int baud;
u32 ctrl_val; u32 ctrl_val;
...@@ -566,13 +565,12 @@ static void asc_set_termios(struct uart_port *port, struct ktermios *termios, ...@@ -566,13 +565,12 @@ static void asc_set_termios(struct uart_port *port, struct ktermios *termios,
pinctrl_select_state(ascport->pinctrl, pinctrl_select_state(ascport->pinctrl,
ascport->states[NO_HW_FLOWCTRL]); ascport->states[NO_HW_FLOWCTRL]);
gpiod = devm_fwnode_get_gpiod_from_child(port->dev, gpiod = devm_gpiod_get(port->dev, "rts", GPIOD_OUT_LOW);
"rts", if (!IS_ERR(gpiod)) {
&np->fwnode, gpiod_set_consumer_name(gpiod,
GPIOD_OUT_LOW, port->dev->of_node->name);
np->name);
if (!IS_ERR(gpiod))
ascport->rts = gpiod; ascport->rts = gpiod;
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment