mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] of: move ramoops device creation into common code
Date: Wed, 15 May 2024 13:22:54 +0200	[thread overview]
Message-ID: <20240515112254.288003-1-a.fatoum@pengutronix.de> (raw)

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




             reply	other threads:[~2024-05-15 11:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-15 11:22 Ahmad Fatoum [this message]
2024-05-16  6:06 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240515112254.288003-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox