Re: [PATCH v2 2/4] crypto: mxs-dcp - Add support for dcp clk

Fabio Estevam
2018-10-15T14:02:39Z

On Mon, Oct 15, 2018 at 10:28 AM Leonard Crestez
<leonard.crestez@nxp.com> wrote:

> + /* DCP clock is optional, only used on some SOCs */
> + sdcp->dcp_clk = devm_clk_get(dev, "dcp");
> + if (IS_ERR(sdcp->dcp_clk)) {
> + if (sdcp->dcp_clk != ERR_PTR(-ENOENT))
> + return PTR_ERR(sdcp->dcp_clk);
> + sdcp->dcp_clk = NULL;
> + }
> +
> + ret = clk_prepare(sdcp->dcp_clk);
> + if (ret)
> + return ret;
> + ret = clk_enable(sdcp->dcp_clk);
> + if (ret)
> + return ret;

Couldn't you use clk_prepare_enable() instead?