Re: [PATCH 4/5] atmel_serial: Split the interrupt handler

From: Jiri Slaby
Date: Tue Dec 18 2007 - 18:15:45 EST


On 12/18/2007 06:06 PM, Haavard Skinnemoen wrote:
> From: Remy Bohmer <hskinnemoen@xxxxxxxxx>
>
> This patch splits up the interrupt handler of the serial port
> into a interrupt top-half and a tasklet.
[...]
> [hskinnemoen@xxxxxxxxx: misc cleanups and simplifications]
> Signed-off-by: Remy Bohmer <linux@xxxxxxxxxx>
> Signed-off-by: Haavard Skinnemoen <hskinnemoen@xxxxxxxxx>
> ---
> drivers/serial/atmel_serial.c | 215 ++++++++++++++++++++++++++++++++---------
> 1 files changed, 169 insertions(+), 46 deletions(-)
>
> diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c
> index a6b3828..990d3ab 100644
> --- a/drivers/serial/atmel_serial.c
> +++ b/drivers/serial/atmel_serial.c
[...]
> @@ -994,11 +1108,19 @@ static int atmel_serial_resume(struct platform_device *pdev)
> static int __devinit atmel_serial_probe(struct platform_device *pdev)
> {
> struct atmel_uart_port *port;
> + void *data;
> int ret;
>
> + BUILD_BUG_ON(!is_power_of_2(ATMEL_SERIAL_RINGSIZE));
> +
> port = &atmel_ports[pdev->id];
> atmel_init_port(port, pdev);
>
> + data = kmalloc(ATMEL_SERIAL_RINGSIZE, GFP_KERNEL);
> + if (!data)

{
clk_disable(atmel_port->clk);
clk_put(atmel_port->clk);


> + return -ENOMEM;

}

> + port->rx_ring.buf = data;
> +
> ret = uart_add_one_port(&atmel_uart, &port->uart);
> if (!ret) {
> device_init_wakeup(&pdev->dev, 1);
> @@ -1022,6 +1144,7 @@ static int __devexit atmel_serial_remove(struct platform_device *pdev)
>
> if (port) {
> ret = uart_remove_one_port(&atmel_uart, port);

Don't you need tasklet_kill() here (or somewhere)?

> + kfree(atmel_port->rx_ring.buf);
> kfree(port);
> }
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/