summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2023-03-22 11:48:28 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2023-03-22 11:48:28 +0100
commit8a7d2be46eb8e2ef7761fc2c873f8e8e74a92816 (patch)
treef0a6f3427d80d862bb66ecb3d6da3946f62bd334
parent86fbc2d118ecca6c003fb6919d14228aa0717b34 (diff)
downloadbarebox-8a7d2be46eb8e2ef7761fc2c873f8e8e74a92816.tar.gz
barebox-8a7d2be46eb8e2ef7761fc2c873f8e8e74a92816.tar.xz
Revert "of: support of_ensure_probed for top-level machine device"
This reverts commit 2b46c9df976cb8f7ef1b383a1cad3cc134547256.
-rw-r--r--drivers/of/base.c10
-rw-r--r--drivers/of/platform.c2
-rw-r--r--include/of.h1
3 files changed, 4 insertions, 9 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c
index ea4be9c512..82dde9a3f0 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -2513,13 +2513,13 @@ static int of_probe_memory(void)
}
mem_initcall(of_probe_memory);
-struct device *of_platform_device_create_root(struct device_node *np)
+static void of_platform_device_create_root(struct device_node *np)
{
static struct device *dev;
int ret;
if (dev)
- return dev;
+ return;
dev = xzalloc(sizeof(*dev));
dev->id = DEVICE_ID_SINGLE;
@@ -2527,12 +2527,8 @@ struct device *of_platform_device_create_root(struct device_node *np)
dev_set_name(dev, "machine");
ret = platform_device_register(dev);
- if (ret) {
+ if (ret)
free_device(dev);
- return ERR_PTR(ret);
- }
-
- return dev;
}
static const struct of_device_id reserved_mem_matches[] = {
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 683a7821ad..23b8fa7934 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -419,7 +419,7 @@ static struct device *of_device_create_on_demand(struct device_node *np)
parent = of_get_parent(np);
if (!parent)
- return of_platform_device_create_root(np);
+ return NULL;
if (!np->dev && parent->dev)
device_rescan(parent->dev);
diff --git a/include/of.h b/include/of.h
index 0c5c2c0205..3fb6ecec8d 100644
--- a/include/of.h
+++ b/include/of.h
@@ -298,7 +298,6 @@ extern void of_platform_device_dummy_drv(struct device *dev);
extern int of_platform_populate(struct device_node *root,
const struct of_device_id *matches,
struct device *parent);
-extern struct device *of_platform_device_create_root(struct device_node *np);
extern struct device *of_find_device_by_node(struct device_node *np);
extern struct device *of_device_enable_and_register(struct device_node *np);
extern struct device *of_device_enable_and_register_by_name(const char *name);