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

Configure Feed

Select the types of activity you want to include in your feed.

drm/panel: panel-simple: get rid of panel_dpi hack

The empty panel_dpi struct was only ever used as a discriminant, but
it's kind of a hack, and with the reworks done in the previous patches,
we shouldn't need it anymore.

Let's get rid of it.

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Tested-by: Francesco Dolcini <francesco.dolcini@toradex.com> # Toradex Colibri iMX6
Link: https://lore.kernel.org/r/20250626-drm-panel-simple-fixes-v2-5-5afcaa608bdc@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>

+18 -9
+18 -9
drivers/gpu/drm/panel/panel-simple.c
··· 439 439 .get_timings = panel_simple_get_timings, 440 440 }; 441 441 442 - static struct panel_desc panel_dpi; 443 - 444 442 static struct panel_desc *panel_dpi_probe(struct device *dev) 445 443 { 446 444 struct display_timing *timing; ··· 591 593 const struct panel_desc *desc; 592 594 593 595 desc = of_device_get_match_data(dev); 594 - if (!desc) 595 - return ERR_PTR(-ENODEV); 596 - 597 - if (desc == &panel_dpi) 598 - return panel_dpi_probe(dev); 596 + if (!desc) { 597 + /* 598 + * panel-dpi probes without a descriptor and 599 + * panel_dpi_probe() will initialize one for us 600 + * based on the device tree. 601 + */ 602 + if (of_device_is_compatible(dev->of_node, "panel-dpi")) 603 + return panel_dpi_probe(dev); 604 + else 605 + return ERR_PTR(-ENODEV); 606 + } 599 607 600 608 return desc; 601 609 } ··· 655 651 return ERR_PTR(-EPROBE_DEFER); 656 652 } 657 653 658 - if ((desc != &panel_dpi) && 654 + if (!of_device_is_compatible(dev->of_node, "panel-dpi") && 659 655 !of_get_display_timing(dev->of_node, "panel-timing", &dt)) 660 656 panel_simple_parse_panel_timing_node(dev, panel, &dt); 661 657 ··· 5404 5400 }, { 5405 5401 /* Must be the last entry */ 5406 5402 .compatible = "panel-dpi", 5407 - .data = &panel_dpi, 5403 + 5404 + /* 5405 + * Explicitly NULL, the panel_desc structure will be 5406 + * allocated by panel_dpi_probe(). 5407 + */ 5408 + .data = NULL, 5408 5409 }, { 5409 5410 /* sentinel */ 5410 5411 }