lkml.org 
[lkml]   [2018]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 3/3] mfd/omap-usb-tll: Return an error code only as a constant in usbtll_omap_probe()
From
Date
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 15 Jan 2018 14:00:45 +0100

* Return an error code without storing it in an intermediate variable.

* Delete the label "err_clk_alloc" and local variable "ret"
which became unnecessary with this refactoring.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/mfd/omap-usb-tll.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/mfd/omap-usb-tll.c b/drivers/mfd/omap-usb-tll.c
index c8b4ad40910a..6c0be886fd87 100644
--- a/drivers/mfd/omap-usb-tll.c
+++ b/drivers/mfd/omap-usb-tll.c
@@ -216,7 +216,6 @@ static int usbtll_omap_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct resource *res;
struct usbtll_omap *tll;
- int ret = 0;
int i, ver;

dev_dbg(dev, "starting TI HSUSB TLL Controller\n");
@@ -254,8 +253,9 @@ static int usbtll_omap_probe(struct platform_device *pdev)
tll->ch_clk = devm_kzalloc(dev, sizeof(struct clk *) * tll->nch,
GFP_KERNEL);
if (!tll->ch_clk) {
- ret = -ENOMEM;
- goto err_clk_alloc;
+ pm_runtime_put_sync(dev);
+ pm_runtime_disable(dev);
+ return -ENOMEM;
}

for (i = 0; i < tll->nch; i++) {
@@ -278,12 +278,6 @@ static int usbtll_omap_probe(struct platform_device *pdev)
spin_unlock(&tll_lock);

return 0;
-
-err_clk_alloc:
- pm_runtime_put_sync(dev);
- pm_runtime_disable(dev);
-
- return ret;
}

/**
--
2.15.1
\
 
 \ /
  Last update: 2018-01-15 14:18    [W:0.086 / U:4.836 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site