From patchwork Fri Jun 23 09:49:42 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: 779907 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wvDH92h2qz9sNW for ; Fri, 23 Jun 2017 19:51:17 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DevCBcOn"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="sUtICcwr"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PeARC7cfuKU9QkR8yUX2gR+/YYsf+RB9nLCFYuyUIAo=; b=DevCBcOnoNXx/q YKtDk1m6VNEFvmjkw8lmCJKrc8a7ZFORjIMwRSwVL3neVetiBZBAn/l9hlwXmG9Z3qEFWpMLyxL1q kIh/PVzNCYY7Ffva1Ub0Oo9e9GgXZR1jxgvrHgF/mJdja+TvfRREWgA+QuiSOEo2OBcRO645ChkqK MxqRsgy1CyzsBEjvCdDAb4AoA3qBR9UfG4Rew5a3CcpOEb2umS97bMQ0PHXi8yVaqfhdYrvm9rMsJ VbkPokhD2ZVLGlvrzsW6BOSsJ/8bTShl+TlO8Q/eer5DEGx48Uk+DUw08tfxSgAetEHOCDRc9Szap gkHqR9JEVx0VFCbNhzcg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dOLFC-0006uG-82; Fri, 23 Jun 2017 09:51:14 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dOLEM-0005v8-NQ for linux-arm-kernel@bombadil.infradead.org; Fri, 23 Jun 2017 09:50:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Ops/2TpzaGGoQy4gbqzTK6jj7RzxWV1ZFQ1GmZO0QZI=; b=sUtICcwrFwe4ZQIP8mxs4yRu7k FcSpxvWwCuG9ShR1unIavzx2obeJF5+2aMb6ooBNEdRlXPr6ygH06F8MtcEjVPs0tcNyIJQVt+ZwR 0ZWeY4w6VQt0f8LFY2GJiK8uSIvnADWIevqKjysrK34UZW4OSxlMeZUa3zg/zlIlp2skzz1qKyJQ1 RF7S3H87hdH+NKtMaxEObUxywpa+SepPEiBRxYVkxu8zsv8frKtskr9fUn90VefEUeN9jdaPjR34u 0QgFttZWbzDPDXsMFG6ohJGLnHFSO1C8XNjvUii8+TMf7y/dE8a/NNgXflt9e+ATss/hsWnpItLwn na+QVNvg==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dOLEJ-00014e-Kr for linux-arm-kernel@lists.infradead.org; Fri, 23 Jun 2017 09:50:20 +0000 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 1dOLDu-0000rL-3D; Fri, 23 Jun 2017 11:49:54 +0200 Received: from ukl by dude.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1dOLDt-0000AZ-AI; Fri, 23 Jun 2017 11:49:53 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 6/9] serial: omap-serial: Use common rs485 device tree parsing function Date: Fri, 23 Jun 2017 11:49:42 +0200 Message-Id: <20170623094945.31908-7-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170623094945.31908-1-u.kleine-koenig@pengutronix.de> References: <20170623094945.31908-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-arm-kernel@lists.infradead.org X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tony Lindgren , devicetree@vger.kernel.org, Sascha Hauer , linux-omap@vger.kernel.org, kernel@pengutronix.de Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org 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 --- Changes since v1: - drop paragraph in commit log that of_get_rs485_mode is more strict as this is wrong in v2. 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; }