Skip to content

Commit

Permalink
drivers/tty/serial/sirfsoc_uart.c: drop frees of devm_ alloc'd data
Browse files Browse the repository at this point in the history
devm free functions should not have to be explicitly used.

A semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
@@

(
* devm_kfree(...);
|
* devm_free_irq(...);
|
* devm_iounmap(...);
|
* devm_release_region(...);
|
* devm_release_mem_region(...);
)
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Julia Lawall authored and Greg Kroah-Hartman committed Sep 5, 2012
1 parent d3dec96 commit 9250dd5
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/tty/serial/sirfsoc_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,15 +668,15 @@ int sirfsoc_uart_probe(struct platform_device *pdev)
if (res == NULL) {
dev_err(&pdev->dev, "Insufficient resources.\n");
ret = -EFAULT;
goto irq_err;
goto err;
}
port->irq = res->start;

if (sirfport->hw_flow_ctrl) {
sirfport->p = pinctrl_get_select_default(&pdev->dev);
ret = IS_ERR(sirfport->p);
if (ret)
goto pin_err;
goto err;
}

port->ops = &sirfsoc_uart_ops;
Expand All @@ -695,9 +695,6 @@ int sirfsoc_uart_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, NULL);
if (sirfport->hw_flow_ctrl)
pinctrl_put(sirfport->p);
pin_err:
irq_err:
devm_iounmap(&pdev->dev, port->membase);
err:
return ret;
}
Expand All @@ -709,7 +706,6 @@ static int sirfsoc_uart_remove(struct platform_device *pdev)
platform_set_drvdata(pdev, NULL);
if (sirfport->hw_flow_ctrl)
pinctrl_put(sirfport->p);
devm_iounmap(&pdev->dev, port->membase);
uart_remove_one_port(&sirfsoc_uart_drv, port);
return 0;
}
Expand Down

0 comments on commit 9250dd5

Please sign in to comment.