lkml.org 
[lkml]   [2018]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v2] spi/bcm63xx-hspi: Enable the clock before calling clk_get_rate().
    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.
    [unhandled content-type:application/pgp-signature]
    \
     
     \ /
      Last update: 2018-04-24 19:33    [W:4.081 / U:0.220 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site