[PATCH v15 35/35] crypto: amlogic: keep the bus clock enabled

Markus Elfring Markus.Elfring at web.de
Wed Dec 2 07:26:18 PST 2026


…
> +++ b/drivers/crypto/amlogic/amlogic-gxl.h
…
> @@ -113,6 +116,7 @@ struct meson_pdata {
>   */
>  struct meson_dev {
>  	void __iomem *base;
> +	struct clk *busclk;
>  	struct device *dev;
>  	const struct meson_pdata *pdata;
>  	struct meson_flow *chanlist;

Is it still required to store the clock pointer within the data structure?
https://elixir.bootlin.com/linux/v7.4-rc2/source/drivers/crypto/amlogic/amlogic-gxl.h#L82-L102


…
> +++ b/drivers/crypto/amlogic/amlogic-gxl-core.c
…
> @@ -236,6 +237,13 @@ static int meson_crypto_probe(struct platform_device *pdev)
>  	if (IS_ERR(mc->base))
>  		return PTR_ERR(mc->base);
>  
> +	mc->busclk = devm_clk_get_enabled(&pdev->dev, NULL);
> +	if (IS_ERR(mc->busclk)) {
> +		err = PTR_ERR(mc->busclk);
> +		dev_err(&pdev->dev, "Cannot get/enable core clock err=%d\n", err);
> +		return err;
> +	}
> +
>  	err = meson_allocate_chanlist(mc);
…

Would a local variable become sufficient after the proposed source code transformation?
https://elixir.bootlin.com/linux/v7.4-rc2/source/drivers/crypto/amlogic/amlogic-gxl-core.c#L246-L251

Regards,
Markus



More information about the linux-arm-kernel mailing list