Re: [U-Boot] [PATCH] stm32f4: fix serial output

2015-04-27 Thread Kamil Lulko
2015-04-24 21:27 GMT+02:00 kunhuahuang :
> This patch fix the serial output.
> The source is from Kamil Lulko's "stm32f429-discovery board support"
>
> Signed-off-by: kunhuahuang 
> ---
>  drivers/serial/serial_stm32.c | 4 
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/serial/serial_stm32.c b/drivers/serial/serial_stm32.c
> index 3c80096..693a7fa 100644
> --- a/drivers/serial/serial_stm32.c
> +++ b/drivers/serial/serial_stm32.c
> @@ -81,6 +81,10 @@ static int stm32_serial_getc(void)
>  static void stm32_serial_putc(const char c)
>  {
> struct stm32_serial *usart = (struct stm32_serial *)USART_BASE;
> +
> +   if(c == '\n')
> +   stm32_serial_putc('\r');
> +
> while ((readl(&usart->sr) & USART_SR_FLAG_TXE) == 0)
> ;
> writel(c, &usart->dr);
> --
> 1.9.1
>
>

Please fix checkpatch.pl error:

ERROR: space required before the open parenthesis '('
#26: FILE: drivers/serial/serial_stm32.c:85:
+ if(c == '\n')

total: 1 errors, 0 warnings, 0 checks, 10 lines checked

Other than that looks good!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] stm32f4: fix serial output

2015-04-24 Thread kunhuahuang
Signed-off-by: kunhuahuang 
---
 drivers/serial/serial_stm32.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/serial/serial_stm32.c b/drivers/serial/serial_stm32.c
index 3c80096..693a7fa 100644
--- a/drivers/serial/serial_stm32.c
+++ b/drivers/serial/serial_stm32.c
@@ -81,6 +81,10 @@ static int stm32_serial_getc(void)
 static void stm32_serial_putc(const char c)
 {
struct stm32_serial *usart = (struct stm32_serial *)USART_BASE;
+
+   if(c == '\n')
+   stm32_serial_putc('\r');
+
while ((readl(&usart->sr) & USART_SR_FLAG_TXE) == 0)
;
writel(c, &usart->dr);
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot