devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bich HEMON <bich.hemon-qxv4g6HH51o@public.gmane.org>
To: Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Maxime Coquelin
	<mcoquelin.stm32-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Alexandre TORGUE <alexandre.torgue-qxv4g6HH51o@public.gmane.org>,
	Jiri Slaby <jslaby-IBi9RG/b67k@public.gmane.org>,
	"linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: Bich HEMON <bich.hemon-qxv4g6HH51o@public.gmane.org>
Subject: [PATCH 03/20] serial: stm32: fix multi ports management
Date: Mon, 26 Jun 2017 12:49:10 +0000	[thread overview]
Message-ID: <1498481318-1894-4-git-send-email-bich.hemon@st.com> (raw)
In-Reply-To: <1498481318-1894-1-git-send-email-bich.hemon-qxv4g6HH51o@public.gmane.org>

From: Bich Hemon <bich.hemon-qxv4g6HH51o@public.gmane.org>

alias definition in the device tree is mandatory
for each port.

Signed-off-by: Gerald Baeza <gerald.baeza-qxv4g6HH51o@public.gmane.org>
---
 drivers/tty/serial/stm32-usart.c | 6 ++++--
 drivers/tty/serial/stm32-usart.h | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c
index 50948f6..c6ae4fd 100644
--- a/drivers/tty/serial/stm32-usart.c
+++ b/drivers/tty/serial/stm32-usart.c
@@ -696,8 +696,10 @@ static struct stm32_port *stm32_of_get_stm32_port(struct platform_device *pdev)
 		return NULL;
 
 	id = of_alias_get_id(np, "serial");
-	if (id < 0)
-		id = 0;
+	if (id < 0) {
+		dev_err(&pdev->dev, "failed to get alias id, errno %d\n", id);
+		return NULL;
+	}
 
 	if (WARN_ON(id >= STM32_MAX_PORTS))
 		return NULL;
diff --git a/drivers/tty/serial/stm32-usart.h b/drivers/tty/serial/stm32-usart.h
index 9f0d0e8..33f1320 100644
--- a/drivers/tty/serial/stm32-usart.h
+++ b/drivers/tty/serial/stm32-usart.h
@@ -206,7 +206,7 @@ struct stm32_usart_info stm32f7_info = {
 #define USART_ICR_CMCF		BIT(17)		/* F7 */
 
 #define STM32_SERIAL_NAME "ttyS"
-#define STM32_MAX_PORTS 6
+#define STM32_MAX_PORTS 8
 
 #define RX_BUF_L 200		 /* dma rx buffer length     */
 #define RX_BUF_P RX_BUF_L	 /* dma rx buffer period     */
-- 
1.9.1
--
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

  parent reply	other threads:[~2017-06-26 12:49 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-26 12:49 [PATCH 00/20] Update STM32 usart driver Bich HEMON
2017-06-26 12:49 ` [PATCH 01/20] serial: stm32: adding fifo support Bich HEMON
2017-06-26 12:49 ` [PATCH 02/20] dt-bindings: serial: each stm32 usart needs an alias Bich HEMON
     [not found]   ` <1498481318-1894-3-git-send-email-bich.hemon-qxv4g6HH51o@public.gmane.org>
2017-06-28 18:06     ` Rob Herring
2017-06-26 12:49 ` [PATCH 05/20] serial: stm32: add debugfs Bich HEMON
2017-06-26 12:49 ` [PATCH 04/20] serial: stm32: make fifoen as property for each port Bich HEMON
2017-06-26 12:49 ` [PATCH 06/20] serial: stm32: fix pio transmit timeout Bich HEMON
2017-06-26 12:49 ` [PATCH 07/20] serial: stm32: less messages on dma alloc error Bich HEMON
2017-06-26 12:49 ` [PATCH 09/20] serial: stm32: fix end of transfer Bich HEMON
2017-06-26 12:49 ` [PATCH 08/20] serial: stm32: timeout interrupt using with dma Bich HEMON
2017-06-26 12:49 ` [PATCH 12/20] serial: stm32: fix last_res value Bich HEMON
2017-06-26 12:49 ` [PATCH 11/20] serial: stm32: add RTS support Bich HEMON
     [not found] ` <1498481318-1894-1-git-send-email-bich.hemon-qxv4g6HH51o@public.gmane.org>
2017-06-26 12:49   ` Bich HEMON [this message]
2017-06-26 12:49   ` [PATCH 10/20] serial: stm32: fix dma receive Bich HEMON
2017-06-26 12:49   ` [PATCH 13/20] serial: stm32: fix error handling in probe Bich HEMON
2017-06-29 14:50     ` Greg Kroah-Hartman
2017-06-26 12:49   ` [PATCH 14/20] dt-bindings: serial: document option wake-up interrupt for STM32 USART Bich HEMON
     [not found]     ` <1498481318-1894-15-git-send-email-bich.hemon-qxv4g6HH51o@public.gmane.org>
2017-06-28 18:10       ` Rob Herring
2017-06-29 14:50     ` Greg Kroah-Hartman
2017-06-26 12:49   ` [PATCH 15/20] serial: stm32: Add wakeup mechanism Bich HEMON
2017-06-26 12:49   ` [PATCH 17/20] dt-bindings: serial: stm32: add dma using note Bich HEMON
     [not found]     ` <1498481318-1894-18-git-send-email-bich.hemon-qxv4g6HH51o@public.gmane.org>
2017-06-28 22:26       ` Rob Herring
2017-06-29 14:50       ` Greg Kroah-Hartman
2017-06-26 12:49   ` [PATCH 20/20] serial: stm32: fix rx interrupt handling in startup Bich HEMON
2017-06-29 15:09   ` [PATCH 00/20] Update STM32 usart driver Alexandre Torgue
2017-06-26 12:49 ` [PATCH 16/20] serial: stm32: fix fifo usage Bich HEMON
2017-06-26 12:49 ` [PATCH 18/20] serial: stm32: update dma buffers length Bich HEMON
2017-06-26 12:49 ` [PATCH 19/20] serial: stm32: add dma rx callback Bich HEMON

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=1498481318-1894-4-git-send-email-bich.hemon@st.com \
    --to=bich.hemon-qxv4g6hh51o@public.gmane.org \
    --cc=alexandre.torgue-qxv4g6HH51o@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=jslaby-IBi9RG/b67k@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=mcoquelin.stm32-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@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;
as well as URLs for NNTP newsgroup(s).