Commit 75beb268 authored by Fabio Estevam's avatar Fabio Estevam Committed by Greg Kroah-Hartman

serial: mxs-auart: Use devm_clk_get()

By using devm_clk_get() we can have a shorter and cleaner code.
Signed-off-by: default avatarFabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 46778bca
...@@ -1246,15 +1246,14 @@ static int mxs_auart_probe(struct platform_device *pdev) ...@@ -1246,15 +1246,14 @@ static int mxs_auart_probe(struct platform_device *pdev)
s->devtype = pdev->id_entry->driver_data; 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)) if (IS_ERR(s->clk))
return PTR_ERR(s->clk); return PTR_ERR(s->clk);
r = platform_get_resource(pdev, IORESOURCE_MEM, 0); r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!r) { if (!r)
ret = -ENXIO; return -ENXIO;
goto out_free_clk;
}
s->port.mapbase = r->start; s->port.mapbase = r->start;
s->port.membase = ioremap(r->start, resource_size(r)); s->port.membase = ioremap(r->start, resource_size(r));
...@@ -1271,7 +1270,7 @@ static int mxs_auart_probe(struct platform_device *pdev) ...@@ -1271,7 +1270,7 @@ static int mxs_auart_probe(struct platform_device *pdev)
s->port.irq = s->irq; s->port.irq = s->irq;
ret = request_irq(s->irq, mxs_auart_irq_handle, 0, dev_name(&pdev->dev), s); ret = request_irq(s->irq, mxs_auart_irq_handle, 0, dev_name(&pdev->dev), s);
if (ret) if (ret)
goto out_free_clk; return ret;
platform_set_drvdata(pdev, s); platform_set_drvdata(pdev, s);
...@@ -1306,8 +1305,6 @@ static int mxs_auart_probe(struct platform_device *pdev) ...@@ -1306,8 +1305,6 @@ static int mxs_auart_probe(struct platform_device *pdev)
out_free_irq: out_free_irq:
auart_port[pdev->id] = NULL; auart_port[pdev->id] = NULL;
free_irq(s->irq, s); free_irq(s->irq, s);
out_free_clk:
clk_put(s->clk);
return ret; return ret;
} }
...@@ -1320,7 +1317,6 @@ static int mxs_auart_remove(struct platform_device *pdev) ...@@ -1320,7 +1317,6 @@ static int mxs_auart_remove(struct platform_device *pdev)
auart_port[pdev->id] = NULL; auart_port[pdev->id] = NULL;
mxs_auart_free_gpio_irq(s); mxs_auart_free_gpio_irq(s);
clk_put(s->clk);
free_irq(s->irq, s); free_irq(s->irq, s);
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