[v2 2/2] remoteproc: mediatek: Support mt8195 scp

Tzung-Bi Shih tzungbi at google.com
Sun Jul 11 23:06:02 PDT 2021


On Sat, Jul 10, 2021 at 8:25 PM Tinghan Shen <tinghan.shen at mediatek.com> wrote:
> @@ -785,11 +785,13 @@ static int scp_probe(struct platform_device *pdev)
>         if (ret)
>                 goto destroy_mutex;
>
> -       scp->clk = devm_clk_get(dev, "main");
> -       if (IS_ERR(scp->clk)) {
> -               dev_err(dev, "Failed to get clock\n");
> -               ret = PTR_ERR(scp->clk);
> -               goto release_dev_mem;
> +       if (of_get_property(np, "clocks", NULL)) {
> +               scp->clk = devm_clk_get(dev, "main");
> +               if (IS_ERR(scp->clk)) {
> +                       dev_err(dev, "Failed to get clock\n");
> +                       ret = PTR_ERR(scp->clk);
> +                       goto release_dev_mem;
> +               }
Use devm_clk_get_optional().



More information about the Linux-mediatek mailing list