Skip to content

Commit 2f92ea2

Browse files
marcanThomas Zimmermann
authored andcommitted
of: Move simple-framebuffer device handling from simplefb to of
This code is required for both simplefb and simpledrm, so let's move it into the OF core instead of having it as an ad-hoc initcall in the drivers. Signed-off-by: Hector Martin <[email protected]> Reviewed-by: Rob Herring <[email protected]> Acked-by: Thomas Zimmermann <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 938db27 commit 2f92ea2

File tree

2 files changed

+5
-20
lines changed

2 files changed

+5
-20
lines changed

drivers/of/platform.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,10 @@ static int __init of_platform_default_populate_init(void)
540540
of_node_put(node);
541541
}
542542

543+
node = of_get_compatible_child(of_chosen, "simple-framebuffer");
544+
of_platform_device_create(node, NULL, NULL);
545+
of_node_put(node);
546+
543547
/* Populate everything else. */
544548
of_platform_default_populate(NULL, NULL, NULL);
545549

drivers/video/fbdev/simplefb.c

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -530,26 +530,7 @@ static struct platform_driver simplefb_driver = {
530530
.remove = simplefb_remove,
531531
};
532532

533-
static int __init simplefb_init(void)
534-
{
535-
int ret;
536-
struct device_node *np;
537-
538-
ret = platform_driver_register(&simplefb_driver);
539-
if (ret)
540-
return ret;
541-
542-
if (IS_ENABLED(CONFIG_OF_ADDRESS) && of_chosen) {
543-
for_each_child_of_node(of_chosen, np) {
544-
if (of_device_is_compatible(np, "simple-framebuffer"))
545-
of_platform_device_create(np, NULL, NULL);
546-
}
547-
}
548-
549-
return 0;
550-
}
551-
552-
fs_initcall(simplefb_init);
533+
module_platform_driver(simplefb_driver);
553534

554535
MODULE_AUTHOR("Stephen Warren <[email protected]>");
555536
MODULE_DESCRIPTION("Simple framebuffer driver");

0 commit comments

Comments
 (0)