* [PATCH] usb: host: ohci-omap: Make it CCF clk API compatible
@ 2022-04-02 11:43 Janusz Krzysztofik
2022-04-02 13:52 ` Alan Stern
0 siblings, 1 reply; 2+ messages in thread
From: Janusz Krzysztofik @ 2022-04-02 11:43 UTC (permalink / raw)
To: Alan Stern; +Cc: Greg Kroah-Hartman, linux-usb, linux-omap, Janusz Krzysztofik
The driver, OMAP1 specific, now omits clk_prepare/unprepare() steps, not
supported by OMAP1 custom implementation of clock API. However, non-CCF
stubs of those functions exist for use on such platforms until converted
to CCF.
Update the driver to be compatible with CCF implementation of clock API.
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
---
drivers/usb/host/ohci-omap.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index 45dcf8292072..2ab2e089a2b7 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -281,6 +281,10 @@ static int ohci_hcd_omap_probe(struct platform_device *pdev)
goto err_put_hcd;
}
+ retval = clk_prepare(priv->usb_host_ck);
+ if (retval)
+ goto err_put_host_ck;
+
if (!cpu_is_omap15xx())
priv->usb_dc_ck = clk_get(&pdev->dev, "usb_dc_ck");
else
@@ -288,13 +292,17 @@ static int ohci_hcd_omap_probe(struct platform_device *pdev)
if (IS_ERR(priv->usb_dc_ck)) {
retval = PTR_ERR(priv->usb_dc_ck);
- goto err_put_host_ck;
+ goto err_unprepare_host_ck;
}
+ retval = clk_prepare(priv->usb_dc_ck);
+ if (retval)
+ goto err_put_dc_ck;
+
if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
dev_dbg(&pdev->dev, "request_mem_region failed\n");
retval = -EBUSY;
- goto err_put_dc_ck;
+ goto err_unprepare_dc_ck;
}
hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
@@ -319,8 +327,12 @@ static int ohci_hcd_omap_probe(struct platform_device *pdev)
iounmap(hcd->regs);
err2:
release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
+err_unprepare_dc_ck:
+ clk_unprepare(priv->usb_dc_ck);
err_put_dc_ck:
clk_put(priv->usb_dc_ck);
+err_unprepare_host_ck:
+ clk_unprepare(priv->usb_host_ck);
err_put_host_ck:
clk_put(priv->usb_host_ck);
err_put_hcd:
@@ -355,7 +367,9 @@ static int ohci_hcd_omap_remove(struct platform_device *pdev)
}
iounmap(hcd->regs);
release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
+ clk_unprepare(priv->usb_dc_ck);
clk_put(priv->usb_dc_ck);
+ clk_unprepare(priv->usb_host_ck);
clk_put(priv->usb_host_ck);
usb_put_hcd(hcd);
return 0;
--
2.35.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] usb: host: ohci-omap: Make it CCF clk API compatible
2022-04-02 11:43 [PATCH] usb: host: ohci-omap: Make it CCF clk API compatible Janusz Krzysztofik
@ 2022-04-02 13:52 ` Alan Stern
0 siblings, 0 replies; 2+ messages in thread
From: Alan Stern @ 2022-04-02 13:52 UTC (permalink / raw)
To: Janusz Krzysztofik; +Cc: Greg Kroah-Hartman, linux-usb, linux-omap
On Sat, Apr 02, 2022 at 01:43:53PM +0200, Janusz Krzysztofik wrote:
> The driver, OMAP1 specific, now omits clk_prepare/unprepare() steps, not
> supported by OMAP1 custom implementation of clock API. However, non-CCF
> stubs of those functions exist for use on such platforms until converted
> to CCF.
>
> Update the driver to be compatible with CCF implementation of clock API.
>
> Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
> ---
Acked-by: Alan Stern <stern@rowland.harvard.edu>
> drivers/usb/host/ohci-omap.c | 18 ++++++++++++++++--
> 1 file changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
> index 45dcf8292072..2ab2e089a2b7 100644
> --- a/drivers/usb/host/ohci-omap.c
> +++ b/drivers/usb/host/ohci-omap.c
> @@ -281,6 +281,10 @@ static int ohci_hcd_omap_probe(struct platform_device *pdev)
> goto err_put_hcd;
> }
>
> + retval = clk_prepare(priv->usb_host_ck);
> + if (retval)
> + goto err_put_host_ck;
> +
> if (!cpu_is_omap15xx())
> priv->usb_dc_ck = clk_get(&pdev->dev, "usb_dc_ck");
> else
> @@ -288,13 +292,17 @@ static int ohci_hcd_omap_probe(struct platform_device *pdev)
>
> if (IS_ERR(priv->usb_dc_ck)) {
> retval = PTR_ERR(priv->usb_dc_ck);
> - goto err_put_host_ck;
> + goto err_unprepare_host_ck;
> }
>
> + retval = clk_prepare(priv->usb_dc_ck);
> + if (retval)
> + goto err_put_dc_ck;
> +
> if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
> dev_dbg(&pdev->dev, "request_mem_region failed\n");
> retval = -EBUSY;
> - goto err_put_dc_ck;
> + goto err_unprepare_dc_ck;
> }
>
> hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
> @@ -319,8 +327,12 @@ static int ohci_hcd_omap_probe(struct platform_device *pdev)
> iounmap(hcd->regs);
> err2:
> release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
> +err_unprepare_dc_ck:
> + clk_unprepare(priv->usb_dc_ck);
> err_put_dc_ck:
> clk_put(priv->usb_dc_ck);
> +err_unprepare_host_ck:
> + clk_unprepare(priv->usb_host_ck);
> err_put_host_ck:
> clk_put(priv->usb_host_ck);
> err_put_hcd:
> @@ -355,7 +367,9 @@ static int ohci_hcd_omap_remove(struct platform_device *pdev)
> }
> iounmap(hcd->regs);
> release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
> + clk_unprepare(priv->usb_dc_ck);
> clk_put(priv->usb_dc_ck);
> + clk_unprepare(priv->usb_host_ck);
> clk_put(priv->usb_host_ck);
> usb_put_hcd(hcd);
> return 0;
> --
> 2.35.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-02 13:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-02 11:43 [PATCH] usb: host: ohci-omap: Make it CCF clk API compatible Janusz Krzysztofik
2022-04-02 13:52 ` Alan Stern
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).