[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190712072634.3107-1-andrew.smirnov@gmail.com>
Date: Fri, 12 Jul 2019 00:26:33 -0700
From: Andrey Smirnov <andrew.smirnov@...il.com>
To: linux-usb@...r.kernel.org
Cc: Andrey Smirnov <andrew.smirnov@...il.com>,
Felipe Balbi <balbi@...nel.org>,
Chris Healy <cphealy@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] usb: dwc3: Use devres to get clocks
Use devres to get clocks and drop explicit clock freeing. No
functional change intended.
Signed-off-by: Andrey Smirnov <andrew.smirnov@...il.com>
Cc: Felipe Balbi <balbi@...nel.org>
Cc: Chris Healy <cphealy@...il.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-usb@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
---
drivers/usb/dwc3/core.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index c9bb93a2c81e..768023a2553c 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -1436,7 +1436,7 @@ static int dwc3_probe(struct platform_device *pdev)
if (dev->of_node) {
dwc->num_clks = ARRAY_SIZE(dwc3_core_clks);
- ret = clk_bulk_get(dev, dwc->num_clks, dwc->clks);
+ ret = devm_clk_bulk_get(dev, dwc->num_clks, dwc->clks);
if (ret == -EPROBE_DEFER)
return ret;
/*
@@ -1449,7 +1449,7 @@ static int dwc3_probe(struct platform_device *pdev)
ret = reset_control_deassert(dwc->reset);
if (ret)
- goto put_clks;
+ return ret;
ret = clk_bulk_prepare(dwc->num_clks, dwc->clks);
if (ret)
@@ -1536,8 +1536,6 @@ static int dwc3_probe(struct platform_device *pdev)
clk_bulk_unprepare(dwc->num_clks, dwc->clks);
assert_reset:
reset_control_assert(dwc->reset);
-put_clks:
- clk_bulk_put(dwc->num_clks, dwc->clks);
return ret;
}
@@ -1560,7 +1558,6 @@ static int dwc3_remove(struct platform_device *pdev)
dwc3_free_event_buffers(dwc);
dwc3_free_scratch_buffers(dwc);
- clk_bulk_put(dwc->num_clks, dwc->clks);
return 0;
}
--
2.21.0
Powered by blists - more mailing lists