Skip to content
Permalink
Browse files
drm/simpledrm: Bind to OF framebuffers in /chosen
This matches the simplefb behavior; these nodes are not matched by the
standard OF machinery. This fixes a regression when simpledrm replaces
simeplefb.

Signed-off-by: Hector Martin <marcan@marcan.st>
  • Loading branch information
marcan authored and intel-lab-lkp committed Nov 17, 2021
1 parent b6c2472 commit 0be435c1fb3f0722a7099fee532925717a67a42a
Showing 1 changed file with 17 additions and 0 deletions.
@@ -2,6 +2,7 @@

#include <linux/clk.h>
#include <linux/of_clk.h>
#include <linux/of_platform.h>
#include <linux/platform_data/simplefb.h>
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>
@@ -897,5 +898,21 @@ static struct platform_driver simpledrm_platform_driver = {

module_platform_driver(simpledrm_platform_driver);

static int __init simpledrm_init(void)
{
struct device_node *np;

if (IS_ENABLED(CONFIG_OF_ADDRESS) && of_chosen) {
for_each_child_of_node(of_chosen, np) {
if (of_device_is_compatible(np, "simple-framebuffer"))
of_platform_device_create(np, NULL, NULL);
}
}

return 0;
}

fs_initcall(simpledrm_init);

MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL v2");

0 comments on commit 0be435c

Please sign in to comment.