Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eca39301 authored by Grant Likely's avatar Grant Likely
Browse files

of: Merge of_platform_bus_type with platform_bus_type



of_platform_bus was being used in the same manner as the platform_bus.
The only difference being that of_platform_bus devices are generated
from data in the device tree, and platform_bus devices are usually
statically allocated in platform code.  Having them separate causes
the problem of device drivers having to be registered twice if it
was possible for the same device to appear on either bus.

This patch removes of_platform_bus_type and registers all of_platform
bus devices and drivers on the platform bus instead.  A previous patch
made the of_device structure an alias for the platform_device structure,
and a shim is used to adapt of_platform_drivers to the platform bus.

After all of of_platform_bus drivers are converted to be normal platform
drivers, the shim code can be removed.

Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 05212157
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -26,17 +26,6 @@
#include <linux/topology.h>
#include <asm/atomic.h>

struct bus_type of_platform_bus_type = {
       .uevent	= of_device_uevent,
};
EXPORT_SYMBOL(of_platform_bus_type);

static int __init of_bus_driver_init(void)
{
	return of_bus_type_init(&of_platform_bus_type, "of_platform");
}
postcore_initcall(of_bus_driver_init);

/*
 * The list of OF IDs below is used for matching bus types in the
 * system whose devices are to be exposed as of_platform_devices.
+0 −6
Original line number Diff line number Diff line
@@ -213,15 +213,9 @@ static struct notifier_block dflt_plat_bus_notifier = {
	.priority = INT_MAX,
};

static struct notifier_block dflt_of_bus_notifier = {
	.notifier_call = dflt_bus_notify,
	.priority = INT_MAX,
};

static int __init setup_bus_notifier(void)
{
	bus_register_notifier(&platform_bus_type, &dflt_plat_bus_notifier);
	bus_register_notifier(&of_platform_bus_type, &dflt_of_bus_notifier);

	return 0;
}
+0 −8
Original line number Diff line number Diff line
@@ -82,17 +82,9 @@ static struct notifier_block ppc_swiotlb_plat_bus_notifier = {
	.priority = 0,
};

static struct notifier_block ppc_swiotlb_of_bus_notifier = {
	.notifier_call = ppc_swiotlb_bus_notify,
	.priority = 0,
};

int __init swiotlb_setup_bus_notifier(void)
{
	bus_register_notifier(&platform_bus_type,
			      &ppc_swiotlb_plat_bus_notifier);
	bus_register_notifier(&of_platform_bus_type,
			      &ppc_swiotlb_of_bus_notifier);

	return 0;
}
+0 −12
Original line number Diff line number Diff line
@@ -52,18 +52,6 @@ const struct of_device_id of_default_bus_ids[] = {
	{},
};

struct bus_type of_platform_bus_type = {
       .uevent	= of_device_uevent,
};
EXPORT_SYMBOL(of_platform_bus_type);

static int __init of_bus_driver_init(void)
{
	return of_bus_type_init(&of_platform_bus_type, "of_platform");
}

postcore_initcall(of_bus_driver_init);

static int of_dev_node_match(struct device *dev, void *data)
{
	return to_of_device(dev)->dev.of_node == data;
+0 −7
Original line number Diff line number Diff line
@@ -701,16 +701,9 @@ static struct notifier_block ppc_dflt_plat_bus_notifier = {
	.priority = INT_MAX,
};

static struct notifier_block ppc_dflt_of_bus_notifier = {
	.notifier_call = ppc_dflt_bus_notify,
	.priority = INT_MAX,
};

static int __init setup_bus_notifier(void)
{
	bus_register_notifier(&platform_bus_type, &ppc_dflt_plat_bus_notifier);
	bus_register_notifier(&of_platform_bus_type, &ppc_dflt_of_bus_notifier);

	return 0;
}

Loading