diff options
author | Maxime Ripard <maxime@cerno.tech> | 2023-03-06 11:46:42 +0100 |
---|---|---|
committer | Maxime Ripard <maxime@cerno.tech> | 2023-04-25 09:32:25 +0200 |
commit | 5a46e490e47e4d821c382288108f193fc88a9282 (patch) | |
tree | 301fdd26bffd35e575679430e7c1bf45abb8743b /drivers/gpu/drm/vc4/vc4_dpi.c | |
parent | drm/vkms: isolate pixel conversion functionality (diff) | |
download | linux-5a46e490e47e4d821c382288108f193fc88a9282.tar.xz linux-5a46e490e47e4d821c382288108f193fc88a9282.zip |
drm/vc4: Switch to container_of_const
container_of_const() allows to preserve the pointer constness and is
thus more flexible than inline functions.
Let's switch all our instances of container_of() to
container_of_const().
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://lore.kernel.org/r/20221207-rpi-hdmi-improvements-v3-1-bdd54f66884e@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Diffstat (limited to 'drivers/gpu/drm/vc4/vc4_dpi.c')
-rw-r--r-- | drivers/gpu/drm/vc4/vc4_dpi.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c index f518d6e59ed6..e68c07d86040 100644 --- a/drivers/gpu/drm/vc4/vc4_dpi.c +++ b/drivers/gpu/drm/vc4/vc4_dpi.c @@ -97,11 +97,8 @@ struct vc4_dpi { struct debugfs_regset32 regset; }; -static inline struct vc4_dpi * -to_vc4_dpi(struct drm_encoder *encoder) -{ - return container_of(encoder, struct vc4_dpi, encoder.base); -} +#define to_vc4_dpi(_encoder) \ + container_of_const(_encoder, struct vc4_dpi, encoder.base) #define DPI_READ(offset) \ ({ \ |