LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Leilei Zhao <leilei.zhao@atmel.com>
To: <nicolas.ferre@atmel.com>, <gregkh@linuxfoundation.org>,
	<linux-serial@vger.kernel.org>, <jslaby@suse.cz>
Cc: <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	Leilei Zhao <leilei.zhao@atmel.com>
Subject: [PATCH 3/5] tty/serial: at91: revise the return type of atmel_init_property
Date: Thu, 26 Feb 2015 14:55:23 +0800	[thread overview]
Message-ID: <1424933725-16242-4-git-send-email-leilei.zhao@atmel.com> (raw)
In-Reply-To: <1424933725-16242-1-git-send-email-leilei.zhao@atmel.com>

The function of atmel_init_property is to set the work manner of
atmel serial ports according to the property in device trees.
If DMA or PDC is not set or something goes wrong in getting property,
the work manner will switch to general PIO mode, thus there will
not be any failure case in this function. It's actually a procedure.
So changing the return type from int to void.

Signed-off-by: Leilei Zhao <leilei.zhao@atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 drivers/tty/serial/atmel_serial.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 6a4d44d..30a62cd 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1534,7 +1534,7 @@ static void atmel_tasklet_func(unsigned long data)
 	spin_unlock(&port->lock);
 }
 
-static int atmel_init_property(struct atmel_uart_port *atmel_port,
+static void atmel_init_property(struct atmel_uart_port *atmel_port,
 				struct platform_device *pdev)
 {
 	struct device_node *np = pdev->dev.of_node;
@@ -1575,7 +1575,6 @@ static int atmel_init_property(struct atmel_uart_port *atmel_port,
 		atmel_port->use_dma_tx  = false;
 	}
 
-	return 0;
 }
 
 static void atmel_init_rs485(struct uart_port *port,
@@ -2235,8 +2234,8 @@ static int atmel_init_port(struct atmel_uart_port *atmel_port,
 	struct uart_port *port = &atmel_port->uart;
 	struct atmel_uart_data *pdata = dev_get_platdata(&pdev->dev);
 
-	if (!atmel_init_property(atmel_port, pdev))
-		atmel_set_ops(port);
+	atmel_init_property(atmel_port, pdev);
+	atmel_set_ops(port);
 
 	atmel_init_rs485(port, pdev);
 
-- 
1.7.9.5


  parent reply	other threads:[~2015-02-26  7:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-26  6:55 [PATCH 0/5] tty/serial: at91: fix bugs when using multiple serials Leilei Zhao
2015-02-26  6:55 ` [PATCH 1/5] tty/serial: at91: correct check of buf used in DMA Leilei Zhao
2015-02-26  9:29   ` Jiri Slaby
2015-02-27  7:38     ` Zhao, Leilei
2015-02-26  6:55 ` [PATCH 2/5] tty/serial: at91: correct buffer size " Leilei Zhao
2015-02-26  6:55 ` Leilei Zhao [this message]
2015-02-26  6:55 ` [PATCH 4/5] tty/serial: at91: set ops in property init each time Leilei Zhao
2015-02-26  6:55 ` [PATCH 5/5] tty/serial: at91: correct the usage of tasklet Leilei Zhao

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=1424933725-16242-4-git-send-email-leilei.zhao@atmel.com \
    --to=leilei.zhao@atmel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.cz \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=nicolas.ferre@atmel.com \
    --subject='Re: [PATCH 3/5] tty/serial: at91: revise the return type of atmel_init_property' \
    /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

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).