diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2014-11-27 20:08:32 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-01-09 23:12:27 +0100 |
commit | 75beb268550d11e66c372dd6da309dce659da7f7 (patch) | |
tree | 269f8b7be39f12737cb1d40d8f93a6deba4af851 /drivers/tty/serial | |
parent | serial: mxs-auart: Use devm_kzalloc() (diff) | |
download | linux-75beb268550d11e66c372dd6da309dce659da7f7.tar.xz linux-75beb268550d11e66c372dd6da309dce659da7f7.zip |
serial: mxs-auart: Use devm_clk_get()
By using devm_clk_get() 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>
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r-- | drivers/tty/serial/mxs-auart.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c index 0b5f0ead6b73..9309082e4937 100644 --- a/drivers/tty/serial/mxs-auart.c +++ b/drivers/tty/serial/mxs-auart.c @@ -1246,15 +1246,14 @@ static int mxs_auart_probe(struct platform_device *pdev) s->devtype = pdev->id_entry->driver_data; } - s->clk = clk_get(&pdev->dev, NULL); + s->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(s->clk)) return PTR_ERR(s->clk); r = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!r) { - ret = -ENXIO; - goto out_free_clk; - } + if (!r) + return -ENXIO; + s->port.mapbase = r->start; s->port.membase = ioremap(r->start, resource_size(r)); @@ -1271,7 +1270,7 @@ static int mxs_auart_probe(struct platform_device *pdev) s->port.irq = s->irq; ret = request_irq(s->irq, mxs_auart_irq_handle, 0, dev_name(&pdev->dev), s); if (ret) - goto out_free_clk; + return ret; platform_set_drvdata(pdev, s); @@ -1306,8 +1305,6 @@ out_free_gpio_irq: out_free_irq: auart_port[pdev->id] = NULL; free_irq(s->irq, s); -out_free_clk: - clk_put(s->clk); return ret; } @@ -1320,7 +1317,6 @@ static int mxs_auart_remove(struct platform_device *pdev) auart_port[pdev->id] = NULL; mxs_auart_free_gpio_irq(s); - clk_put(s->clk); free_irq(s->irq, s); return 0; |