2
0

142-reset-use-ENOTSUPP-instead-of-ENOSYS.patch 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. From 5a819175b911ce33f3337e1e069d4bcea1ec4788 Mon Sep 17 00:00:00 2001
  2. From: Philipp Zabel <p.zabel@pengutronix.de>
  3. Date: Thu, 29 Oct 2015 09:55:00 +0100
  4. Subject: [PATCH] reset: use ENOTSUPP instead of ENOSYS
  5. ENOSYS is reserved to report invalid syscalls to userspace.
  6. Consistently return ENOTSUPP to indicate that the driver doesn't support
  7. the functionality or the reset framework is not enabled at all.
  8. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
  9. ---
  10. drivers/reset/core.c | 8 ++++----
  11. include/linux/reset.h | 8 ++++----
  12. 2 files changed, 8 insertions(+), 8 deletions(-)
  13. --- a/drivers/reset/core.c
  14. +++ b/drivers/reset/core.c
  15. @@ -95,7 +95,7 @@ int reset_control_reset(struct reset_con
  16. if (rstc->rcdev->ops->reset)
  17. return rstc->rcdev->ops->reset(rstc->rcdev, rstc->id);
  18. - return -ENOSYS;
  19. + return -ENOTSUPP;
  20. }
  21. EXPORT_SYMBOL_GPL(reset_control_reset);
  22. @@ -108,7 +108,7 @@ int reset_control_assert(struct reset_co
  23. if (rstc->rcdev->ops->assert)
  24. return rstc->rcdev->ops->assert(rstc->rcdev, rstc->id);
  25. - return -ENOSYS;
  26. + return -ENOTSUPP;
  27. }
  28. EXPORT_SYMBOL_GPL(reset_control_assert);
  29. @@ -121,7 +121,7 @@ int reset_control_deassert(struct reset_
  30. if (rstc->rcdev->ops->deassert)
  31. return rstc->rcdev->ops->deassert(rstc->rcdev, rstc->id);
  32. - return -ENOSYS;
  33. + return -ENOTSUPP;
  34. }
  35. EXPORT_SYMBOL_GPL(reset_control_deassert);
  36. @@ -136,7 +136,7 @@ int reset_control_status(struct reset_co
  37. if (rstc->rcdev->ops->status)
  38. return rstc->rcdev->ops->status(rstc->rcdev, rstc->id);
  39. - return -ENOSYS;
  40. + return -ENOTSUPP;
  41. }
  42. EXPORT_SYMBOL_GPL(reset_control_status);
  43. --- a/include/linux/reset.h
  44. +++ b/include/linux/reset.h
  45. @@ -74,7 +74,7 @@ static inline void reset_control_put(str
  46. static inline int device_reset_optional(struct device *dev)
  47. {
  48. - return -ENOSYS;
  49. + return -ENOTSUPP;
  50. }
  51. static inline struct reset_control *__must_check reset_control_get(
  52. @@ -94,19 +94,19 @@ static inline struct reset_control *__mu
  53. static inline struct reset_control *reset_control_get_optional(
  54. struct device *dev, const char *id)
  55. {
  56. - return ERR_PTR(-ENOSYS);
  57. + return ERR_PTR(-ENOTSUPP);
  58. }
  59. static inline struct reset_control *devm_reset_control_get_optional(
  60. struct device *dev, const char *id)
  61. {
  62. - return ERR_PTR(-ENOSYS);
  63. + return ERR_PTR(-ENOTSUPP);
  64. }
  65. static inline struct reset_control *of_reset_control_get(
  66. struct device_node *node, const char *id)
  67. {
  68. - return ERR_PTR(-ENOSYS);
  69. + return ERR_PTR(-ENOTSUPP);
  70. }
  71. static inline struct reset_control *of_reset_control_get_by_index(