aboutsummaryrefslogtreecommitdiff
path: root/drivers/of/unittest.c
AgeCommit message (Collapse)Author
2015-02-20of: unitest: Add I2C overlay unit tests.Pantelis Antoniou
Introduce I2C device tree overlay tests. Tests insertion and removal of i2c adapters, i2c devices, and muxes. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: Rob Herring <robh@kernel.org> (cherry picked from commit d5e75500ca401d3128c82c5b0dee2f9b259d5b5c) Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-20of/unittest: Overlays with sub-devices testsPantelis Antoniou
Introduce selftests for overlays using sub-devices present in children nodes. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: Grant Likely <grant.likely@linaro.org> (cherry picked from commit 6b1271de3723a7957c7cc6a7f36ea114f557e730) Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-20of/overlay: Add overlay unittestsPantelis Antoniou
Add unittests for OF overlays. It tests overlay device addition/removal and whether the apply revert sequence is correct. Changes since V1: * Added local fixups entries. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: Grant Likely <grant.likely@linaro.org> (cherry picked from commit 177d271cf3171bb6826ee5189f67dc1f7d34f1da) Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-20of: Refactor __of_node_alloc() into __of_node_dup()Grant Likely
Add a node argument to __of_node_alloc() and rename it to __of_node_dup() so that it can also be used to duplicate a node with its properties. This is important for the overlay code so that it can create new nodes without using separate changeset items for every single property. At the same time rework the overlay code to use the new function and drop the extra changeset items. Signed-off-by: Grant Likely <grant.likely@linaro.org> (cherry picked from commit e51795815ef1a7adc018cbaf05aac46e3d24eda8) Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-20of: Use vargs in __of_node_allocGrant Likely
The overlay code needs to construct a new full_name from the parent name and the node name, but the current method has to allocate and then free an temporary string which is wasteful. Fix this problem by using vargs to pass in a format and arguments into __of_node_alloc(). At the same time remove the allocflags argument to __of_node_alloc(). The only users all use GFP_KERNEL, so there is no need to provide it as an option. If there is ever a need later it can be added back. Signed-off-by: Grant Likely <grant.likely@linaro.org> (cherry picked from commit ef8bbd73a76197cf8362a2b43aaadc5717bd0746) Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-20of/unittest: Rename selftest.c to unittest.cGrant Likely
This is unit testing code. It should use that name because it makes more sense than 'selftest'. Rename the files to match and rename the config variable. Signed-off-by: Grant Likely <grant.likely@linaro.org> (cherry picked from commit 19fd74879a32fb10357e0cda9c8050f01bb3eeb8) Signed-off-by: Mark Brown <broonie@kernel.org>