aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of/unittest.c
AgeCommit message (Collapse)Author
2015-01-23of/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>
2014-12-03of: Delete unnecessary check before calling "of_node_put()"Markus Elfring
The of_node_put() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Grant Likely <grant.likely@linaro.org>
2014-12-03of: add optional options parameter to of_find_node_by_path()Leif Lindholm
Update of_find_node_by_path(): 1) Rename function to of_find_node_opts_by_path(), adding an optional pointer argument. Provide a static inline wrapper version of of_find_node_by_path() which calls the new function with NULL as the optional argument. 2) Ignore any part of the path beyond and including the ':' separator. 3) Set the new provided pointer argument to the beginning of the string following the ':' separator. 4: Add tests. Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Signed-off-by: Grant Likely <grant.likely@linaro.org>
2014-11-27of: Remove unneeded and incorrect MODULE_DEVICE_TABLEGrant Likely
The unittest code has a MODULE_DEVICE_TABLE that isn't needed by any of the unittests, and isn't even correct. Remove it. Signed-off-by: Grant Likely <grant.likely@linaro.org> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
2014-11-24of/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>
2014-11-24of: 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>
2014-11-24of: 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>
2014-11-24Merge tag 'v3.18-rc6' into devicetree/nextGrant Likely
v3.18-rc6 contains an important DT bug fix, c1a2086e2d, "of/selftest: Fix off-by-one error in removal path" which affects testing of the overlay patch series. Merge it into the devicetree/next staging branch so that the overlay patches are applied on top of a known working tree. Linux 3.18-rc6 Conflicts: drivers/of/address.c
2014-11-04of/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>