linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] serial: mxs-auart: Remove unneeded goto label
@ 2014-11-27 19:08 Fabio Estevam
  2014-11-27 19:08 ` [PATCH 2/4] serial: mxs-auart: Use devm_kzalloc() Fabio Estevam
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Fabio Estevam @ 2014-11-27 19:08 UTC (permalink / raw)
  To: gregkh; +Cc: j.uzycki, linux-serial, Fabio Estevam

From: Fabio Estevam <fabio.estevam@freescale.com>

Instead of jumping to the 'out' label, let's return the error immediately, which
makes the code shorter and cleaner.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/tty/serial/mxs-auart.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index ec553f8..a9e7fa6 100644
--- a/drivers/tty/serial/mxs-auart.c
+++ b/drivers/tty/serial/mxs-auart.c
@@ -1232,10 +1232,8 @@ static int mxs_auart_probe(struct platform_device *pdev)
 	struct resource *r;
 
 	s = kzalloc(sizeof(struct mxs_auart_port), GFP_KERNEL);
-	if (!s) {
-		ret = -ENOMEM;
-		goto out;
-	}
+	if (!s)
+		return -ENOMEM;
 
 	ret = serial_mxs_probe_dt(s, pdev);
 	if (ret > 0)
@@ -1314,7 +1312,6 @@ out_free_clk:
 	clk_put(s->clk);
 out_free:
 	kfree(s);
-out:
 	return ret;
 }
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-11-27 19:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-27 19:08 [PATCH 1/4] serial: mxs-auart: Remove unneeded goto label Fabio Estevam
2014-11-27 19:08 ` [PATCH 2/4] serial: mxs-auart: Use devm_kzalloc() Fabio Estevam
2014-11-27 19:08 ` [PATCH 3/4] serial: mxs-auart: Use devm_clk_get() Fabio Estevam
2014-11-27 19:08 ` [PATCH 4/4] serial: mxs-auart: Use devm_request_irq() Fabio Estevam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).