0034-reset-Fix-compile-when-reset-RESET_CONTROLLER-is-not.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. From b1b9fca8c317afc3f2b78bb54f877e8a830a819d Mon Sep 17 00:00:00 2001
  2. From: John Crispin <blogic@openwrt.org>
  3. Date: Fri, 9 Aug 2013 18:47:27 +0200
  4. Subject: [PATCH 34/36] reset: Fix compile when reset RESET_CONTROLLER is not
  5. selected
  6. Drivers need to protect their reset api calls with #ifdef to avoid compile
  7. errors.
  8. This patch adds dummy wrappers in the same way that linux/of.h does it.
  9. Cc: linux-kernel@vger.kernel.org
  10. Cc: Philipp Zabel <p.zabel@pengutronix.de>
  11. Cc: Gabor Juhos <juhosg@openwrt.org>
  12. ---
  13. include/linux/reset-controller.h | 16 ++++++++++++++
  14. include/linux/reset.h | 43 ++++++++++++++++++++++++++++++++++++++
  15. 2 files changed, 59 insertions(+)
  16. --- a/include/linux/reset-controller.h
  17. +++ b/include/linux/reset-controller.h
  18. @@ -46,7 +46,23 @@ struct reset_controller_dev {
  19. unsigned int nr_resets;
  20. };
  21. +#if defined(CONFIG_RESET_CONTROLLER)
  22. +
  23. int reset_controller_register(struct reset_controller_dev *rcdev);
  24. void reset_controller_unregister(struct reset_controller_dev *rcdev);
  25. +#else
  26. +
  27. +static inline int reset_controller_register(struct reset_controller_dev *rcdev)
  28. +{
  29. + return -ENOSYS;
  30. +}
  31. +
  32. +void reset_controller_unregister(struct reset_controller_dev *rcdev)
  33. +{
  34. +
  35. +}
  36. +
  37. +#endif
  38. +
  39. #endif