Return-Path: Received: from mail-oi1-f196.google.com ([209.85.167.196]:38476 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726986AbeJPXyr (ORCPT ); Tue, 16 Oct 2018 19:54:47 -0400 MIME-Version: 1.0 References: In-Reply-To: From: Fabio Estevam Date: Tue, 16 Oct 2018 13:03:47 -0300 Message-ID: Subject: Re: [PATCH v3 2/4] crypto: mxs-dcp - Add support for dcp clk To: Leonard Crestez 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-crypto-owner@vger.kernel.org List-ID: Hi Leonard, On Tue, Oct 16, 2018 at 12:58 PM 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; This dcp_clk assignment to NULL does not seem to be necessary. > + > + ret = clk_prepare_enable(sdcp->dcp_clk); > + if (ret) > + return ret; > > ret = devm_request_irq(dev, dcp_vmi_irq, mxs_dcp_irq, 0, > "dcp-vmi-irq", sdcp); > if (ret) { > dev_err(dev, "Failed to claim DCP VMI IRQ!\n"); In case of subsequent errors you should call clk_disable_unprepare(sdcp->dcp_clk).