Commit 9250dd57 authored by Julia Lawall's avatar Julia Lawall Committed by Greg Kroah-Hartman

drivers/tty/serial/sirfsoc_uart.c: drop frees of devm_ alloc'd data

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: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d3dec96e
...@@ -668,7 +668,7 @@ int sirfsoc_uart_probe(struct platform_device *pdev) ...@@ -668,7 +668,7 @@ int sirfsoc_uart_probe(struct platform_device *pdev)
if (res == NULL) { if (res == NULL) {
dev_err(&pdev->dev, "Insufficient resources.\n"); dev_err(&pdev->dev, "Insufficient resources.\n");
ret = -EFAULT; ret = -EFAULT;
goto irq_err; goto err;
} }
port->irq = res->start; port->irq = res->start;
...@@ -676,7 +676,7 @@ int sirfsoc_uart_probe(struct platform_device *pdev) ...@@ -676,7 +676,7 @@ int sirfsoc_uart_probe(struct platform_device *pdev)
sirfport->p = pinctrl_get_select_default(&pdev->dev); sirfport->p = pinctrl_get_select_default(&pdev->dev);
ret = IS_ERR(sirfport->p); ret = IS_ERR(sirfport->p);
if (ret) if (ret)
goto pin_err; goto err;
} }
port->ops = &sirfsoc_uart_ops; port->ops = &sirfsoc_uart_ops;
...@@ -695,9 +695,6 @@ int sirfsoc_uart_probe(struct platform_device *pdev) ...@@ -695,9 +695,6 @@ int sirfsoc_uart_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
if (sirfport->hw_flow_ctrl) if (sirfport->hw_flow_ctrl)
pinctrl_put(sirfport->p); pinctrl_put(sirfport->p);
pin_err:
irq_err:
devm_iounmap(&pdev->dev, port->membase);
err: err:
return ret; return ret;
} }
...@@ -709,7 +706,6 @@ static int sirfsoc_uart_remove(struct platform_device *pdev) ...@@ -709,7 +706,6 @@ static int sirfsoc_uart_remove(struct platform_device *pdev)
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
if (sirfport->hw_flow_ctrl) if (sirfport->hw_flow_ctrl)
pinctrl_put(sirfport->p); pinctrl_put(sirfport->p);
devm_iounmap(&pdev->dev, port->membase);
uart_remove_one_port(&sirfsoc_uart_drv, port); uart_remove_one_port(&sirfsoc_uart_drv, port);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment