linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: broonie@kernel.org (Mark Brown)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] spi/bcm63xx-hspi: Enable the clock before calling clk_get_rate().
Date: Tue, 24 Apr 2018 18:32:53 +0100	[thread overview]
Message-ID: <20180424173253.GF22073@sirena.org.uk> (raw)
In-Reply-To: <20180424161605.GA17825@er01809n.ebgroup.elektrobit.com>

On Tue, Apr 24, 2018 at 06:16:05PM +0200, Stefan Potyra wrote:

> +	ret = clk_prepare_enable(clk);
> +	if (ret)
> +		return ret;
> +
>  	rate = clk_get_rate(clk);
>  	if (!rate) {
>  		struct clk *pll_clk = devm_clk_get(dev, "pll");
> @@ -364,10 +368,6 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev)
>  			return -EINVAL;
>  	}
>  
> -	ret = clk_prepare_enable(clk);
> -	if (ret)
> -		return ret;
> -

We can return an error after the clock was enabled, this will leake the
clock if that happens.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180424/092def40/attachment.sig>

  parent reply	other threads:[~2018-04-24 17:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-19 13:03 [PATCH] Enable the clock before calling clk_get_rate() Stefan Potyra
2018-04-21 23:10 ` Florian Fainelli
     [not found]   ` <20180424161605.GA17825@er01809n.ebgroup.elektrobit.com>
2018-04-24 17:32     ` Mark Brown [this message]
     [not found]       ` <20180425134728.GA20897@er01809n.ebgroup.elektrobit.com>
2018-04-25 15:50         ` [PATCH v3] spi/bcm63xx-hspi: Enable the clock before calling Mark Brown
     [not found]           ` <20180425164904.GA30349@er01809n.ebgroup.elektrobit.com>
2018-04-25 17:28             ` [PATCH v4] spi/bcm63xx-hspi: Enable the clock before calling clk_get_rate() Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180424173253.GF22073@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).