Skip to content

Commit 6a038f0

Browse files
refractionwaresuperna9999
authored andcommitted
drm/panel: samsung-s6d7aa0: use pointer for drm_mode in panel desc struct
Fixes compilation issues with older GCC versions and Clang after changes introduced in commit 6810bb3 ("drm/panel: Add Samsung S6D7AA0 panel controller driver"). Tested with GCC 13.1.1, GCC 6.4.0 and Clang 16.0.3. Fixes the following errors with Clang: drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c:312:14: error: initializer element is not a compile-time constant .drm_mode = s6d7aa0_lsl080al02_mode, ^~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c:415:14: error: initializer element is not a compile-time constant .drm_mode = s6d7aa0_lsl080al03_mode, ^~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c:443:14: error: initializer element is not a compile-time constant .drm_mode = s6d7aa0_ltl101at01_mode, ^~~~~~~~~~~~~~~~~~~~~~~ 3 errors generated. Fixes the following errors with GCC: drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c:312:14: error: initializer element is not constant .drm_mode = s6d7aa0_lsl080al02_mode, ^~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c:312:14: note: (near initialization for 's6d7aa0_lsl080al02_desc.drm_mode') drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c:415:14: error: initializer element is not constant .drm_mode = s6d7aa0_lsl080al03_mode, ^~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c:415:14: note: (near initialization for 's6d7aa0_lsl080al03_desc.drm_mode') drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c:443:14: error: initializer element is not constant .drm_mode = s6d7aa0_ltl101at01_mode, ^~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c:443:14: note: (near initialization for 's6d7aa0_ltl101at01_desc.drm_mode') Reported-by: Nathan Chancellor <nathan@kernel.org> Link: https://lore.kernel.org/lkml/20230523180212.GA1401867@dev-arch.thelio-3990X Reported-by: kernelci.org bot <bot@kernelci.org> Link: https://lore.kernel.org/llvm/646c6def.a70a0220.58c1a.903d@mx.google.com Fixes: 6810bb3 ("drm/panel: Add Samsung S6D7AA0 panel controller driver") Signed-off-by: Artur Weber <aweber.kernel@gmail.com> Acked-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20230524084324.11840-1-aweber.kernel@gmail.com
1 parent 37cee48 commit 6a038f0

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct s6d7aa0_panel_desc {
3737
unsigned int panel_type;
3838
int (*init_func)(struct s6d7aa0 *ctx);
3939
int (*off_func)(struct s6d7aa0 *ctx);
40-
const struct drm_display_mode drm_mode;
40+
const struct drm_display_mode *drm_mode;
4141
unsigned long mode_flags;
4242
u32 bus_flags;
4343
bool has_backlight;
@@ -309,7 +309,7 @@ static const struct s6d7aa0_panel_desc s6d7aa0_lsl080al02_desc = {
309309
.panel_type = S6D7AA0_PANEL_LSL080AL02,
310310
.init_func = s6d7aa0_lsl080al02_init,
311311
.off_func = s6d7aa0_lsl080al02_off,
312-
.drm_mode = s6d7aa0_lsl080al02_mode,
312+
.drm_mode = &s6d7aa0_lsl080al02_mode,
313313
.mode_flags = MIPI_DSI_MODE_VSYNC_FLUSH | MIPI_DSI_MODE_VIDEO_NO_HFP,
314314
.bus_flags = DRM_BUS_FLAG_DE_HIGH,
315315

@@ -412,7 +412,7 @@ static const struct s6d7aa0_panel_desc s6d7aa0_lsl080al03_desc = {
412412
.panel_type = S6D7AA0_PANEL_LSL080AL03,
413413
.init_func = s6d7aa0_lsl080al03_init,
414414
.off_func = s6d7aa0_lsl080al03_off,
415-
.drm_mode = s6d7aa0_lsl080al03_mode,
415+
.drm_mode = &s6d7aa0_lsl080al03_mode,
416416
.mode_flags = MIPI_DSI_MODE_NO_EOT_PACKET,
417417
.bus_flags = 0,
418418

@@ -440,7 +440,7 @@ static const struct s6d7aa0_panel_desc s6d7aa0_ltl101at01_desc = {
440440
.panel_type = S6D7AA0_PANEL_LTL101AT01,
441441
.init_func = s6d7aa0_lsl080al03_init, /* Similar init to LSL080AL03 */
442442
.off_func = s6d7aa0_lsl080al03_off,
443-
.drm_mode = s6d7aa0_ltl101at01_mode,
443+
.drm_mode = &s6d7aa0_ltl101at01_mode,
444444
.mode_flags = MIPI_DSI_MODE_NO_EOT_PACKET,
445445
.bus_flags = 0,
446446

@@ -458,7 +458,7 @@ static int s6d7aa0_get_modes(struct drm_panel *panel,
458458
if (!ctx)
459459
return -EINVAL;
460460

461-
mode = drm_mode_duplicate(connector->dev, &ctx->desc->drm_mode);
461+
mode = drm_mode_duplicate(connector->dev, ctx->desc->drm_mode);
462462
if (!mode)
463463
return -ENOMEM;
464464

0 commit comments

Comments
 (0)