Commit 8bb86092 authored by Nicolas Frattaroli's avatar Nicolas Frattaroli Committed by Herbert Xu
Browse files

hwrng: rockchip - store dev pointer in driver struct



The rockchip rng driver does a dance to store the dev pointer in the
hwrng's unsigned long "priv" member. However, since the struct hwrng
member of rk_rng is not a pointer, we can use container_of to get the
struct rk_rng instance from just the struct hwrng*, which means we don't
have to subvert what little there is in C of a type system and can
instead store a pointer to the device struct in the rk_rng itself.

Signed-off-by: default avatarNicolas Frattaroli <nicolas.frattaroli@collabora.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent e00fc3d6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment