* [PATCH 1/2] serial/efm32-uart: don't use pdev->id to determine the port's line
@ 2013-07-17 6:48 Uwe Kleine-König
2013-07-17 6:48 ` [PATCH 2/2] serial/efm32-uart: use COMPILE_TEST symbol to extend compile test coverage Uwe Kleine-König
2013-07-26 23:05 ` [PATCH 1/2] serial/efm32-uart: don't use pdev->id to determine the port's line Greg Kroah-Hartman
0 siblings, 2 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2013-07-17 6:48 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-serial
pdev->id is not a valid choice for device-tree probed devices. So use
the (properly determined) line from efm32_uart_probe consistenly.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/tty/serial/efm32-uart.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/tty/serial/efm32-uart.c b/drivers/tty/serial/efm32-uart.c
index 7d199c8..cc77970 100644
--- a/drivers/tty/serial/efm32-uart.c
+++ b/drivers/tty/serial/efm32-uart.c
@@ -698,6 +698,7 @@ static int efm32_uart_probe(struct platform_device *pdev)
{
struct efm32_uart_port *efm_port;
struct resource *res;
+ unsigned int line;
int ret;
efm_port = kzalloc(sizeof(*efm_port), GFP_KERNEL);
@@ -752,16 +753,17 @@ static int efm32_uart_probe(struct platform_device *pdev)
efm_port->pdata = *pdata;
}
- if (efm_port->port.line >= 0 &&
- efm_port->port.line < ARRAY_SIZE(efm32_uart_ports))
- efm32_uart_ports[efm_port->port.line] = efm_port;
+ line = efm_port->port.line;
+
+ if (line >= 0 && line < ARRAY_SIZE(efm32_uart_ports))
+ efm32_uart_ports[line] = efm_port;
ret = uart_add_one_port(&efm32_uart_reg, &efm_port->port);
if (ret) {
dev_dbg(&pdev->dev, "failed to add port: %d\n", ret);
- if (pdev->id >= 0 && pdev->id < ARRAY_SIZE(efm32_uart_ports))
- efm32_uart_ports[pdev->id] = NULL;
+ if (line >= 0 && line < ARRAY_SIZE(efm32_uart_ports))
+ efm32_uart_ports[line] = NULL;
err_get_rxirq:
err_too_small:
err_get_base:
@@ -777,13 +779,14 @@ err_get_base:
static int efm32_uart_remove(struct platform_device *pdev)
{
struct efm32_uart_port *efm_port = platform_get_drvdata(pdev);
+ unsigned int line = efm_port->port.line;
platform_set_drvdata(pdev, NULL);
uart_remove_one_port(&efm32_uart_reg, &efm_port->port);
- if (pdev->id >= 0 && pdev->id < ARRAY_SIZE(efm32_uart_ports))
- efm32_uart_ports[pdev->id] = NULL;
+ if (line >= 0 && line < ARRAY_SIZE(efm32_uart_ports))
+ efm32_uart_ports[line] = NULL;
kfree(efm_port);
--
1.8.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] serial/efm32-uart: use COMPILE_TEST symbol to extend compile test coverage
2013-07-17 6:48 [PATCH 1/2] serial/efm32-uart: don't use pdev->id to determine the port's line Uwe Kleine-König
@ 2013-07-17 6:48 ` Uwe Kleine-König
2013-07-26 23:05 ` [PATCH 1/2] serial/efm32-uart: don't use pdev->id to determine the port's line Greg Kroah-Hartman
1 sibling, 0 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2013-07-17 6:48 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-serial
The driver fails to build on x86 because writel_relaxed isn't available
there. That function exists on arm, arm64, avr32, hexagon, mips and sh,
but adding all these is overkill so stick to arm only.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/tty/serial/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 5e3d689..1e31d7d 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -1424,8 +1424,8 @@ config SERIAL_AR933X_NR_UARTS
to support.
config SERIAL_EFM32_UART
- tristate "EFM32 UART/USART port."
- depends on ARCH_EFM32
+ tristate "EFM32 UART/USART port"
+ depends on ARM && (ARCH_EFM32 || COMPILE_TEST)
select SERIAL_CORE
help
This driver support the USART and UART ports on
--
1.8.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] serial/efm32-uart: don't use pdev->id to determine the port's line
2013-07-17 6:48 [PATCH 1/2] serial/efm32-uart: don't use pdev->id to determine the port's line Uwe Kleine-König
2013-07-17 6:48 ` [PATCH 2/2] serial/efm32-uart: use COMPILE_TEST symbol to extend compile test coverage Uwe Kleine-König
@ 2013-07-26 23:05 ` Greg Kroah-Hartman
1 sibling, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2013-07-26 23:05 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: linux-serial
On Wed, Jul 17, 2013 at 08:48:40AM +0200, Uwe Kleine-König wrote:
> pdev->id is not a valid choice for device-tree probed devices. So use
> the (properly determined) line from efm32_uart_probe consistenly.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> drivers/tty/serial/efm32-uart.c | 17 ++++++++++-------
> 1 file changed, 10 insertions(+), 7 deletions(-)
This patch doesn't apply, care to redo it?
thanks,
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-07-26 23:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-17 6:48 [PATCH 1/2] serial/efm32-uart: don't use pdev->id to determine the port's line Uwe Kleine-König
2013-07-17 6:48 ` [PATCH 2/2] serial/efm32-uart: use COMPILE_TEST symbol to extend compile test coverage Uwe Kleine-König
2013-07-26 23:05 ` [PATCH 1/2] serial/efm32-uart: don't use pdev->id to determine the port's line Greg Kroah-Hartman
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).