Check for empty return code list on adding

Move the check for an empty return code list for sensor removal to
within the function that adds the return codes per sensor. This
eliminates the need to check for an empty return code list prior to
calling this function.

Tested:
    Empty return code sensor removal list is handled

Change-Id: Icdf3692cd79b3198d90ad8c0688104e4a8040186
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
1 file changed
tree: 44169b48212bf552a35ce3765db24eba2ed7c17a
  1. msl/
  2. test/
  3. .gitignore
  4. argument.cpp
  5. argument.hpp
  6. bootstrap.sh
  7. configure.ac
  8. env.cpp
  9. env.hpp
  10. fan_pwm.cpp
  11. fan_pwm.hpp
  12. fan_speed.cpp
  13. fan_speed.hpp
  14. hwmon.cpp
  15. hwmon.hpp
  16. interface.hpp
  17. LICENSE
  18. mainloop.cpp
  19. mainloop.hpp
  20. Makefile.am
  21. readd.cpp
  22. README.iio.md
  23. README.md
  24. sensorset.cpp
  25. sensorset.hpp
  26. sysfs.cpp
  27. sysfs.hpp
  28. targets.hpp
  29. thresholds.hpp
  30. timer.cpp
  31. timer.hpp
  32. util.hpp
README.md

Exposes generic hwmon entries as DBus objects.

To Build

To build this package, do the following steps:

    1. ./bootstrap.sh
    2. ./configure ${CONFIGURE_FLAGS}
    3. make

To clean the repository run `./bootstrap.sh clean`.

D-Bus bus names

To enable the use of Linux features like cgroups prioritization and
udev/systemd control, one instance of phosphor-hwmon is intended to
be run per hwmon sysfs class instance.

This requires an algorithm for selecting a stable, well-known D-Bus busname.

The algorithm is <PREFIX>-<ID>.Hwmon<N> where PREFIX is an autoconf
configurable prefix (BUSNAME_PREFIX, xyz.openbmc_project by default),
ID is a std::hash of the /sys/devices path backing the hwmon class
instance, and N is the implemented phosphor-hwmon D-Bus API version.