Re: [PATCH 01/15] i2c: busses: emev2: Use devm_clk_get_enabled()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andi,

On Mon, Jun 12, 2023 at 12:57 AM Andi Shyti <andi.shyti@xxxxxxxxxx> wrote:
> Replace the pair of functions, devm_clk_get() and
> clk_prepare_enable(), with a single function
> devm_clk_get_enabled().
>
> Signed-off-by: Andi Shyti <andi.shyti@xxxxxxxxxx>
> Cc: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>
> Cc: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
> Cc: Magnus Damm <magnus.damm@xxxxxxxxx>

Thanks for your patch!

> --- a/drivers/i2c/busses/i2c-emev2.c
> +++ b/drivers/i2c/busses/i2c-emev2.c
> @@ -373,14 +373,10 @@ static int em_i2c_probe(struct platform_device *pdev)
>
>         strscpy(priv->adap.name, "EMEV2 I2C", sizeof(priv->adap.name));
>
> -       priv->sclk = devm_clk_get(&pdev->dev, "sclk");
> +       priv->sclk = devm_clk_get_enabled(&pdev->dev, "sclk");
>         if (IS_ERR(priv->sclk))
>                 return PTR_ERR(priv->sclk);

After this, priv->sclk is unused, so you can replace em_i2c_device.sclk
by a local variable.

The rest LGTM.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux