summaryrefslogtreecommitdiffstats
path: root/drivers/of/unittest.c
Commit message (Collapse)AuthorAgeFilesLines
...
* | of/unittest: early return from test skips testsFrank Rowand2015-03-291-4/+6
| | | | | | | | | | | | | | | | | | | | | | Fix bugs pointed out by checkpatch: Mis-coding of two if statements caused early return from function. Number of tests completed increased from 102 to 107. Number of tests failed increased from 0 to 2. Signed-off-by: Frank Rowand <frank.rowand@sonymobile.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
* | of/unittest: breadcrumbs to reduce pain of future maintainersFrank Rowand2015-03-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix warnings pointed out by checkpatch. Checkpatch warns: externs should be avoided in .c files Reducing pain for future maintainers - adding a comment so that anyone trying to find where the extern data is created will be able to find it. (grep will not find that location) Signed-off-by: Frank Rowand <frank.rowand@sonymobile.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
* | of/unittest: reduce checkpatch noise - line after declarationsFrank Rowand2015-03-291-0/+5
| | | | | | | | | | | | | | | | | | | | Fix warnings pointed out by checkpatch. No bug fixes, but reduce the number of checkpatch warnings so that future problems will stand out better. Signed-off-by: Frank Rowand <frank.rowand@sonymobile.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
* | of/unittest: typo in error stringFrank Rowand2015-03-291-2/+3
| | | | | | | | | | | | | | | | | | Fix bug pointed out by checkpatch. Splitting string incorrectly removed a space between two words. Signed-off-by: Frank Rowand <frank.rowand@sonymobile.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
* | of/unittest: add const where neededFrank Rowand2015-03-291-4/+4
|/ | | | | | | | | | Fix warnings pointed out by checkpatch. No bugs fixed, but the test code should be a good example of how to use the devicetree API. Signed-off-by: Frank Rowand <frank.rowand@sonymobile.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
* of: unittest: Add option string test case with longer pathBrian Norris2015-03-191-0/+5
| | | | | | | | | | | | | There were regressions seen with commit 106937e8ccdc ("of: fix handling of '/' in options for of_find_node_by_path()"), where we couldn't handle extra '/' before the ':'. Let's test for this now. Confirmed that this test fails without the previous patch and passes when patched. All other tests pass. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Leif Lindholm <leif.lindholm@linaro.org> Signed-off-by: Rob Herring <robh@kernel.org>
* of: unittest: Add options string testcase variantsPeter Hurley2015-03-101-0/+11
| | | | | | | | Add testcase variants with '/' in the options string to test for scan beyond end path name terminated by ':'. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Rob Herring <robh@kernel.org>
* of/unittest: Fix the wrong expected value in of_selftest_property_stringWang Long2015-03-101-2/+2
| | | | | | | | This patch fix the wrong expected value of of_property_match_string in of_selftest_property_string. Signed-off-by: Wang Long <long.wanglong@huawei.com> Signed-off-by: Rob Herring <robh@kernel.org>
* of/unittest: remove the duplicate of_changeset_initWang Long2015-03-101-1/+0
| | | | | | | | | Remove the duplicate of_changeset_init. In of_selftest_changeset testcase, the "struct of_changeset chgset" is initialized twice, but only once is enough. so, drop the first initializtion code. Signed-off-by: Wang Long <long.wanglong@huawei.com> Signed-off-by: Rob Herring <robh@kernel.org>
* of: unittest: fix I2C dependencyArnd Bergmann2015-03-101-6/+6
| | | | | | | | | | | | | | | The unittest fails to link if I2C or I2C_MUX is a loadable module: drivers/built-in.o: In function `selftest_i2c_mux_remove': unittest.c:(.text+0xb0ce4): undefined reference to `i2c_del_mux_adapter' This changes the newly added IS_ENABLED() checks to use IS_BUILTIN() instead, which evaluates to false if the other driver is a module. Reported-by: Chen Gang <gang.chen.5i5j@gmail.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: d5e75500ca401 ("of: unitest: Add I2C overlay unit tests.") Signed-off-by: Rob Herring <robh@kernel.org>
* Merge remote-tracking branch 'grant/devicetree/next' into for-nextRob Herring2015-02-111-15/+0
|\
| * of/unittest: Remove obsolete codeGrant Likely2015-01-221-15/+0
| | | | | | | | | | | | | | | | | | | | Commit 3ce04b4a9, "Removes OF_UNITTEST dependency on OF_DYNAMIC config symbol" removes a bunch of code, but missed a few minor bits. Clean it up by removing the node removal cache and flag. Signed-off-by: Grant Likely <grant.likely@linaro.org> Cc: Gaurav Minocha <gaurav.minocha.os@gmail.com> Cc: Rob Herring <robh@kernel.org>
* | of: unitest: Add I2C overlay unit tests.Pantelis Antoniou2015-02-041-50/+462
| | | | | | | | | | | | | | | | 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>
* | Merge tag 'v3.19-rc6' into HEADRob Herring2015-02-041-0/+39
|\ \ | |/ |/| | | Linux 3.19-rc6
| * of/unittest: Overlays with sub-devices testsPantelis Antoniou2015-01-231-0/+39
| | | | | | | | | | | | | | | | 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>
* | Removes OF_UNITTEST dependency on OF_DYNAMIC config symbolGaurav Minocha2015-01-131-58/+12
|/ | | | | | | | | | | | | | | | This patch intends to remove the unittests dependency on the functions defined in dynamic.c. So, rather than calling of_attach_node defined in dynamic.c, minimal functionality required to attach a new node is re-defined in unittest.c. Also, now after executing the tests the test data is not removed from the device tree so there is no need to call of_detach_node. Tested with and without OF_DYNAMIC enabled on ppc, arm and x86 Signed-off-by: Gaurav Minocha <gaurav.minocha.os@gmail.com> Signed-off-by: Rob Herring <robh@kernel.org>
* of: Delete unnecessary check before calling "of_node_put()"Markus Elfring2014-12-031-2/+1
| | | | | | | | | | 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>
* of: add optional options parameter to of_find_node_by_path()Leif Lindholm2014-12-031-0/+30
| | | | | | | | | | | | | | | 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>
* of: Remove unneeded and incorrect MODULE_DEVICE_TABLEGrant Likely2014-11-271-1/+0
| | | | | | | | 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>
* of/overlay: Add overlay unittestsPantelis Antoniou2014-11-241-0/+481
| | | | | | | | | | | | | 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>
* of: Refactor __of_node_alloc() into __of_node_dup()Grant Likely2014-11-241-4/+10
| | | | | | | | | | | | | 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>
* of: Use vargs in __of_node_allocGrant Likely2014-11-241-3/+3
| | | | | | | | | | | | | 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>
* Merge tag 'v3.18-rc6' into devicetree/nextGrant Likely2014-11-241-3/+8
| | | | | | | | | | | | 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
* of/unittest: Rename selftest.c to unittest.cGrant Likely2014-11-041-0/+969
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>
OpenPOWER on IntegriCloud