Skip to contentSkip to conversation

atmel_serial: keep the platform_device unchanged

PATCH In review Jean-Christophe PLAGNIOL-VILLARD 5 participants 15 messages Apr 13, 2011 – Aug 10, 2011

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 atmel_serial: keep the platform_device unchanged

specify the port num via platform_data this will allow to match the clock with the plaform_dev staticly

Cc Nicolas Ferre <[email protected]>
Cc Patrice Vilchez <[email protected]>
Cc Hans-Christian Egtvedt <[email protected]>
Cc Alan Cox <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 arch/arm/mach-at91/at572d940hf_devices.c    |    4 +++-
 arch/arm/mach-at91/at91cap9_devices.c       |    4 +++-
 arch/arm/mach-at91/at91rm9200_devices.c     |    4 +++-
 arch/arm/mach-at91/at91sam9260_devices.c    |    4 +++-
 arch/arm/mach-at91/at91sam9261_devices.c    |    4 +++-
 arch/arm/mach-at91/at91sam9263_devices.c    |    4 +++-
 arch/arm/mach-at91/at91sam9g45_devices.c    |    4 +++-
 arch/arm/mach-at91/at91sam9rl_devices.c     |    4 +++-
 arch/arm/mach-at91/include/mach/board.h     |    1 +
 arch/avr32/mach-at32ap/at32ap700x.c         |    4 +++-
 arch/avr32/mach-at32ap/include/mach/board.h |    1 +
 drivers/tty/serial/atmel_serial.c           |    2 +-
 12 files changed, 30 insertions(+), 10 deletions(-)
arch/arm/mach-at91/at572d940hf_devices.c +3 -1
index 6e1b9a3..57ed4b7 100644
@@ -822,6 +822,7 @@ struct platform_device *atmel_default_console_device;	/* the serial console devi
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (id) {
 		case 0:		/* DBGU */
@@ -847,7 +848,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 		default:
 			return;
 	}
-	pdev->id = portnr;		/* update to mapped ID */
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;		/* update to mapped ID */
 
 	if (portnr < ATMEL_MAX_UART)
 		at91_uarts[portnr] = pdev;
arch/arm/mach-at91/at91cap9_devices.c +3 -1
index e887632..ad41039 100644
@@ -1199,6 +1199,7 @@ struct platform_device *atmel_default_console_device;	/* the serial console devi
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (id) {
 		case 0:		/* DBGU */
@@ -1224,7 +1225,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 		default:
 			return;
 	}
-	pdev->id = portnr;		/* update to mapped ID */
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;		/* update to mapped ID */
 
 	if (portnr < ATMEL_MAX_UART)
 		at91_uarts[portnr] = pdev;
arch/arm/mach-at91/at91rm9200_devices.c +3 -1
index 5f873d5..f65f9d3 100644
@@ -1109,6 +1109,7 @@ struct platform_device *atmel_default_console_device;	/* the serial console devi
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (id) {
 		case 0:		/* DBGU */
@@ -1139,7 +1140,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 		default:
 			return;
 	}
-	pdev->id = portnr;		/* update to mapped ID */
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;		/* update to mapped ID */
 
 	if (portnr < ATMEL_MAX_UART)
 		at91_uarts[portnr] = pdev;
arch/arm/mach-at91/at91sam9260_devices.c +3 -1
index e172b46..bb74c2a 100644
@@ -1139,6 +1139,7 @@ struct platform_device *atmel_default_console_device;	/* the serial console devi
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (id) {
 		case 0:		/* DBGU */
@@ -1179,7 +1180,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 		default:
 			return;
 	}
-	pdev->id = portnr;		/* update to mapped ID */
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;		/* update to mapped ID */
 
 	if (portnr < ATMEL_MAX_UART)
 		at91_uarts[portnr] = pdev;
arch/arm/mach-at91/at91sam9261_devices.c +3 -1
index 59fc483..8792f9b 100644
@@ -989,6 +989,7 @@ struct platform_device *atmel_default_console_device;	/* the serial console devi
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (id) {
 		case 0:		/* DBGU */
@@ -1014,7 +1015,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 		default:
 			return;
 	}
-	pdev->id = portnr;		/* update to mapped ID */
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;		/* update to mapped ID */
 
 	if (portnr < ATMEL_MAX_UART)
 		at91_uarts[portnr] = pdev;
arch/arm/mach-at91/at91sam9263_devices.c +3 -1
index 416613c..1fc6878 100644
@@ -1370,6 +1370,7 @@ struct platform_device *atmel_default_console_device;	/* the serial console devi
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (id) {
 		case 0:		/* DBGU */
@@ -1395,7 +1396,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 		default:
 			return;
 	}
-	pdev->id = portnr;		/* update to mapped ID */
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;		/* update to mapped ID */
 
 	if (portnr < ATMEL_MAX_UART)
 		at91_uarts[portnr] = pdev;
arch/arm/mach-at91/at91sam9g45_devices.c +3 -1
index 0867343..fd031ce 100644
@@ -1527,6 +1527,7 @@ struct platform_device *atmel_default_console_device;	/* the serial console devi
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (id) {
 		case 0:		/* DBGU */
@@ -1557,7 +1558,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 		default:
 			return;
 	}
-	pdev->id = portnr;		/* update to mapped ID */
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;		/* update to mapped ID */
 
 	if (portnr < ATMEL_MAX_UART)
 		at91_uarts[portnr] = pdev;
arch/arm/mach-at91/at91sam9rl_devices.c +3 -1
index 53aaa94..2d8d519 100644
@@ -1141,6 +1141,7 @@ struct platform_device *atmel_default_console_device;	/* the serial console devi
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (id) {
 		case 0:		/* DBGU */
@@ -1171,7 +1172,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 		default:
 			return;
 	}
-	pdev->id = portnr;		/* update to mapped ID */
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;		/* update to mapped ID */
 
 	if (portnr < ATMEL_MAX_UART)
 		at91_uarts[portnr] = pdev;
arch/arm/mach-at91/include/mach/board.h +1 -0
index d970420..ef10f32 100644
@@ -130,6 +130,7 @@ extern void __init at91_set_serial_console(unsigned portnr);
 extern struct platform_device *atmel_default_console_device;
 
 struct atmel_uart_data {
+	int			num;		/* port num */
 	short			use_dma_tx;	/* use transmit DMA? */
 	short			use_dma_rx;	/* use receive DMA? */
 	void __iomem		*regs;		/* virt. base address, if any */
arch/avr32/mach-at32ap/at32ap700x.c +3 -1
index bfc9d07..aa677e2 100644
@@ -1014,6 +1014,7 @@ static struct platform_device *__initdata at32_usarts[4];
 void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (hw_id) {
 	case 0:
@@ -1042,7 +1043,8 @@ void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
 		data->regs = (void __iomem *)pdev->resource[0].start;
 	}
 
-	pdev->id = line;
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;
 	at32_usarts[line] = pdev;
 }
 
arch/avr32/mach-at32ap/include/mach/board.h +1 -0
index 3d79356..dd61a24 100644
@@ -34,6 +34,7 @@ extern struct platform_device *atmel_default_console_device;
 #define	ATMEL_USART_CLK		0x04
 
 struct atmel_uart_data {
+	int		num;		/* port num */
 	short		use_dma_tx;	/* use transmit DMA? */
 	short		use_dma_rx;	/* use receive DMA? */
 	void __iomem	*regs;		/* virtual base address, if any */
drivers/tty/serial/atmel_serial.c +1 -1
index 2dc8a66..57e294c 100644
@@ -1423,7 +1423,7 @@ static int __devinit atmel_init_port(struct atmel_uart_port *atmel_port,
 	port->flags		= UPF_BOOT_AUTOCONF;
 	port->ops		= &atmel_pops;
 	port->fifosize		= 1;
-	port->line		= pdev->id;
+	port->line		= data->num;
 	port->dev		= &pdev->dev;
 	port->mapbase	= pdev->resource[0].start;
 	port->irq	= pdev->resource[1].start;
Signature · 1 line
1.7.4.1
#1 lore raw
Quoted 9 lines · On Wed, 13 Apr 2011 21:47:18 +0200 Jean-Christophe PLAGNIOL-VILLARD…

specify the port num via platform_data this will allow to match the clock with the plaform_dev staticly

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> Cc: Nicolas Ferre <[email protected]>
Cc: Patrice Vilchez <[email protected]>
Cc: Hans-Christian Egtvedt <[email protected]>
Cc: Alan Cox <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>

Ack for the serial side, its really an arch patch though as far as I can see..

#2 lore raw
Quoted 13 lines · Alan Cox
Quoted 9 lines · On Wed, 13 Apr 2011 21:47:18 +0200 Jean-Christophe PLAGNIOL-VILLARD…

specify the port num via platform_data this will allow to match the clock with the plaform_dev staticly

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> Cc: Nicolas Ferre <[email protected]>
Cc: Patrice Vilchez <[email protected]>
Cc: Hans-Christian Egtvedt <[email protected]>
Cc: Alan Cox <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>

Quoted 2 lines

Ack for the serial side, its really an arch patch though as far as I can see..

applied in at91-l2

Best Regards,
J.

#3 lore raw
In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 2 lines · Jean-Christophe PLAGNIOL-VILLARD

specify the port num via platform_data this will allow to match the clock with the plaform_dev staticly

Sure this works as intended, now the platform device id is off, and at least for my 3.0 testing it is no longer able to open the console, unless I explicit set the id field again.

Example on NGW100 mkII I use USART instance 1 as serial console, if not setting the platform device id to 0 (re-mapping), then I get a warning about unable to open console.

Is you clock optimization an additional patch?

<snipp AT91 changes)

Quoted 13 lines
arch/avr32/mach-at32ap/at32ap700x.c +1 -0
index bfc9d07..aa677e2 100644
@@ -1014,6 +1014,7 @@ static struct platform_device *__initdata at32_usarts[4];
 void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (hw_id) {
 	case 0:

arch/avr32/mach-at32ap/at32ap700x.c void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags) · line 1045

Quoted 4 lines
arch/avr32/mach-at32ap/at32ap700x.c +0 -1
@@ -1042,7 +1043,8 @@ void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
 		data->regs = (void __iomem *)pdev->resource[0].start;
 	}
 
-	pdev->id = line;

AVR32 needs this to be present to work independent of which USART peripheral the user chooses to use for console.

arch/avr32/mach-at32ap/at32ap700x.c void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags) · line 1050

Quoted 5 lines
arch/avr32/mach-at32ap/at32ap700x.c +2 -0
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;
 	at32_usarts[line] = pdev;
 }
 

<snipp>

Signature · 1 line
Hans-Christian Egtvedt
#4 lore raw
Quoted 9 lines · Hans-Christian Egtvedt
Quoted 2 lines · Jean-Christophe PLAGNIOL-VILLARD

specify the port num via platform_data this will allow to match the clock with the plaform_dev staticly

Sure this works as intended, now the platform device id is off, and at least for my 3.0 testing it is no longer able to open the console, unless I explicit set the id field again.

Quoted 5 lines

Example on NGW100 mkII I use USART instance 1 as serial console, if not setting the platform device id to 0 (re-mapping), then I get a warning about unable to open console.

Is you clock optimization an additional patch?

no but we can also switch the avr32 to clkdev

Quoted 19 lines

<snipp AT91 changes)

Quoted 16 lines
arch/avr32/mach-at32ap/at32ap700x.c +1 -0
index bfc9d07..aa677e2 100644
@@ -1014,6 +1014,7 @@ static struct platform_device *__initdata at32_usarts[4];
 void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (hw_id) {
 	case 0:
@@ -1042,7 +1043,8 @@ void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
 		data->regs = (void __iomem *)pdev->resource[0].start;
 	}
 
Quoted 7 lines

arch/avr32/mach-at32ap/at32ap700x.c void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags) · line 1045

Quoted 1 line
arch/avr32/mach-at32ap/at32ap700x.c +0 -1
-	pdev->id = line;

AVR32 needs this to be present to work independent of which USART peripheral the user chooses to use for console.

arch/avr32/mach-at32ap/at32ap700x.c void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags) · line 1047

Quoted 2 lines
arch/avr32/mach-at32ap/at32ap700x.c +2 -0
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;

here supposed to be

	pdata->num = line;

Best Regards,
J.

#5 lore raw
Quoted 3 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 2 lines · Hans-Christian Egtvedt

On Wed, 2011-04-13 at 21:47 +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:

<snipp>

Quoted 21 lines
Quoted 21 lines
Quoted 13 lines
arch/avr32/mach-at32ap/at32ap700x.c +1 -0
index bfc9d07..aa677e2 100644
@@ -1014,6 +1014,7 @@ static struct platform_device *__initdata at32_usarts[4];
 void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (hw_id) {
 	case 0:

arch/avr32/mach-at32ap/at32ap700x.c void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags) · line 1045

Quoted 4 lines
arch/avr32/mach-at32ap/at32ap700x.c +0 -1
@@ -1042,7 +1043,8 @@ void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
 		data->regs = (void __iomem *)pdev->resource[0].start;
 	}
 
-	pdev->id = line;

AVR32 needs this to be present to work independent of which USART peripheral the user chooses to use for console.

Quoted 4 lines
Quoted 2 lines

arch/avr32/mach-at32ap/at32ap700x.c void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags) · line 1047

Quoted 2 lines
arch/avr32/mach-at32ap/at32ap700x.c +2 -0
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;

here supposed to be

	pdata->num = line;

I know, but that doesn't fix the problem about not able to find a console, the platform data id must also be 0 (if console is on ttyS0) AFAICT.

Signature · 1 line
Hans-Christian Egtvedt
#6 lore raw
Quoted 29 lines · Hans-Christian Egtvedt
Quoted 3 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 2 lines · Hans-Christian Egtvedt

On Wed, 2011-04-13 at 21:47 +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:

<snipp>

Quoted 21 lines
Quoted 21 lines
Quoted 13 lines
arch/avr32/mach-at32ap/at32ap700x.c +1 -0
index bfc9d07..aa677e2 100644
@@ -1014,6 +1014,7 @@ static struct platform_device *__initdata at32_usarts[4];
 void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (hw_id) {
 	case 0:

arch/avr32/mach-at32ap/at32ap700x.c void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags) · line 1045

Quoted 4 lines
arch/avr32/mach-at32ap/at32ap700x.c +0 -1
@@ -1042,7 +1043,8 @@ void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
 		data->regs = (void __iomem *)pdev->resource[0].start;
 	}
 
-	pdev->id = line;

AVR32 needs this to be present to work independent of which USART peripheral the user chooses to use for console.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

arch/avr32/mach-at32ap/at32ap700x.c void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags) · line 1047

Quoted 2 lines
arch/avr32/mach-at32ap/at32ap700x.c +2 -0
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;

here supposed to be

	pdata->num = line;

I know, but that doesn't fix the problem about not able to find a console, the platform data id must also be 0 (if console is on ttyS0) AFAICT.

will test this weekend on avr32

Best Regards,
J.

#7 lore raw
In reply to Hans-Christian Egtvedt
Quoted 29 lines · Hans-Christian Egtvedt
Quoted 3 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 2 lines · Hans-Christian Egtvedt

On Wed, 2011-04-13 at 21:47 +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:

<snipp>

Quoted 21 lines
Quoted 21 lines
Quoted 13 lines
arch/avr32/mach-at32ap/at32ap700x.c +1 -0
index bfc9d07..aa677e2 100644
@@ -1014,6 +1014,7 @@ static struct platform_device *__initdata at32_usarts[4];
 void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
 {
 	struct platform_device *pdev;
+	struct atmel_uart_data *pdata;
 
 	switch (hw_id) {
 	case 0:

arch/avr32/mach-at32ap/at32ap700x.c void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags) · line 1045

Quoted 4 lines
arch/avr32/mach-at32ap/at32ap700x.c +0 -1
@@ -1042,7 +1043,8 @@ void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags)
 		data->regs = (void __iomem *)pdev->resource[0].start;
 	}
 
-	pdev->id = line;

AVR32 needs this to be present to work independent of which USART peripheral the user chooses to use for console.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

arch/avr32/mach-at32ap/at32ap700x.c void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags) · line 1047

Quoted 2 lines
arch/avr32/mach-at32ap/at32ap700x.c +2 -0
+	pdata = pdev->dev.platform_data;
+	pdata->num = portnr;

here supposed to be

	pdata->num = line;

I know, but that doesn't fix the problem about not able to find a console, the platform data id must also be 0 (if console is on ttyS0) AFAICT.

I found the issue
on at91 we always use the dbgu as console so I did not see it

please try to repling patch

Best Regards,
J.

#8 lore raw

PATCH 1/1 atmel_serial: fix internal port num

In reply to Hans-Christian Egtvedt

the atmel_ports is link to the console number and not the device id

this was not detected on at91 as we always register the dbgu on the console as ttyS0

tested on at91sam9263 by setting the dbgu as ttyS1 and use as console

arch/arm/mach-at91/board-sam9263ek.c +0 -0
index 70e5646..9b8a14f 100644

- a/arch/arm/mach-at91/board-sam9263ek.c
+ b/arch/arm/mach-at91/board-sam9263ek.c
@@ -58,14 +58,14 @@ static void __init ek_init_early(void)

        /* Initialize processor: 16.367 MHz crystal */
        at91_initialize(16367660);
-       /* DBGU on ttyS0. (Rx & Tx only) */
-       at91_register_uart(0, 0, 0);
+       /* DBGU on ttyS1. (Rx & Tx only) */
+       at91_register_uart(0, 1, 0);
-       /* USART0 on ttyS1. (Rx, Tx, RTS, CTS) */
-       at91_register_uart(AT91SAM9263_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS);
+       /* USART0 on ttyS0. (Rx, Tx, RTS, CTS) */
+       at91_register_uart(AT91SAM9263_ID_US0, 0, ATMEL_UART_CTS | ATMEL_UART_RTS);
-       /* set serial console to ttyS0 (ie, DBGU) */
-       at91_set_serial_console(0);
+       /* set serial console to ttyS1 (ie, DBGU) */
+       at91_set_serial_console(1);

}

/*

Cc Nicolas Ferre <[email protected]>
Cc Alan Cox <[email protected]>
Cc Hans-Christian Egtvedt <[email protected]>
---
 drivers/tty/serial/atmel_serial.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/tty/serial/atmel_serial.c +2 -1
index 6d5d6e6..af9b781 100644
@@ -1709,12 +1709,13 @@ static int atmel_serial_resume(struct platform_device *pdev)
 static int __devinit atmel_serial_probe(struct platform_device *pdev)
 {
 	struct atmel_uart_port *port;
+	struct atmel_uart_data *pdata = pdev->dev.platform_data;
 	void *data;
 	int ret;
 
 	BUILD_BUG_ON(ATMEL_SERIAL_RINGSIZE & (ATMEL_SERIAL_RINGSIZE - 1));
 
-	port = &atmel_ports[pdev->id];
+	port = &atmel_ports[pdata->num];
 	port->backup_imr = 0;
 
 	atmel_init_port(port, pdev);
Signature · 1 line
1.7.4.1
#9 lore raw

PATCH 1/1 atmel_serial: fix atmel_default_console_device

reflect new static uart platform ids introduced by patch
http://article.gmane.org/gmane.linux.kernel/1126105

---
 drivers/tty/serial/atmel_serial.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
\ renamed from drivers/tty/serial/atmel_serial.c +0 -0

b/drivers/tty/serial/atmel_serial.c
index af9b781..29c7857 100644

drivers/tty/serial/atmel_serial.c +4 -3
@@ -1609,9 +1609,10 @@ static struct console atmel_console = {
 static int __init atmel_console_init(void)
 {
 	if (atmel_default_console_device) {
-		add_preferred_console(ATMEL_DEVICENAME,
-				      atmel_default_console_device->id, NULL);
-		atmel_init_port(&atmel_ports[atmel_default_console_device->id],
+		struct atmel_uart_data *pdata =
+			atmel_default_console_device->dev.platform_data;
+		add_preferred_console(ATMEL_DEVICENAME, pdata->num, NULL);
+		atmel_init_port(&atmel_ports[pdata->num],
 				atmel_default_console_device);
 		register_console(&atmel_console);
 	}
Signature · 1 line
1.7.4.1
#10 lore raw

PATCH 1/1 atmel_serial: fix atmel_default_console_device

Hello.

Quoted 15 lines · Nikolaus Voss

reflect new static uart platform ids introduced by patch
http://article.gmane.org/gmane.linux.kernel/1126105

---
  drivers/tty/serial/atmel_serial.c |    7 ++++---
  1 files changed, 4 insertions(+), 3 deletions(-)
\ renamed from drivers/tty/serial/atmel_serial.c +0 -0

b/drivers/tty/serial/atmel_serial.c
index af9b781..29c7857 100644

drivers/tty/serial/atmel_serial.c static struct console atmel_console = { · line 1613

Quoted 8 lines
drivers/tty/serial/atmel_serial.c +2 -3
@@ -1609,9 +1609,10 @@ static struct console atmel_console = {
  static int __init atmel_console_init(void)
  {
  	if (atmel_default_console_device) {
-		add_preferred_console(ATMEL_DEVICENAME,
-				      atmel_default_console_device->id, NULL);
-		atmel_init_port(&atmel_ports[atmel_default_console_device->id],
+		struct atmel_uart_data *pdata =
+			atmel_default_console_device->dev.platform_data;

Would be good to have empty line after the declaration...

drivers/tty/serial/atmel_serial.c static struct console atmel_console = { · line 1618

Quoted 5 lines
drivers/tty/serial/atmel_serial.c +2 -0
+		add_preferred_console(ATMEL_DEVICENAME, pdata->num, NULL);
+		atmel_init_port(&atmel_ports[pdata->num],
  				atmel_default_console_device);
  		register_console(&atmel_console);
  	}

WBR, Sergei

#11 lore raw

PATCH 1/1 atmel_serial: fix atmel_default_console_device

reflect new static uart platform ids introduced by patch
http://article.gmane.org/gmane.linux.kernel/1126105

---
 drivers/tty/serial/atmel_serial.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
drivers/tty/serial/atmel_serial.c +5 -3
index af9b781..b922f5d 100644
@@ -1609,9 +1609,11 @@ static struct console atmel_console = {
 static int __init atmel_console_init(void)
 {
 	if (atmel_default_console_device) {
-		add_preferred_console(ATMEL_DEVICENAME,
-				      atmel_default_console_device->id, NULL);
-		atmel_init_port(&atmel_ports[atmel_default_console_device->id],
+		struct atmel_uart_data *pdata =
+			atmel_default_console_device->dev.platform_data;
+
+		add_preferred_console(ATMEL_DEVICENAME, pdata->num, NULL);
+		atmel_init_port(&atmel_ports[pdata->num],
 				atmel_default_console_device);
 		register_console(&atmel_console);
 	}
Signature · 1 line
1.7.4.1
#12 lore raw

PATCH 1/1 atmel_serial: fix atmel_default_console_device

In reply to Sergei Shtylyov

Thanks, patch resent.

Niko

Quoted 44 lines

-----Original Message-----
From: Sergei Shtylyov [mailto:sshtylyov at mvista.com]
Sent: Tuesday, August 09, 2011 1:42 PM
To: Voss, Nikolaus
Cc: linux-arm-kernel at lists.infradead.org
Subject: Re: [PATCH] atmel_serial: fix atmel_default_console_device

Hello.

Quoted 15 lines · Nikolaus Voss

reflect new static uart platform ids introduced by patch
http://article.gmane.org/gmane.linux.kernel/1126105

---
  drivers/tty/serial/atmel_serial.c |    7 ++++---
  1 files changed, 4 insertions(+), 3 deletions(-)
\ renamed from drivers/tty/serial/atmel_serial.c +0 -0

b/drivers/tty/serial/atmel_serial.c
index af9b781..29c7857 100644

drivers/tty/serial/atmel_serial.c static struct console atmel_console = { · line 1613

Quoted 8 lines
drivers/tty/serial/atmel_serial.c +2 -3
@@ -1609,9 +1609,10 @@ static struct console atmel_console = {
  static int __init atmel_console_init(void)
  {
  	if (atmel_default_console_device) {
-		add_preferred_console(ATMEL_DEVICENAME,
-				      atmel_default_console_device->id, NULL);
-		atmel_init_port(&atmel_ports[atmel_default_console_device->id],
+		struct atmel_uart_data *pdata =
+			atmel_default_console_device->dev.platform_data;

Would be good to have empty line after the declaration...

drivers/tty/serial/atmel_serial.c static struct console atmel_console = { · line 1618

Quoted 5 lines
drivers/tty/serial/atmel_serial.c +2 -0
+		add_preferred_console(ATMEL_DEVICENAME, pdata->num, NULL);
+		atmel_init_port(&atmel_ports[pdata->num],
  				atmel_default_console_device);
  		register_console(&atmel_console);
  	}

WBR, Sergei

#13 lore raw

PATCH 1/1 atmel_serial: fix atmel_default_console_device

Hello.

Quoted 1 line · Nikolaus

Thanks, patch resent.

You then should have marked the new version in the subject (like "[PATCH
v2]"), and described the changes from the previous version under the --- tear line...

Quoted 1 line

Niko

WBR, Sergei

#14 lore raw

PATCH v2 1/1 atmel_serial: fix atmel_default_console_device

reflect new static uart platform ids introduced by patch
http://article.gmane.org/gmane.linux.kernel/1126105

---
Updated with Sergei's comment.

 drivers/tty/serial/atmel_serial.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
drivers/tty/serial/atmel_serial.c +5 -3
index af9b781..b922f5d 100644
@@ -1609,9 +1609,11 @@ static struct console atmel_console = {
 static int __init atmel_console_init(void)
 {
 	if (atmel_default_console_device) {
-		add_preferred_console(ATMEL_DEVICENAME,
-				      atmel_default_console_device->id, NULL);
-		atmel_init_port(&atmel_ports[atmel_default_console_device->id],
+		struct atmel_uart_data *pdata =
+			atmel_default_console_device->dev.platform_data;
+
+		add_preferred_console(ATMEL_DEVICENAME, pdata->num, NULL);
+		atmel_init_port(&atmel_ports[pdata->num],
 				atmel_default_console_device);
 		register_console(&atmel_console);
 	}
Signature · 1 line
1.7.4.1