spi/of: Create new device registration method and accessors
authorPantelis Antoniou <pantelis.antoniou@konsulko.com>
Wed, 29 Oct 2014 08:40:37 +0000 (10:40 +0200)
committerGrant Likely <grant.likely@linaro.org>
Tue, 25 Nov 2014 15:35:43 +0000 (15:35 +0000)
commitaff5e3f89a0b07e7edf9243f913378cc27e4110d
tree1d3cc8af2aa2ac1046909e341468464426fcf2e1
parentea7513bbc04170f1cbf42953187a4d8b731c71c4
spi/of: Create new device registration method and accessors

Dynamically inserting spi device nodes requires the use of a single
device registration method. Refactor the existing
of_register_spi_devices() to split out the core functionality for a
single device into a separate function; of_register_spi_device(). This
function will be used by the OF_DYNAMIC overlay code to make live
modifications to the tree.

Methods to lookup a device/master using a device node are added
as well, of_find_spi_master_by_node() & of_find_spi_device_by_node().

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
[grant.likely] Split patch into two pieces for clarity
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Reviewed-by: Mark Brown <broonie@kernel.org>
Cc: <linux-spi@vger.kernel.org>
drivers/spi/spi.c