Commit 02e6c5b7 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven

drm: renesas: shmobile: Convert container helpers to static inline functions

Replace to conversion helper macros using container_of() by static
inline functions, to improve type-safety.
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/7d1f1aa4b832499f9e527353ce0ad6d84ff9a74a.1694767209.git.geert+renesas@glider.be
parent 5417750d
......@@ -258,7 +258,10 @@ static void shmob_drm_crtc_update_base(struct shmob_drm_crtc *scrtc)
lcdc_write(sdev, LDRCNTR, lcdc_read(sdev, LDRCNTR) ^ LDRCNTR_MRS);
}
#define to_shmob_crtc(c) container_of(c, struct shmob_drm_crtc, crtc)
static inline struct shmob_drm_crtc *to_shmob_crtc(struct drm_crtc *crtc)
{
return container_of(crtc, struct shmob_drm_crtc, crtc);
}
static void shmob_drm_crtc_dpms(struct drm_crtc *crtc, int mode)
{
......@@ -538,8 +541,10 @@ int shmob_drm_encoder_create(struct shmob_drm_device *sdev)
* Connector
*/
#define to_shmob_connector(c) \
container_of(c, struct shmob_drm_connector, connector)
static inline struct shmob_drm_connector *to_shmob_connector(struct drm_connector *connector)
{
return container_of(connector, struct shmob_drm_connector, connector);
}
static int shmob_drm_connector_get_modes(struct drm_connector *connector)
{
......
......@@ -34,7 +34,10 @@ struct shmob_drm_plane {
unsigned int crtc_h;
};
#define to_shmob_plane(p) container_of(p, struct shmob_drm_plane, plane)
static inline struct shmob_drm_plane *to_shmob_plane(struct drm_plane *plane)
{
return container_of(plane, struct shmob_drm_plane, plane);
}
static void shmob_drm_plane_compute_base(struct shmob_drm_plane *splane,
struct drm_framebuffer *fb,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment