瀏覽代碼

drm/panel: ld9040: Replace upcasting macro by function

Using a function instead of a macro provides proper type checking.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Thierry Reding 11 年之前
父節點
當前提交
dff2ed2754
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      drivers/gpu/drm/panel/panel-ld9040.c

+ 4 - 1
drivers/gpu/drm/panel/panel-ld9040.c

@@ -110,7 +110,10 @@ struct ld9040 {
 	int error;
 };
 
-#define panel_to_ld9040(p) container_of(p, struct ld9040, panel)
+static inline struct ld9040 *panel_to_ld9040(struct drm_panel *panel)
+{
+	return container_of(panel, struct ld9040, panel);
+}
 
 static int ld9040_clear_error(struct ld9040 *ctx)
 {