drm/panel: s6e8aa0: Use static inline for upcasting
authorThierry Reding <treding@nvidia.com>
Mon, 21 Jul 2014 13:51:17 +0000 (15:51 +0200)
committerThierry Reding <treding@nvidia.com>
Tue, 22 Jul 2014 07:06:48 +0000 (09:06 +0200)
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>
drivers/gpu/drm/panel/panel-s6e8aa0.c

index 5502ef6bc07464ba6c058e2f3cdf3d2661ab61c5..4fe0bbb0323024c9ea24afd993855da57ad977ac 100644 (file)
@@ -120,7 +120,10 @@ struct s6e8aa0 {
        int error;
 };
 
-#define panel_to_s6e8aa0(p) container_of(p, struct s6e8aa0, panel)
+static inline struct s6e8aa0 *panel_to_s6e8aa0(struct drm_panel *panel)
+{
+       return container_of(panel, struct s6e8aa0, panel);
+}
 
 static int s6e8aa0_clear_error(struct s6e8aa0 *ctx)
 {