mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] of: move ramoops device creation into common code
@ 2024-05-15 11:22 Ahmad Fatoum
  2024-05-16  6:06 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2024-05-15 11:22 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

We already have a generic place where we check for reserved memory
matches, so add ramoops there as well.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/of/base.c |  1 +
 fs/pstore/ram.c   | 15 ---------------
 2 files changed, 1 insertion(+), 15 deletions(-)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index 3b8878f34be3..2213165fd72d 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -2735,6 +2735,7 @@ static void of_platform_device_create_root(struct device_node *np)
 }
 
 static const struct of_device_id reserved_mem_matches[] = {
+	{ .compatible = "ramoops" },
 	{ .compatible = "nvmem-rmem" },
 	{}
 };
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 9ecf7ef5e901..4cdeca904fad 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -685,21 +685,6 @@ static struct driver ramoops_driver = {
 
 static int __init ramoops_init(void)
 {
-	if (IS_ENABLED(CONFIG_OFTREE)) {
-		struct device_node *node;
-
-		node = of_get_root_node();
-		if (!node)
-			return 0;
-
-		node = of_get_child_by_name(node, "reserved-memory");
-		if (!node)
-			return 0;
-
-		for_each_matching_node(node, ramoops_dt_ids)
-			of_platform_device_create(node, NULL);
-	}
-
 	ramoops_register_dummy();
 	return platform_driver_register(&ramoops_driver);
 }
-- 
2.39.2




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] of: move ramoops device creation into common code
  2024-05-15 11:22 [PATCH] of: move ramoops device creation into common code Ahmad Fatoum
@ 2024-05-16  6:06 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2024-05-16  6:06 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum


On Wed, 15 May 2024 13:22:54 +0200, Ahmad Fatoum wrote:
> We already have a generic place where we check for reserved memory
> matches, so add ramoops there as well.
> 
> 

Applied, thanks!

[1/1] of: move ramoops device creation into common code
      https://git.pengutronix.de/cgit/barebox/commit/?id=34d1c6cc820c (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-16  6:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-15 11:22 [PATCH] of: move ramoops device creation into common code Ahmad Fatoum
2024-05-16  6:06 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox