sunxi: initial 4.4 support
[openwrt/openwrt.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 diff --git a/drivers/reset/core.c b/drivers/reset/core.c
17 index 77cfc49..9ab9290 100644
18 --- a/drivers/reset/core.c
19 +++ b/drivers/reset/core.c
20 @@ -95,7 +95,7 @@ int reset_control_reset(struct reset_control *rstc)
21 if (rstc->rcdev->ops->reset)
22 return rstc->rcdev->ops->reset(rstc->rcdev, rstc->id);
23
24 - return -ENOSYS;
25 + return -ENOTSUPP;
26 }
27 EXPORT_SYMBOL_GPL(reset_control_reset);
28
29 @@ -108,7 +108,7 @@ int reset_control_assert(struct reset_control *rstc)
30 if (rstc->rcdev->ops->assert)
31 return rstc->rcdev->ops->assert(rstc->rcdev, rstc->id);
32
33 - return -ENOSYS;
34 + return -ENOTSUPP;
35 }
36 EXPORT_SYMBOL_GPL(reset_control_assert);
37
38 @@ -121,7 +121,7 @@ int reset_control_deassert(struct reset_control *rstc)
39 if (rstc->rcdev->ops->deassert)
40 return rstc->rcdev->ops->deassert(rstc->rcdev, rstc->id);
41
42 - return -ENOSYS;
43 + return -ENOTSUPP;
44 }
45 EXPORT_SYMBOL_GPL(reset_control_deassert);
46
47 @@ -136,7 +136,7 @@ int reset_control_status(struct reset_control *rstc)
48 if (rstc->rcdev->ops->status)
49 return rstc->rcdev->ops->status(rstc->rcdev, rstc->id);
50
51 - return -ENOSYS;
52 + return -ENOTSUPP;
53 }
54 EXPORT_SYMBOL_GPL(reset_control_status);
55
56 diff --git a/include/linux/reset.h b/include/linux/reset.h
57 index 6db74ad..c4c097d 100644
58 --- a/include/linux/reset.h
59 +++ b/include/linux/reset.h
60 @@ -74,7 +74,7 @@ static inline void reset_control_put(struct reset_control *rstc)
61
62 static inline int device_reset_optional(struct device *dev)
63 {
64 - return -ENOSYS;
65 + return -ENOTSUPP;
66 }
67
68 static inline struct reset_control *__must_check reset_control_get(
69 @@ -94,19 +94,19 @@ static inline struct reset_control *__must_check devm_reset_control_get(
70 static inline struct reset_control *reset_control_get_optional(
71 struct device *dev, const char *id)
72 {
73 - return ERR_PTR(-ENOSYS);
74 + return ERR_PTR(-ENOTSUPP);
75 }
76
77 static inline struct reset_control *devm_reset_control_get_optional(
78 struct device *dev, const char *id)
79 {
80 - return ERR_PTR(-ENOSYS);
81 + return ERR_PTR(-ENOTSUPP);
82 }
83
84 static inline struct reset_control *of_reset_control_get(
85 struct device_node *node, const char *id)
86 {
87 - return ERR_PTR(-ENOSYS);
88 + return ERR_PTR(-ENOTSUPP);
89 }
90
91 static inline struct reset_control *of_reset_control_get_by_index(