[PATCH v5 2/3] hwrng: add hwrng driver for Rockchip RK3568 SoC

Herbert Xu herbert at gondor.apana.org.au
Fri Jul 5 17:15:57 PDT 2024


On Wed, Jun 26, 2024 at 02:37:10AM +0100, Daniel Golle wrote:
>
> +#ifndef CONFIG_PM
> +	rk_rng->rng.init = rk_rng_init;
> +	rk_rng->rng.cleanup = rk_rng_cleanup;
> +#endif

Please rewrite this as

	if (!IS_ENABLED(CONFIG_PM)) {
		...
	}

> +#ifdef CONFIG_PM
> +static int rk_rng_runtime_suspend(struct device *dev)
> +{
> +	struct rk_rng *rk_rng = dev_get_drvdata(dev);
> +
> +	rk_rng_cleanup(&rk_rng->rng);
> +
> +	return 0;
> +}
> +
> +static int rk_rng_runtime_resume(struct device *dev)
> +{
> +	struct rk_rng *rk_rng = dev_get_drvdata(dev);
> +
> +	return rk_rng_init(&rk_rng->rng);
> +}
> +#endif

These ifdefs should just disappear, with __maybe_unused added
instead.

Thanks,
-- 
Email: Herbert Xu <herbert at gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



More information about the Linux-rockchip mailing list