Merge remote-tracking branch 'robh/for-next' into devicetree/next
authorGrant Likely <grant.likely@linaro.org>
Sun, 29 Mar 2015 07:59:58 +0000 (08:59 +0100)
committerGrant Likely <grant.likely@linaro.org>
Sun, 29 Mar 2015 07:59:58 +0000 (08:59 +0100)
Conflicts:
drivers/of/unittest.c

1  2 
drivers/of/unittest.c

index a4f90c238e787dab35047284b01be8f41ba3cee7,fdb597766be98de959287769b411ee6038d172ee..e844907c9efa5edeb9f9a98babace1c70a9e1833
@@@ -225,12 -225,11 +225,12 @@@ static void __init of_unittest_check_tr
  
        for_each_of_allnodes(np)
                allnode_count++;
-       child_count = of_selftest_check_node_linkage(of_root);
+       child_count = of_unittest_check_node_linkage(of_root);
  
-       selftest(child_count > 0, "Device node data structure is corrupted\n");
-       selftest(child_count == allnode_count,
+       unittest(child_count > 0, "Device node data structure is corrupted\n");
 -      unittest(child_count == allnode_count, "allnodes list size (%i) doesn't match"
 -               "sibling lists size (%i)\n", allnode_count, child_count);
++      unittest(child_count == allnode_count,
 +               "allnodes list size (%i) doesn't match sibling lists size (%i)\n",
 +               allnode_count, child_count);
        pr_debug("allnodes list size (%i); sibling lists size (%i)\n", allnode_count, child_count);
  }
  
@@@ -751,10 -746,10 +751,10 @@@ static void __init of_unittest_match_no
        }
  }
  
 -struct device test_bus = {
 -      .init_name = "unittest-bus",
 +static const struct platform_device_info test_bus_info = {
 +      .name = "unittest-bus",
  };
- static void __init of_selftest_platform_populate(void)
+ static void __init of_unittest_platform_populate(void)
  {
        int irq, rc;
        struct device_node *np, *child, *grandchild;
        /* Test that a parsing failure does not return -EPROBE_DEFER */
        np = of_find_node_by_path("/testcase-data/testcase-device2");
        pdev = of_find_device_by_node(np);
-       selftest(pdev, "device 2 creation failed\n");
+       unittest(pdev, "device 2 creation failed\n");
        irq = platform_get_irq(pdev, 0);
-       selftest(irq < 0 && irq != -EPROBE_DEFER, "device parsing error failed - %d\n", irq);
+       unittest(irq < 0 && irq != -EPROBE_DEFER, "device parsing error failed - %d\n", irq);
  
 -      if (unittest(np = of_find_node_by_path("/testcase-data/platform-tests"),
 -                   "No testcase data in device tree\n"));
 +      np = of_find_node_by_path("/testcase-data/platform-tests");
-       selftest(np, "No testcase data in device tree\n");
++      unittest(np, "No testcase data in device tree\n");
 +      if (!np)
                return;
  
 -      if (unittest(!(rc = device_register(&test_bus)),
 -                   "testbus registration failed; rc=%i\n", rc));
 +      test_bus = platform_device_register_full(&test_bus_info);
 +      rc = PTR_ERR_OR_ZERO(test_bus);
-       selftest(!rc, "testbus registration failed; rc=%i\n", rc);
++      unittest(!rc, "testbus registration failed; rc=%i\n", rc);
 +      if (rc)
                return;
 +      test_bus->dev.of_node = np;
  
 +      of_platform_populate(np, match, NULL, &test_bus->dev);
        for_each_child_of_node(np, child) {
 -              of_platform_populate(child, match, NULL, &test_bus);
                for_each_child_of_node(child, grandchild)
-                       selftest(of_find_device_by_node(grandchild),
+                       unittest(of_find_device_by_node(grandchild),
                                 "Could not create device for node '%s'\n",
                                 grandchild->name);
        }
  
 -      of_platform_depopulate(&test_bus);
 +      of_platform_depopulate(&test_bus->dev);
        for_each_child_of_node(np, child) {
                for_each_child_of_node(child, grandchild)
-                       selftest(!of_find_device_by_node(grandchild),
+                       unittest(!of_find_device_by_node(grandchild),
                                 "device didn't get destroyed '%s'\n",
                                 grandchild->name);
        }
@@@ -875,17 -866,13 +875,17 @@@ static int attach_node_and_children(str
  }
  
  /**
-  *    selftest_data_add - Reads, copies data from
+  *    unittest_data_add - Reads, copies data from
   *    linked tree and attaches it to the live tree
   */
- static int __init selftest_data_add(void)
+ static int __init unittest_data_add(void)
  {
-       void *selftest_data;
-       struct device_node *selftest_data_node, *np;
+       void *unittest_data;
+       struct device_node *unittest_data_node, *np;
 +      /*
 +       * __dtb_testcases_begin[] and __dtb_testcases_end[] are magically
 +       * created by cmd_dt_S_dtb in scripts/Makefile.lib
 +       */
        extern uint8_t __dtb_testcases_begin[];
        extern uint8_t __dtb_testcases_end[];
        const int size = __dtb_testcases_end - __dtb_testcases_begin;
        }
  
        /* attach the sub-tree to live tree */
-       np = selftest_data_node->child;
+       np = unittest_data_node->child;
        while (np) {
                struct device_node *next = np->sibling;
 +
                np->parent = of_root;
                attach_node_and_children(np);
                np = next;
@@@ -967,8 -953,8 +967,8 @@@ static int unittest_remove(struct platf
        return 0;
  }
  
- static const struct of_device_id selftest_match[] = {
-       { .compatible = "selftest", },
 -static struct of_device_id unittest_match[] = {
++static const struct of_device_id unittest_match[] = {
+       { .compatible = "unittest", },
        {},
  };
  
@@@ -1559,8 -1545,8 +1559,8 @@@ static int unittest_i2c_bus_remove(stru
        return 0;
  }
  
- static const struct of_device_id selftest_i2c_bus_match[] = {
-       { .compatible = "selftest-i2c-bus", },
 -static struct of_device_id unittest_i2c_bus_match[] = {
++static const struct of_device_id unittest_i2c_bus_match[] = {
+       { .compatible = "unittest-i2c-bus", },
        {},
  };