From patchwork Tue Jul 18 10:59:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 9847915 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8F46C60392 for ; Tue, 18 Jul 2017 11:01:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93A0C2854A for ; Tue, 18 Jul 2017 11:01:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 883B128573; Tue, 18 Jul 2017 11:01:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0FC9C2854A for ; Tue, 18 Jul 2017 11:01:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751510AbdGRLB1 (ORCPT ); Tue, 18 Jul 2017 07:01:27 -0400 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:54189 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752313AbdGRLAO (ORCPT ); Tue, 18 Jul 2017 07:00:14 -0400 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dXQEO-0007eO-3N; Tue, 18 Jul 2017 12:59:56 +0200 Received: from ukl by dude.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1dXQEN-00074e-I3; Tue, 18 Jul 2017 12:59:55 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Sascha Hauer , Tony Lindgren , devicetree@vger.kernel.org, linux-omap@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH v4 6/9] serial: omap-serial: Use common rs485 device tree parsing function Date: Tue, 18 Jul 2017 12:59:45 +0200 Message-Id: <20170718105948.21986-7-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170718105948.21986-1-u.kleine-koenig@pengutronix.de> References: <20170718105948.21986-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-omap@vger.kernel.org Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sascha Hauer We just got a common helper for parsing the rs485 specific device tree properties. Use it and drop the open coded parser. Signed-off-by: Sascha Hauer Signed-off-by: Uwe Kleine-König --- drivers/tty/serial/omap-serial.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index 1ea05ac57aa7..6d22097e6dd0 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -1607,7 +1607,6 @@ static int serial_omap_probe_rs485(struct uart_omap_port *up, struct device_node *np) { struct serial_rs485 *rs485conf = &up->port.rs485; - u32 rs485_delay[2]; enum of_gpio_flags flags; int ret; @@ -1638,17 +1637,7 @@ static int serial_omap_probe_rs485(struct uart_omap_port *up, up->rts_gpio = -EINVAL; } - 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]; - } - - if (of_property_read_bool(np, "rs485-rx-during-tx")) - rs485conf->flags |= SER_RS485_RX_DURING_TX; - - if (of_property_read_bool(np, "linux,rs485-enabled-at-boot-time")) - rs485conf->flags |= SER_RS485_ENABLED; + of_get_rs485_mode(np, rs485conf); return 0; }