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_dsi.c | |
| parent | 322d716a3e8a74fb75cd0f657647be4df253fd2f (diff) | |
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_dsi.c')
| -rw-r--r-- | drivers/gpu/drm/vc4/vc4_dsi.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c index a5c075f802e4..9e0c355b236f 100644 --- a/drivers/gpu/drm/vc4/vc4_dsi.c +++ b/drivers/gpu/drm/vc4/vc4_dsi.c @@ -600,19 +600,14 @@ struct vc4_dsi { struct debugfs_regset32 regset; }; -#define host_to_dsi(host) container_of(host, struct vc4_dsi, dsi_host) +#define host_to_dsi(host) \ + container_of_const(host, struct vc4_dsi, dsi_host) -static inline struct vc4_dsi * -to_vc4_dsi(struct drm_encoder *encoder) -{ - return container_of(encoder, struct vc4_dsi, encoder.base); -} +#define to_vc4_dsi(_encoder) \ + container_of_const(_encoder, struct vc4_dsi, encoder.base) -static inline struct vc4_dsi * -bridge_to_vc4_dsi(struct drm_bridge *bridge) -{ - return container_of(bridge, struct vc4_dsi, bridge); -} +#define bridge_to_vc4_dsi(_bridge) \ + container_of_const(_bridge, struct vc4_dsi, bridge) static inline void dsi_dma_workaround_write(struct vc4_dsi *dsi, u32 offset, u32 val) |