From: "Uwe Kleine-König" <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Richard Genoud <richard.genoud-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
Alexandre Belloni
<alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH v2 4/9] serial: atmel: Use common rs485 device tree parsing function
Date: Fri, 23 Jun 2017 12:01:50 +0200 [thread overview]
Message-ID: <20170623100150.6dxgr2rq5fmf3mtb@pengutronix.de> (raw)
In-Reply-To: <CACQ1gAh3jpcyPLexNgEU7KV0qX1Wor2dsLRV8LJYpA-1Wmp9SA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Fri, Jun 23, 2017 at 11:58:37AM +0200, Richard Genoud wrote:
> 2017-06-23 11:49 GMT+02:00 Uwe Kleine-König <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>:
> > From: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> >
> > We just got a common helper for parsing the rs485 specific
> > device tree properties. Use it and drop the open coded parser.
> >
> > Note that there is a small difference between the removed and the now
> > used implementation: The former cleared flags to 0 if rs485-rts-delay
> > was given, the common helper clears SER_RS485_RX_DURING_TX and
> > SER_RS485_ENABLED only but always which makes more sense.
> >
> > Signed-off-by: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> > [ukleinek: point out semantic change in commit log]
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> > ---
> > Changes since v1:
> > - as I dropped my two atmel patches and used Alexandre Belloni's (that are
> > already in next) instead, there are a few changes that are necessary to
> > adapt to the new base.
> >
> > drivers/tty/serial/atmel_serial.c | 17 +----------------
> > 1 file changed, 1 insertion(+), 16 deletions(-)
> >
> > diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
> > index 937d67f22fba..357570a216ad 100644
> > --- a/drivers/tty/serial/atmel_serial.c
> > +++ b/drivers/tty/serial/atmel_serial.c
> > @@ -1689,22 +1689,7 @@ static void atmel_init_rs485(struct uart_port *port,
> > {
> > struct device_node *np = pdev->dev.of_node;
> >
> > - struct serial_rs485 *rs485conf = &port->rs485;
> > - u32 rs485_delay[2];
> > -
> > - /* rs485 properties */
> > - if (of_property_read_u32_array(np, "rs485-rts-delay",
> > - rs485_delay, 2) == 0) {
> > - rs485conf->delay_rts_before_send = rs485_delay[0];
> > - rs485conf->delay_rts_after_send = rs485_delay[1];
> > - rs485conf->flags = 0;
> > - }
> > -
> > - if (of_get_property(np, "rs485-rx-during-tx", NULL))
> > - rs485conf->flags |= SER_RS485_RX_DURING_TX;
> > -
> > - if (of_get_property(np, "linux,rs485-enabled-at-boot-time", NULL))
> > - rs485conf->flags |= SER_RS485_ENABLED;
> > + of_get_rs485_mode(np, &port->rs485);
> > }
>
> as atmel_init_rs485() is only used once in the code, what do you think of
> getting rid of it and just have something like:
> of_get_rs485_mode(pdev->dev.of_node, &port->rs485);
> in atmel_init_port() ?
> (possibly with a little comment)
Right, that is something that I thought once, too, but then forgot on
the other changes I still had to do. Noted for v3.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-06-23 10:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-23 9:49 [PATCH v2 0/9] Add and make use of a common rs485 device tree parsing function Uwe Kleine-König
[not found] ` <20170623094945.31908-1-u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2017-06-23 9:49 ` [PATCH v2 1/9] serial: fsl_lpuart: clear unsupported options in .rs485_config() Uwe Kleine-König
2017-06-23 9:49 ` [PATCH v2 2/9] dt-bindings: serial/rs485: make rs485-rts-delay optional Uwe Kleine-König
2017-06-23 9:49 ` [PATCH v2 3/9] serial: Add common rs485 device tree parsing function Uwe Kleine-König
2017-06-23 9:49 ` [PATCH v2 4/9] serial: atmel: Use " Uwe Kleine-König
[not found] ` <20170623094945.31908-5-u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2017-06-23 9:58 ` Richard Genoud
[not found] ` <CACQ1gAh3jpcyPLexNgEU7KV0qX1Wor2dsLRV8LJYpA-1Wmp9SA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-06-23 10:01 ` Uwe Kleine-König [this message]
2017-06-23 9:49 ` [PATCH v2 5/9] serial: fsl_lpuart: " Uwe Kleine-König
2017-06-23 9:49 ` [PATCH v2 6/9] serial: omap-serial: " Uwe Kleine-König
[not found] ` <20170623094945.31908-7-u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2017-06-23 9:58 ` [PATCH v2.5 " Uwe Kleine-König
2017-06-23 9:49 ` [PATCH v2 7/9] serial: imx: default to half duplex rs485 Uwe Kleine-König
2017-06-23 9:49 ` [PATCH v2 8/9] serial: imx: Use common rs485 device tree parsing function Uwe Kleine-König
2017-06-23 9:49 ` [PATCH v2 9/9] of: document rs485 bindings for Atmel USART, Freescale UARTs and OMAP UART Uwe Kleine-König
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=20170623100150.6dxgr2rq5fmf3mtb@pengutronix.de \
--to=u.kleine-koenig-bicnvbalz9megne8c9+irq@public.gmane.org \
--cc=alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=richard.genoud-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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