kernel-ark/drivers/of
Grant Likely 8a2b22a259 of: Make devicetree sysfs update functions consistent.
All of the DT modification functions are split into two parts, the first
part manipulates the DT data structure, and the second part updates
sysfs, but the code isn't very consistent about how the second half is
called. They don't all enforce the same rules about when it is valid to
update sysfs, and there isn't any clarity on locking.

The transactional DT modification feature that is coming also needs
access to these functions so that it can perform all the structure
changes together, and then all the sysfs updates as a second stage
instead of doing each one at a time.

Fix up the second have by creating a separate __of_*_sysfs() function
for each of the helpers. The new functions have consistent naming (ie.
of_node_add() becomes __of_attach_node_sysfs()) and all of them now
defer if of_init hasn't been called yet.

Callers of the new functions must hold the of_mutex to ensure there are
no race conditions with of_init(). The mutex ensures that there will
only ever be one writer to the tree at any given time. There can still
be any number of readers and the raw_spin_lock is still used to make
sure access to the data structure is still consistent.

Finally, put the function prototypes into of_private.h so they are
accessible to the transaction code.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
[grant.likely: Changed suffix from _post to _sysfs to match existing code]
[grant.likely: Reorganized to eliminate trivial wrappers]
Signed-off-by: Grant Likely <grant.likely@linaro.org>
2014-07-23 17:05:06 -06:00
..
testcase-data of: Add a testcase for of_find_node_by_path() 2014-05-23 11:35:30 +09:00
address.c Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm into next 2014-06-05 15:57:04 -07:00
base.c of: Make devicetree sysfs update functions consistent. 2014-07-23 17:05:06 -06:00
device.c of: rename of_aliases_mutex to just of_mutex 2014-07-07 13:42:52 +01:00
dynamic.c of: Make devicetree sysfs update functions consistent. 2014-07-23 17:05:06 -06:00
fdt_address.c of/fdt: add FDT address translation support 2014-05-20 15:19:25 -05:00
fdt.c of: Check for phys_addr_t overflows in early_init_dt_add_memory_arch 2014-06-26 17:28:28 +01:00
irq.c of/irq: do irq resolution in platform_get_irq_byname() 2014-05-23 11:40:25 +09:00
Kconfig of/fdt: Convert FDT functions to use libfdt 2014-04-30 00:59:15 -05:00
Makefile of: Move CONFIG_OF_DYNAMIC code into a separate file 2014-07-07 13:59:45 +01:00
of_mdio.c of: mdio: fixup of_phy_register_fixed_link parsing of new bindings 2014-06-22 21:35:14 -07:00
of_mtd.c of_mtd: Add helpers to get ECC strength and ECC step size 2014-03-10 22:42:28 -07:00
of_net.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-04-02 20:53:45 -07:00
of_pci_irq.c of_pci_irq: kill useless variable in of_irq_parse_pci() 2014-05-27 12:13:34 +01:00
of_pci.c
of_private.h of: Make devicetree sysfs update functions consistent. 2014-07-23 17:05:06 -06:00
of_reserved_mem.c of: align RESERVEDMEM_OF_DECLARE function callbacks to other callbacks 2014-05-20 14:25:21 -05:00
pdt.c of: device_node kobject lifecycle fixes 2014-03-19 14:58:40 +00:00
platform.c of/platform: Fix of_platform_device_destroy iteration of devices 2014-07-07 13:33:46 +01:00
selftest.c OF: Utility helper functions for dynamic nodes 2014-07-16 08:16:17 -06:00