First git repo commit for the libreCMC project
[librecmc/librecmc.git] / target / linux / sunxi / patches-4.4 / 142-reset-use-ENOTSUPP-instead-of-ENOSYS.patch
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
6 ENOSYS is reserved to report invalid syscalls to userspace.
7 Consistently return ENOTSUPP to indicate that the driver doesn't support
8 the functionality or the reset framework is not enabled at all.
9
10 Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
11 ---
12  drivers/reset/core.c  | 8 ++++----
13  include/linux/reset.h | 8 ++++----
14  2 files changed, 8 insertions(+), 8 deletions(-)
15
16 --- a/drivers/reset/core.c
17 +++ b/drivers/reset/core.c
18 @@ -95,7 +95,7 @@ int reset_control_reset(struct reset_con
19         if (rstc->rcdev->ops->reset)
20                 return rstc->rcdev->ops->reset(rstc->rcdev, rstc->id);
21  
22 -       return -ENOSYS;
23 +       return -ENOTSUPP;
24  }
25  EXPORT_SYMBOL_GPL(reset_control_reset);
26  
27 @@ -108,7 +108,7 @@ int reset_control_assert(struct reset_co
28         if (rstc->rcdev->ops->assert)
29                 return rstc->rcdev->ops->assert(rstc->rcdev, rstc->id);
30  
31 -       return -ENOSYS;
32 +       return -ENOTSUPP;
33  }
34  EXPORT_SYMBOL_GPL(reset_control_assert);
35  
36 @@ -121,7 +121,7 @@ int reset_control_deassert(struct reset_
37         if (rstc->rcdev->ops->deassert)
38                 return rstc->rcdev->ops->deassert(rstc->rcdev, rstc->id);
39  
40 -       return -ENOSYS;
41 +       return -ENOTSUPP;
42  }
43  EXPORT_SYMBOL_GPL(reset_control_deassert);
44  
45 @@ -136,7 +136,7 @@ int reset_control_status(struct reset_co
46         if (rstc->rcdev->ops->status)
47                 return rstc->rcdev->ops->status(rstc->rcdev, rstc->id);
48  
49 -       return -ENOSYS;
50 +       return -ENOTSUPP;
51  }
52  EXPORT_SYMBOL_GPL(reset_control_status);
53  
54 --- a/include/linux/reset.h
55 +++ b/include/linux/reset.h
56 @@ -74,7 +74,7 @@ static inline void reset_control_put(str
57  
58  static inline int device_reset_optional(struct device *dev)
59  {
60 -       return -ENOSYS;
61 +       return -ENOTSUPP;
62  }
63  
64  static inline struct reset_control *__must_check reset_control_get(
65 @@ -94,19 +94,19 @@ static inline struct reset_control *__mu
66  static inline struct reset_control *reset_control_get_optional(
67                                         struct device *dev, const char *id)
68  {
69 -       return ERR_PTR(-ENOSYS);
70 +       return ERR_PTR(-ENOTSUPP);
71  }
72  
73  static inline struct reset_control *devm_reset_control_get_optional(
74                                         struct device *dev, const char *id)
75  {
76 -       return ERR_PTR(-ENOSYS);
77 +       return ERR_PTR(-ENOTSUPP);
78  }
79  
80  static inline struct reset_control *of_reset_control_get(
81                                 struct device_node *node, const char *id)
82  {
83 -       return ERR_PTR(-ENOSYS);
84 +       return ERR_PTR(-ENOTSUPP);
85  }
86  
87  static inline struct reset_control *of_reset_control_get_by_index(