[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f88233e6a76e99f95f6611bccdf234681e84f7ce.camel@nxp.com>
Date: Tue, 16 Oct 2018 17:23:11 +0000
From: Leonard Crestez <leonard.crestez@....com>
To: "festevam@...il.com" <festevam@...il.com>
CC: dl-linux-imx <linux-imx@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
Fabio Estevam <fabio.estevam@....com>,
Aymen Sghaier <aymen.sghaier@....com>,
Franck Lenormand <franck.lenormand@....com>,
"mark.rutland@....com" <mark.rutland@....com>,
"shawnguo@...nel.org" <shawnguo@...nel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"davem@...emloft.net" <davem@...emloft.net>,
Horia Geanta <horia.geanta@....com>,
"kernel@...gutronix.de" <kernel@...gutronix.de>,
"herbert@...dor.apana.org.au" <herbert@...dor.apana.org.au>,
"marek.vasut@...il.com" <marek.vasut@...il.com>,
"linux-crypto@...r.kernel.org" <linux-crypto@...r.kernel.org>
Subject: Re: [PATCH v3 2/4] crypto: mxs-dcp - Add support for dcp clk
On Tue, 2018-10-16 at 13:03 -0300, Fabio Estevam 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.
The clk API ignores all calls if clk == NULL (which is very nice) but
not if IS_ERR(clk). Setting dcp_clk to NULL avoids sprinkling other
checks.
> > + 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).
Yes, will resend. Maybe some day clk consumer will automatically undo
pending prepare/enables on release?
Powered by blists - more mailing lists