diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2014-11-27 14:08:33 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-01-09 17:12:27 -0500 |
commit | 9e5df9f88c5d874a9154e137a2e99413750540cd (patch) | |
tree | 90ee53cd456c3a39f95a0c76be998abadb37bff1 | |
parent | 75beb268550d11e66c372dd6da309dce659da7f7 (diff) |
serial: mxs-auart: Use devm_request_irq()
By using devm_request_irq() we can have a shorter and cleaner code.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/mxs-auart.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c index 9309082e4937..1e9fb370600b 100644 --- a/drivers/tty/serial/mxs-auart.c +++ b/drivers/tty/serial/mxs-auart.c | |||
@@ -1268,7 +1268,8 @@ static int mxs_auart_probe(struct platform_device *pdev) | |||
1268 | 1268 | ||
1269 | s->irq = platform_get_irq(pdev, 0); | 1269 | s->irq = platform_get_irq(pdev, 0); |
1270 | s->port.irq = s->irq; | 1270 | s->port.irq = s->irq; |
1271 | ret = request_irq(s->irq, mxs_auart_irq_handle, 0, dev_name(&pdev->dev), s); | 1271 | ret = devm_request_irq(&pdev->dev, s->irq, mxs_auart_irq_handle, 0, |
1272 | dev_name(&pdev->dev), s); | ||
1272 | if (ret) | 1273 | if (ret) |
1273 | return ret; | 1274 | return ret; |
1274 | 1275 | ||
@@ -1283,7 +1284,7 @@ static int mxs_auart_probe(struct platform_device *pdev) | |||
1283 | */ | 1284 | */ |
1284 | ret = mxs_auart_request_gpio_irq(s); | 1285 | ret = mxs_auart_request_gpio_irq(s); |
1285 | if (ret) | 1286 | if (ret) |
1286 | goto out_free_irq; | 1287 | return ret; |
1287 | 1288 | ||
1288 | auart_port[s->port.line] = s; | 1289 | auart_port[s->port.line] = s; |
1289 | 1290 | ||
@@ -1302,9 +1303,7 @@ static int mxs_auart_probe(struct platform_device *pdev) | |||
1302 | 1303 | ||
1303 | out_free_gpio_irq: | 1304 | out_free_gpio_irq: |
1304 | mxs_auart_free_gpio_irq(s); | 1305 | mxs_auart_free_gpio_irq(s); |
1305 | out_free_irq: | ||
1306 | auart_port[pdev->id] = NULL; | 1306 | auart_port[pdev->id] = NULL; |
1307 | free_irq(s->irq, s); | ||
1308 | return ret; | 1307 | return ret; |
1309 | } | 1308 | } |
1310 | 1309 | ||
@@ -1313,11 +1312,8 @@ static int mxs_auart_remove(struct platform_device *pdev) | |||
1313 | struct mxs_auart_port *s = platform_get_drvdata(pdev); | 1312 | struct mxs_auart_port *s = platform_get_drvdata(pdev); |
1314 | 1313 | ||
1315 | uart_remove_one_port(&auart_driver, &s->port); | 1314 | uart_remove_one_port(&auart_driver, &s->port); |
1316 | |||
1317 | auart_port[pdev->id] = NULL; | 1315 | auart_port[pdev->id] = NULL; |
1318 | |||
1319 | mxs_auart_free_gpio_irq(s); | 1316 | mxs_auart_free_gpio_irq(s); |
1320 | free_irq(s->irq, s); | ||
1321 | 1317 | ||
1322 | return 0; | 1318 | return 0; |
1323 | } | 1319 | } |