From faaca436699603355c5c9711942c6441eec38b0e Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Wed, 18 Jan 2023 08:09:18 +0100 Subject: usb: fotg210: Move clock handling to core Grab the optional silicon block clock, prepare and enable it in the core before proceeding to prepare the host or peripheral driver. This saves duplicate code and also uses the simple devm_clk_get_optional_enabled() to do everything we really want to do. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230103-gemini-fotg210-usb-v2-4-100388af9810@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/usb/fotg210/fotg210-core.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/usb/fotg210/fotg210-core.c') diff --git a/drivers/usb/fotg210/fotg210-core.c b/drivers/usb/fotg210/fotg210-core.c index 0dd4957ad70a..f90b2ae9ed9d 100644 --- a/drivers/usb/fotg210/fotg210-core.c +++ b/drivers/usb/fotg210/fotg210-core.c @@ -6,6 +6,7 @@ * driver. */ #include +#include #include #include #include @@ -109,6 +110,10 @@ static int fotg210_probe(struct platform_device *pdev) if (!fotg->base) return -ENOMEM; + fotg->pclk = devm_clk_get_optional_enabled(dev, "PCLK"); + if (IS_ERR(fotg->pclk)) + return PTR_ERR(fotg->pclk); + mode = usb_get_dr_mode(dev); if (of_device_is_compatible(dev->of_node, "cortina,gemini-usb")) { -- cgit