Re: [PATCH v2 2/4] crypto: mxs-dcp - Add support for dcp clk
From: Fabio Estevam
Date: Mon Oct 15 2018 - 10:02:37 EST
On Mon, Oct 15, 2018 at 10:28 AM Leonard Crestez
<leonard.crestez@xxxxxxx> 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?