From: Fabio Estevam Subject: Re: [PATCH v2 2/4] crypto: mxs-dcp - Add support for dcp clk Date: Mon, 15 Oct 2018 11:02:39 -0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Shawn Guo , Fabio Estevam , Rob Herring , Marek Vasut , Herbert Xu , Horia Geanta Neag , Franck LENORMAND , Aymen Sghaier , "David S. Miller" , Mark Rutland , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , NXP Linux Team , Sascha Hauer , linux-kernel Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-crypto.vger.kernel.org On Mon, Oct 15, 2018 at 10:28 AM Leonard Crestez 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?