Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/panel: s6e8aa0: Use static inline for upcasting

Use a static inline function for upcasting a struct drm_panel to the
driver-specific structure. The advantage over using a macro is that it
gives us additional type checking.

Acked-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>

+4 -1
+4 -1
drivers/gpu/drm/panel/panel-s6e8aa0.c
··· 120 120 int error; 121 121 }; 122 122 123 - #define panel_to_s6e8aa0(p) container_of(p, struct s6e8aa0, panel) 123 + static inline struct s6e8aa0 *panel_to_s6e8aa0(struct drm_panel *panel) 124 + { 125 + return container_of(panel, struct s6e8aa0, panel); 126 + } 124 127 125 128 static int s6e8aa0_clear_error(struct s6e8aa0 *ctx) 126 129 {