diff mbox series

[V3,4/8] remoteproc: imx_rproc: make clk optional

Message ID 1617846898-13662-5-git-send-email-peng.fan@oss.nxp.com
State New
Headers show
Series remoteproc: imx_rproc: support i.MX7ULP/8MN/8MP | expand

Commit Message

Peng Fan (OSS) April 8, 2021, 1:54 a.m. UTC
From: Peng Fan <peng.fan@nxp.com>


To i.MX7ULP, M4 is the master to control everything, so it not need
clk from A7.

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>

Signed-off-by: Peng Fan <peng.fan@nxp.com>

---
 drivers/remoteproc/imx_rproc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.30.0

Comments

Mathieu Poirier April 13, 2021, 5:28 p.m. UTC | #1
On Thu, Apr 08, 2021 at 09:54:54AM +0800, peng.fan@oss.nxp.com wrote:
> From: Peng Fan <peng.fan@nxp.com>

> 

> To i.MX7ULP, M4 is the master to control everything, so it not need

> clk from A7.

> 

> Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>

> Signed-off-by: Peng Fan <peng.fan@nxp.com>

> ---

>  drivers/remoteproc/imx_rproc.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c

> index d6338872c6db..ca17f520d904 100644

> --- a/drivers/remoteproc/imx_rproc.c

> +++ b/drivers/remoteproc/imx_rproc.c

> @@ -635,7 +635,7 @@ static int imx_rproc_probe(struct platform_device *pdev)

>  	if (ret)

>  		goto err_put_mbox;

>  

> -	priv->clk = devm_clk_get(dev, NULL);

> +	priv->clk = devm_clk_get_optional(dev, NULL);


Overnight the clock becomes optional for all remote processors?  Why not call
devm_clk_get() or devm_clk_get_optional() based on the remote processor type in
a new function called imx_rproc_clk_get()?

>  	if (IS_ERR(priv->clk)) {

>  		dev_err(dev, "Failed to get clock\n");

>  		ret = PTR_ERR(priv->clk);

> -- 

> 2.30.0

>
diff mbox series

Patch

diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
index d6338872c6db..ca17f520d904 100644
--- a/drivers/remoteproc/imx_rproc.c
+++ b/drivers/remoteproc/imx_rproc.c
@@ -635,7 +635,7 @@  static int imx_rproc_probe(struct platform_device *pdev)
 	if (ret)
 		goto err_put_mbox;
 
-	priv->clk = devm_clk_get(dev, NULL);
+	priv->clk = devm_clk_get_optional(dev, NULL);
 	if (IS_ERR(priv->clk)) {
 		dev_err(dev, "Failed to get clock\n");
 		ret = PTR_ERR(priv->clk);