overlay_bad_add_dup_prop.dts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // SPDX-License-Identifier: GPL-2.0
  2. /dts-v1/;
  3. /plugin/;
  4. /*
  5. * &electric_1/motor-1/electric and &spin_ctrl_1/electric are the same node:
  6. * /testcase-data-2/substation@100/motor-1/electric
  7. *
  8. * Thus the property "rpm_avail" in each fragment will
  9. * result in an attempt to update the same property twice.
  10. * This will result in an error and the overlay apply
  11. * will fail.
  12. *
  13. * The previous version of this test did not include the extra
  14. * level of node 'electric'. That resulted in the 'rpm_avail'
  15. * property being located in the pre-existing node 'motor-1'.
  16. * Modifying a property results in a WARNING that a memory leak
  17. * will occur if the overlay is removed. Since the overlay apply
  18. * fails, the memory leak does actually occur, and kmemleak will
  19. * further report the memory leak if CONFIG_DEBUG_KMEMLEAK is
  20. * enabled. Adding the overlay node 'electric' avoids the
  21. * memory leak and thus people who use kmemleak will not
  22. * have to debug this non-problem again.
  23. */
  24. &electric_1 {
  25. motor-1 {
  26. electric {
  27. rpm_avail = < 100 >;
  28. };
  29. };
  30. };
  31. &spin_ctrl_1 {
  32. electric {
  33. rpm_avail = < 100 200 >;
  34. };
  35. };