From patchwork Wed Jun 21 10:21:26 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: 9801411 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 A85E460329 for ; Wed, 21 Jun 2017 10:21:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97F3B2854A for ; Wed, 21 Jun 2017 10:21:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C5CA28591; Wed, 21 Jun 2017 10:21:54 +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 0666B2854A for ; Wed, 21 Jun 2017 10:21:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752472AbdFUKVq (ORCPT ); Wed, 21 Jun 2017 06:21:46 -0400 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:58019 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752743AbdFUKVo (ORCPT ); Wed, 21 Jun 2017 06:21:44 -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 1dNclT-00052P-Q0; Wed, 21 Jun 2017 12:21:35 +0200 Received: from ukl by dude.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1dNclT-0005nA-0v; Wed, 21 Jun 2017 12:21:35 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org Cc: kernel@pengutronix.de, devicetree@vger.kernel.org, Sascha Hauer , Tony Lindgren , linux-omap@vger.kernel.org Subject: [PATCH 5/9] serial: omap-serial: Use common rs485 device tree parsing function Date: Wed, 21 Jun 2017 12:21:26 +0200 Message-Id: <20170621102130.21024-6-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170621102130.21024-1-u.kleine-koenig@pengutronix.de> References: <20170621102130.21024-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. Note that the common helper is more strict and only evaluates the optional properties if the required rs485-rts-delay is present. Signed-off-by: Sascha Hauer Signed-off-by: Uwe Kleine-König --- Cc: Tony Lindgren Cc: linux-omap@vger.kernel.org drivers/tty/serial/omap-serial.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index 1ea05ac57aa7..6e4728d3a24c 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -1638,17 +1638,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; }