lkml.org 
[lkml]   [2007]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 4/5] atmel_serial: Split the interrupt handler
On 12/18/2007 06:06 PM, Haavard Skinnemoen wrote:
> From: Remy Bohmer <hskinnemoen@atmel.com>
>
> This patch splits up the interrupt handler of the serial port
> into a interrupt top-half and a tasklet.
[...]
> [hskinnemoen@atmel.com: misc cleanups and simplifications]
> Signed-off-by: Remy Bohmer <linux@bohmer.net>
> Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
> ---
> 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);
> }
>


\
 
 \ /
  Last update: 2007-12-19 00:19    [W:1.500 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site