From: Lee Jones <lee.jones@linaro•org>
To: Stephen Rothwell <sfr@canb•auug.org.au>, Greg KH <greg@kroah•com>
Cc: Linus Walleij <linus.walleij@linaro•org>,
linux-next@vger•kernel.org, linux-kernel@vger•kernel.org,
Boris Brezillon <boris.brezillon@free-electrons•com>,
Alexander Stein <alexander.stein@systec-electronic•com>,
Andy Shevchenko <andriy.shevchenko@linux•intel.com>
Subject: [PATCH] serial: st-asc: Use new GPIOD API to obtain RTS pin
Date: Wed, 8 Feb 2017 09:24:25 +0000 [thread overview]
Message-ID: <20170208092425.azqkx3nwf4jhsfz5@dell> (raw)
In-Reply-To: <20170208161113.1b597c01@canb.auug.org.au>
The commits mentioned below adapt the GPIO API to allow more information
to be passed directly through devm_get_gpiod_from_child() in the first
instance. This facilitates the removal of subsequent calls, such as
gpiod_direction_output(). This patch firstly moves to utilise the new
API and secondly removes the now superfluous call do set the direction.
Fixes: a264d10ff45c ("gpiolib: Convert fwnode_get_named_gpiod() to configure GPIO")
Fixes: b2987d7438e0 ("gpio: Pass GPIO label down to gpiod_request")
Fixes: 4b0947974e59 ("gpio: Rename devm_get_gpiod_from_child()")
Reported-by: Stephen Rothwell <sfr@canb•auug.org.au>
Suggested-by: Boris Brezillon <boris.brezillon@free-electrons•com>
Signed-off-by: Lee Jones <lee.jones@linaro•org>
---
drivers/tty/serial/st-asc.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
index bcf1d33..c334bcc 100644
--- a/drivers/tty/serial/st-asc.c
+++ b/drivers/tty/serial/st-asc.c
@@ -575,12 +575,13 @@ static void asc_set_termios(struct uart_port *port, struct ktermios *termios,
pinctrl_select_state(ascport->pinctrl,
ascport->states[NO_HW_FLOWCTRL]);
- gpiod = devm_get_gpiod_from_child(port->dev, "rts",
- &np->fwnode);
- if (!IS_ERR(gpiod)) {
- gpiod_direction_output(gpiod, 0);
+ gpiod = devm_fwnode_get_gpiod_from_child(port->dev,
+ "rts",
+ &np->fwnode,
+ GPIOD_OUT_LOW,
+ np->name);
+ if (!IS_ERR(gpiod))
ascport->rts = gpiod;
- }
}
}
--
2.9.3
next prev parent reply other threads:[~2017-02-08 9:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-08 5:11 linux-next: build failure after merge of the gpio tree Stephen Rothwell
2017-02-08 8:48 ` Lee Jones
2017-02-08 9:05 ` Boris Brezillon
2017-02-08 10:30 ` Stephen Rothwell
2017-02-08 9:24 ` Lee Jones [this message]
2017-02-08 13:00 ` [PATCH] serial: st-asc: Use new GPIOD API to obtain RTS pin Greg KH
2017-02-09 8:21 ` Lee Jones
2017-02-09 8:51 ` Greg KH
2017-02-13 9:59 ` Lee Jones
2017-02-21 10:26 ` Linus Walleij
2017-02-08 13:48 ` kbuild test robot
2017-02-08 16:31 ` Andy Shevchenko
2017-02-08 17:47 ` Greg KH
2017-02-08 19:42 ` Andy Shevchenko
2017-02-08 21:24 ` Stephen Rothwell
2017-02-13 15:18 ` linux-next: build failure after merge of the gpio tree Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170208092425.azqkx3nwf4jhsfz5@dell \
--to=lee.jones@linaro$(echo .)org \
--cc=alexander.stein@systec-electronic$(echo .)com \
--cc=andriy.shevchenko@linux$(echo .)intel.com \
--cc=boris.brezillon@free-electrons$(echo .)com \
--cc=greg@kroah$(echo .)com \
--cc=linus.walleij@linaro$(echo .)org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-next@vger$(echo .)kernel.org \
--cc=sfr@canb$(echo .)auug.org.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox