Commit 03bf32bb authored by Andrey Smirnov's avatar Andrey Smirnov Committed by Felipe Balbi
Browse files

usb: dwc3: Use devres to get clocks



Use devres to get clocks and drop explicit clock freeing. No
functional change intended.

Signed-off-by: default avatarAndrey Smirnov <andrew.smirnov@gmail.com>
Cc: Felipe Balbi <balbi@kernel.org>
Cc: Chris Healy <cphealy@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 3cd703f4
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -1448,7 +1448,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;
		/*
@@ -1461,7 +1461,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)
@@ -1548,8 +1548,6 @@ unprepare_clks:
	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;
}
@@ -1572,7 +1570,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;
}