History log of /linux-master/include/linux/of_platform.h
Revision Date Author Comments
# ef175b29 15-Jan-2021 Rob Herring <robh@kernel.org>

of: Stop circularly including of_device.h and of_platform.h

The DT of_device.h and of_platform.h headers date back to the separate
of_platform_bus_type before it was merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. The headers also include
platform_device.h and of.h. The result was lots of drivers relied on
these implicit includes.

Now the entire tree has been fixed over the last couple of cycles to
explicitly include the necessary headers instead of relying on
of_device.h and/or of_platform.h implicit includes, so the implicit and
circular includes can finally be removed.

Signed-off-by: Rob Herring <robh@kernel.org>


# 73aca58b 17-Jul-2023 Rob Herring <robh@kernel.org>

of: Move of_platform_register_reconfig_notifier() into DT core

There's no reason the generic platform bus code needs to call
of_platform_register_reconfig_notifier(). The notifier can be setup
before the platform bus is. Let's move it into of_core_init() which is
called just before platform_bus_init() instead to keep more of the DT
bits in the DT code.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20230717143718.1715773-1-robh@kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>


# 2e8fff66 29-Mar-2023 Rob Herring <robh@kernel.org>

of: Drop unnecessary includes in headers

Drop unnecessary includes in DT headers. Some simply aren't needed and
some can be replaced with forward declarations.

Link: https://lore.kernel.org/r/20230329-dt-cpu-header-cleanups-v1-5-581e2605fe47@kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>


# 4c32fb7d 29-Mar-2023 Rob Herring <robh@kernel.org>

of: Move of_device_(add|register|unregister) to of_platform.h

As of_device_(add|register|unregister) functions work on struct
platform_device, they should be declared in of_platform.h instead.

This move is transparent for now as both headers include each other.

Link: https://lore.kernel.org/r/20230329-dt-cpu-header-cleanups-v1-2-581e2605fe47@kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>


# 620e8e8b 30-Jun-2022 Matthias Kaehlcke <mka@chromium.org>

of/platform: Add stubs for of_platform_device_create/destroy()

Code for platform_device_create() and of_platform_device_destroy() is
only generated if CONFIG_OF_ADDRESS=y. Add stubs to avoid unresolved
symbols when CONFIG_OF_ADDRESS is not set.

Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Link: https://lore.kernel.org/r/20220630123445.v24.1.I08fd2e1c775af04f663730e9fb4d00e6bbb38541@changeid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1a9517a0 03-May-2022 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Revert "of/platform: Add stubs for of_platform_device_create/destroy()"

This reverts commit 8e8b11956486e3fe8cacf54a1d492ebdd8cc1fb2.

The series still has built errors as reported in linux-next, so revert
it for now.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Link: https://lore.kernel.org/r/20220502210728.0b36f3cd@canb.auug.org.au
Cc: Stephen Boyd <swboyd@chromium.org>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8e8b1195 17-Feb-2022 Matthias Kaehlcke <mka@chromium.org>

of/platform: Add stubs for of_platform_device_create/destroy()

Code for platform_device_create() and of_platform_device_destroy() is
only generated if CONFIG_OF_ADDRESS=y. Add stubs to avoid unresolved
symbols when CONFIG_OF_ADDRESS is not set.

Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Link: https://lore.kernel.org/r/20220217104219.v21.1.I08fd2e1c775af04f663730e9fb4d00e6bbb38541@changeid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 738d5ad1 18-Jun-2021 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Revert "of/platform: Add stubs for of_platform_device_create/destroy()"

This reverts commit 412981e06294dac3254d83bbf71d4184ea911d05 as the
patch series is causing build issues in linux-next at the moment.

Cc: Matthias Kaehlcke <mka@chromium.org>
Link: https://lore.kernel.org/r/YMuRcrE8xlWnFSWW@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 412981e0 09-Jun-2021 Matthias Kaehlcke <mka@chromium.org>

of/platform: Add stubs for of_platform_device_create/destroy()

Code for platform_device_create() and of_platform_device_destroy() is
only generated if CONFIG_OF_ADDRESS=y. Add stubs to avoid unresolved
symbols when CONFIG_OF_ADDRESS is not set.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Link: https://lore.kernel.org/r/20210609150159.v12.3.I08fd2e1c775af04f663730e9fb4d00e6bbb38541@changeid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# af6074fc 26-Dec-2017 Rob Herring <robh@kernel.org>

of: Use SPDX license tag for DT files

Convert remaining DT files to use SPDX-License-Identifier tags.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Reviewed-by: Frank Rowand <frank.rowand@sony.com>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Rob Herring <robh@kernel.org>


# aa767cfb 11-Sep-2017 Arnd Bergmann <arnd@arndb.de>

of: provide inline helper for of_find_device_by_node

The ipmmu-vmsa driver fails in compile-testing on non-OF platforms:

drivers/iommu/ipmmu-vmsa.o: In function `ipmmu_of_xlate':
ipmmu-vmsa.c:(.text+0x740): undefined reference to `of_find_device_by_node'

It would be reasonable to assume that this interface works but
returns failure on non-OF builds, like it does on machines that
have been booted in another way, so this adds another inline
function helper.

Fixes: 7b2d59611fef ("iommu/ipmmu-vmsa: Replace local utlb code with fwspec ids")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Rob Herring <robh@kernel.org>


# c2372c20 22-May-2017 Jan Glauber <jan.glauber@gmail.com>

of/platform: Make of_platform_device_destroy globally visible

of_platform_device_destroy is the counterpart to
of_platform_device_create which is a non-static function.

After creating a platform device it might be neccessary
to destroy it to deal with -EPROBE_DEFER where a
repeated of_platform_device_create call would fail otherwise.

Therefore also make of_platform_device_destroy globally visible.

Signed-off-by: Jan Glauber <jglauber@cavium.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>


# 38b0b219 24-Feb-2017 Benjamin Gaignard <benjamin.gaignard@linaro.org>

of: add devm_ functions for populate and depopulate

Lots of calls to of_platform_populate() are not unbalanced by a call
to of_platform_depopulate(). This create issues while drivers are
bind/unbind.

In way to solve those issues is to add devm_of_platform_populate()
which will call of_platform_depopulate() when the device is unbound
from the bus.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1487952874-23635-2-git-send-email-benjamin.gaignard@linaro.org


# 43443ad6 02-Aug-2015 Hauke Mehrtens <hauke@hauke-m.de>

of/platform: add function to populate default bus

When a default bus like the simple-bus should be used someone had to
call of_platform_populate() with the default match table. This match
table was not exported, so it is impossible for code build as a module
to use this. Instead of exporting of_default_bus_match_table, add a new
function which uses this default match table and populates the bus.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Rob Herring <robh@kernel.org>


# a697c2ef 10-Mar-2015 Guenter Roeck <linux@roeck-us.net>

of/platform: Fix sparc:allmodconfig build

sparc:allmodconfig fails to build with:

drivers/built-in.o: In function `platform_bus_init':
(.init.text+0x3684): undefined reference to `of_platform_register_reconfig_notifier'

of_platform_register_reconfig_notifier is only declared if both OF_ADDRESS
and OF_DYNAMIC are configured. Yet, the include file only declares a dummy
function if OF_DYNAMIC is not configured. The sparc architecture does not
configure OF_ADDRESS, but does configure OF_DYNAMIC, causing above error.

Fixes: 801d728c10db ("of/reconfig: Add OF_DYNAMIC notifier for platform_bus_type")
Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Rob Herring <robh@kernel.org>


# 801d728c 28-Oct-2014 Pantelis Antoniou <pantelis.antoniou@konsulko.com>

of/reconfig: Add OF_DYNAMIC notifier for platform_bus_type

Add OF notifier handler needed for creating/destroying platform devices
according to dynamic runtime changes in the DT live tree.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>


# 75f353b6 24-Jun-2014 Grant Likely <grant.likely@linaro.org>

of/platform: Fix of_platform_device_destroy iteration of devices

of_platform_destroy does not work properly, since the tree
population test was iterating on all devices having as its parent
the given platform device.

The check was intended to check whether any other platform or amba
devices created by of_platform_populate were still populated, but
instead checked for every kind of device. This is wrong, since platform
devices typically create a subsystem regular device and set themselves
as parents.

Instead, go ahead and call the unregister functions for any devices
created with of_platform_populate. The driver core will take care of
unbinding drivers, and drivers are responsible for getting rid of any
child devices that weren't created by of_platform_populate.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>


# c6e126de 15-May-2014 Pawel Moll <pawel.moll@arm.com>

of: Keep track of populated platform devices

In "Device Tree powered" systems, platform devices are usually massively
populated with of_platform_populate() call, executed at some level of
initcalls, either by generic architecture or by platform-specific code.

There are situations though where certain devices must be created (and
bound with drivers) before all the others. This presents a challenge,
as devices created explicitly would be created again by
of_platform_populate().

This patch tries to solve that issue in a generic way, adding a
"populated" flag for a DT node description. Subsequent
of_platform_populate() will skip such nodes (and its children) in
a similar way to the non-available ones.

This patch also adds of_platform_depopulate() as an operation
complementary to the _populate() one. It removes a platform or an amba
device populated from the Device Tree, together with its all children
(leaving, however, devices without associated of_node untouched)
clearing the "populated" flag on the way.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Grant Likely <grant.likely@linaro.org>


# 8c1eb253 11-Mar-2014 Geert Uytterhoeven <geert+renesas@linux-m68k.org>

of: Spelling s/anonymouns/anonymous/

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: devicetree@vger.kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# f70c64f8 21-Apr-2013 Rob Herring <rob.herring@calxeda.com>

of: remove of_platform_driver

The last user of of_platform_driver is converted to a regular
platform_driver, so of_platform_driver can be removed now.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Grant Likely <grant.likely@linaro.org>


# 8a46f4f7 31-May-2013 Arnd Bergmann <arnd@arndb.de>

of: remove #ifdef from linux/of_platform.h

A lot of code uses the functions from of_platform.h when built for
devicetree-enabled platforms but can also be built without them.
In order to avoid using #ifdef everywhere in drivers, this
makes all the function declarations visible, which means we
can use "if (IS_ENABLED(CONFIG_OF))" in driver code and get build
coverage over the code but let the compiler drop the reference
in the object code.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>


# d450f445 18-Feb-2013 Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

<linux/of_platform.h>: fix compilation warnings with DT disabled

Fix the following compilation warnings (in Simon Horman's renesas.git repo):

In file included from arch/arm/mach-shmobile/setup-r8a7779.c:24:0:
include/linux/of_platform.h:107:13: warning: ‘struct of_device_id’ declared
inside parameter list [enabled by default]
include/linux/of_platform.h:107:13: warning: its scope is only this definition
or declaration, which is probably not what you want [enabled by default]
include/linux/of_platform.h:107:13: warning: ‘struct device_node’ declared
inside parameter list [enabled by default]

<linux/of_platform.h> only #include's headers with definitions of the above
mentioned structures if CONFIG_OF_DEVICE=y but uses them even if not. One
solution is to move some #include's out of #ifdef CONFIG_OF_DEVICE and use
incomplete declarations for the rest of the structures where the #ifdef move
doesn't help...

Reported-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>


# ab28698d 19-Dec-2012 Jonas Gorski <jogo@openwrt.org>

of: define struct device in of_platform.h if !OF_DEVICE and !OF_ADDRESS

Fixes the following warning:

include/linux/of_platform.h:106:13: warning: 'struct device' declared
inside parameter list [enabled by default]
include/linux/of_platform.h:106:13: warning: its scope is only this
definition or declaration, which is probably not what you want [enabled
by default]

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Signed-off-by: Rob Herring <robherring2@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# e7cc3aca 02-Mar-2012 Grant Likely <grant.likely@secretlab.ca>

dt: fix twl4030 for non-dt compile on x86

twl4030 still doesn't build correctly for x86 allmodconfig. This
fix solves the missing symbol errors.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Benoit Cousson <b-cousson@ti.com>


# 964dba28 24-Feb-2012 Grant Likely <grant.likely@secretlab.ca>

devicetree: Add empty of_platform_populate() for !CONFIG_OF_ADDRESS (sparc)

Sparc has its own helpers for translating address ranges when the device
tree is parsed at boot time, and it isn't able to use of_platform_populate().
However, there are some device drivers that want to use that function on
other DT enabled platforms (ie. TWL4030). This patch adds an empty
of_platform_populate() implementation that returns an error when
CONFIG_OF_ADDRESS is not selected.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Benoit Cousson <b-cousson@ti.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>


# 7755c471 26-May-2011 Paul Gortmaker <paul.gortmaker@windriver.com>

of_platform.h: delete needless include <linux/module.h>

There is nothing modular in this file, and no reason to drag
in all the 357 headers that module.h brings with it, since
it just slows down compiles.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>


# 15c3597d 21-Jun-2011 Grant Likely <grant.likely@secretlab.ca>

dt/platform: allow device name to be overridden

Some platform code has specific requirements on the naming of devices.
This patch allows callers of of_platform_populate() to provide a
device name lookup table.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# 29d4f8a4 21-Jun-2011 Grant Likely <grant.likely@secretlab.ca>

dt: add of_platform_populate() for creating device from the device tree

of_platform_populate() is similar to of_platform_bus_probe() except
that it strictly enforces that all device nodes must have a compatible
property, and it can be used to register devices (not buses) which are
children of the root node.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# cbb49c26 21-Jun-2011 Grant Likely <grant.likely@secretlab.ca>

dt: Add default match table for bus ids

No need for most platforms to define their own bus table when calling
of_platform_populate(). Supply a stock one.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# 1eed4c07 18-Mar-2011 Grant Likely <grant.likely@secretlab.ca>

dt: eliminate OF_NO_DEEP_PROBE and test for NULL match table

There are no users of OF_NO_DEEP_PROBE, and of_match_node() now
gracefully handles being passed a NULL pointer, so the checks at the
top of of_platform_bus_probe can be dropped.

While at it, consolidate the root node pointer check to be easier to
read and tidy up related comments.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# d714d197 22-Feb-2011 Grant Likely <grant.likely@secretlab.ca>

dt: eliminate of_platform_driver shim code

Commit eca393016, "of: Merge of_platform_bus_type with
platform_bus_type" added a shim to allow of_platform_drivers to get
registers onto the platform bus so that there was time to migrate the
existing drivers to the platform_bus_type.

This patch removes the shim since there are no more users of the old
interface.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# 710ac54b 17-Feb-2011 Grant Likely <grant.likely@secretlab.ca>

dt/powerpc: move of_bus_type infrastructure to ibmebus

arch/powerpc/kernel/ibmebus.c is the only remaining user of the
of_bus_type support code for initializing the bus and registering
drivers. All others have either been switched to the vanilla platform
bus or already have their own infrastructure.

This patch moves the functionality that ibmebus is using out of
drivers/of/{platform,device}.c and into ibmebus.c where it is actually
used. Also renames the moved symbols from of_platform_* to
ibmebus_bus_* to reflect the actual usage.

This patch is part of moving all of the of_platform_bus_type users
over to the platform_bus_type.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# 2dc11581 06-Aug-2010 Grant Likely <grant.likely@secretlab.ca>

of/device: Replace struct of_device with struct platform_device

of_device is just an alias for platform_device, so remove it entirely. Also
replace to_of_device() with to_platform_device() and update comment blocks.

This patch was initially generated from the following semantic patch, and then
edited by hand to pick up the bits that coccinelle didn't catch.

@@
@@
-struct of_device
+struct platform_device

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Reviewed-by: David S. Miller <davem@davemloft.net>


# c0dd394c 23-Jul-2010 Jonas Bonn <jonas@southpole.se>

of: remove of_default_bus_ids

This list used was by only two platforms with all other platforms defining an
own list of valid bus id's to pass to of_platform_bus_probe. This patch:

i) copies the default list to the two platforms that depended on it (powerpc)
ii) remove the usage of of_default_bus_ids in of_platform_bus_probe
iii) removes the definition of the list from all architectures that defined it

Passing a NULL 'matches' parameter to of_platform_bus_probe is still valid; the
function returns no error in that case as the NULL value is equivalent to an
empty list.

Signed-off-by: Jonas Bonn <jonas@southpole.se>
[grant.likely@secretlab.ca: added __initdata annotations, warn on and return error on missing match table, and fix whitespace errors]
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# 94a0cb1f 22-Jul-2010 Grant Likely <grant.likely@secretlab.ca>

of/device: Replace of_device with platform_device in includes and core code

of_device is currently just an #define alias to platform_device until it
gets removed entirely. This patch removes references to it from the
include directories and the core drivers/of code.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: David S. Miller <davem@davemloft.net>


# 129ac799 29-Jun-2010 Grant Likely <grant.likely@secretlab.ca>

of: remove asm/of_platform.h

Only thing left in it is of_instantiate_rtc() which can be moved to
asm/prom.h on PowerPC and is unused in microblaze.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: David S. Miller <davem@davemloft.net>


# 1ab1d63a 24-Jun-2010 Grant Likely <grant.likely@secretlab.ca>

of/platform: remove all of_bus_type and of_platform_bus_type references

Both of_bus_type and of_platform_bus_type are just #define aliases
for the platform bus. This patch removes all references to them and
switches to the of_register_platform_driver()/of_unregister_platform_driver()
API for registering.

Subsequent patches will convert each user of of_register_platform_driver()
into plain platform_drivers without the of_platform_driver shim. At which
point the of_register_platform_driver()/of_unregister_platform_driver()
functions can be removed.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: David S. Miller <davem@davemloft.net>


# eca39301 08-Jun-2010 Grant Likely <grant.likely@secretlab.ca>

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: Grant Likely <grant.likely@secretlab.ca>
Acked-by: David S. Miller <davem@davemloft.net>


# 94c09319 08-Jun-2010 Grant Likely <grant.likely@secretlab.ca>

of: Merge of_device_alloc() and of_device_make_bus_id()

This patch merges the common routines of_device_alloc() and
of_device_make_bus_id() from powerpc and microblaze.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
CC: Michal Simek <monstr@monstr.eu>
CC: Grant Likely <grant.likely@secretlab.ca>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Stephen Rothwell <sfr@canb.auug.org.au>
CC: microblaze-uclinux@itee.uq.edu.au
CC: linuxppc-dev@ozlabs.org
CC: devicetree-discuss@lists.ozlabs.org


# 5fd200f3 08-Jun-2010 Grant Likely <grant.likely@secretlab.ca>

of/device: Merge of_platform_bus_probe()

Merge common code between PowerPC and microblaze. This patch merges
the code that scans the tree and registers devices. The functions
merged are of_platform_bus_probe(), of_platform_bus_create(), and
of_platform_device_create().

This patch also move the of_default_bus_ids[] table out of a Microblaze
header file and makes it non-static. The device ids table isn't merged
because powerpc and microblaze use different default data.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
CC: Michal Simek <monstr@monstr.eu>
CC: Grant Likely <grant.likely@secretlab.ca>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Stephen Rothwell <sfr@canb.auug.org.au>
CC: microblaze-uclinux@itee.uq.edu.au
CC: linuxppc-dev@ozlabs.org


# 4018294b 13-Apr-2010 Grant Likely <grant.likely@secretlab.ca>

of: Remove duplicate fields from of_platform_driver

.name, .match_table and .owner are duplicated in both of_platform_driver
and device_driver. This patch is a removes the extra copies from struct
of_platform_driver and converts all users to the device_driver members.

This patch is a pretty mechanical change. The usage model doesn't change
and if any drivers have been missed, or if anything has been fixed up
incorrectly, then it will fail with a compile time error, and the fixup
will be trivial. This patch looks big and scary because it touches so
many files, but it should be pretty safe.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Sean MacLennan <smaclennan@pikatech.com>


# efb2e014 13-Apr-2010 Grant Likely <grant.likely@secretlab.ca>

of: protect contents of of_platform.h and of_device.h

Only process contents of of_platform.h and of_device.h if
CONFIG_OF_DEVICE is set.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# 0763ed23 30-Apr-2009 Grant Likely <grant.likely@secretlab.ca>

of: make of_(un)register_platform_driver common code

Some drivers using of_register_platform_driver() wrapper break on sparc
because the wrapper isn't in the header file. This patch moves it from
Microblaze and PowerPC implementations and makes it common code.

Fixes this sparc64 allmodconfig build error (at least):

drivers/leds/leds-gpio.c: In function `gpio_led_init':
drivers/leds/leds-gpio.c:295: error: implicit declaration of function `of_register_platform_driver'
drivers/leds/leds-gpio.c: In function `gpio_led_exit':
drivers/leds/leds-gpio.c:311: error: implicit declaration of function `of_unregister_platform_driver'

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: David S. Miller <davem@davemloft.net>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# c9bb6003 30-Oct-2008 David S. Miller <davem@davemloft.net>

of: Fix comment, sparc no longer uses of_device objects on special busses.

It only uses of_platform_bus_type.

Signed-off-by: David S. Miller <davem@davemloft.net>


# 5c457083 17-Oct-2007 Stephen Rothwell <sfr@canb.auug.org.au>

[SPARC/64]: Consolidate of_register_driver

Also of_unregister_driver. These will be shortly also used by the
PowerPC code.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 51d26112 21-Jul-2007 Stephen Rothwell <sfr@canb.auug.org.au>

[POWERPC] Constify of_platform_driver match_table

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 8bf8df71 21-Jul-2007 Stephen Rothwell <sfr@canb.auug.org.au>

[POWERPC] Constify of_platform_driver name

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 3f23de10 02-May-2007 Stephen Rothwell <sfr@canb.auug.org.au>

Create drivers/of/platform.c

and populate it with the common parts from PowerPC and Sparc[64].

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Paul Mackerras <paulus@samba.org>
Acked-by: David S. Miller <davem@davemloft.net>


# b41912ca 01-May-2007 Stephen Rothwell <sfr@canb.auug.org.au>

Create linux/of_platorm.h

Move common stuff from asm-powerpc/of_platform.h to here and
move the common bits from asm-sparc*/of_device.h here as well.

Create asm-sparc*/of_platform.h and move appropriate parts of
of_device.h to them.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Paul Mackerras <paulus@samba.org>
Acked-by: David S. Miller <davem@davemloft.net>