Skip to content

Commit 20167b7

Browse files
brglgregkh
authored andcommitted
nvmem: use EOPNOTSUPP instead of ENOSYS
Checkpatch emits warnings when using ENOSYS. Some of the frameworks started using EOPNOTSUPP as return values for API functions when given subsystem is disabled in Kconfig. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 165589f commit 20167b7

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

include/linux/nvmem-consumer.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ int nvmem_unregister_notifier(struct notifier_block *nb);
9393
static inline struct nvmem_cell *nvmem_cell_get(struct device *dev,
9494
const char *id)
9595
{
96-
return ERR_PTR(-ENOSYS);
96+
return ERR_PTR(-EOPNOTSUPP);
9797
}
9898

9999
static inline struct nvmem_cell *devm_nvmem_cell_get(struct device *dev,
100100
const char *id)
101101
{
102-
return ERR_PTR(-ENOSYS);
102+
return ERR_PTR(-EOPNOTSUPP);
103103
}
104104

105105
static inline void devm_nvmem_cell_put(struct device *dev,
@@ -113,31 +113,31 @@ static inline void nvmem_cell_put(struct nvmem_cell *cell)
113113

114114
static inline void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len)
115115
{
116-
return ERR_PTR(-ENOSYS);
116+
return ERR_PTR(-EOPNOTSUPP);
117117
}
118118

119119
static inline int nvmem_cell_write(struct nvmem_cell *cell,
120120
const char *buf, size_t len)
121121
{
122-
return -ENOSYS;
122+
return -EOPNOTSUPP;
123123
}
124124

125125
static inline int nvmem_cell_read_u32(struct device *dev,
126126
const char *cell_id, u32 *val)
127127
{
128-
return -ENOSYS;
128+
return -EOPNOTSUPP;
129129
}
130130

131131
static inline struct nvmem_device *nvmem_device_get(struct device *dev,
132132
const char *name)
133133
{
134-
return ERR_PTR(-ENOSYS);
134+
return ERR_PTR(-EOPNOTSUPP);
135135
}
136136

137137
static inline struct nvmem_device *devm_nvmem_device_get(struct device *dev,
138138
const char *name)
139139
{
140-
return ERR_PTR(-ENOSYS);
140+
return ERR_PTR(-EOPNOTSUPP);
141141
}
142142

143143
static inline void nvmem_device_put(struct nvmem_device *nvmem)
@@ -153,28 +153,28 @@ static inline ssize_t nvmem_device_cell_read(struct nvmem_device *nvmem,
153153
struct nvmem_cell_info *info,
154154
void *buf)
155155
{
156-
return -ENOSYS;
156+
return -EOPNOTSUPP;
157157
}
158158

159159
static inline int nvmem_device_cell_write(struct nvmem_device *nvmem,
160160
struct nvmem_cell_info *info,
161161
void *buf)
162162
{
163-
return -ENOSYS;
163+
return -EOPNOTSUPP;
164164
}
165165

166166
static inline int nvmem_device_read(struct nvmem_device *nvmem,
167167
unsigned int offset, size_t bytes,
168168
void *buf)
169169
{
170-
return -ENOSYS;
170+
return -EOPNOTSUPP;
171171
}
172172

173173
static inline int nvmem_device_write(struct nvmem_device *nvmem,
174174
unsigned int offset, size_t bytes,
175175
void *buf)
176176
{
177-
return -ENOSYS;
177+
return -EOPNOTSUPP;
178178
}
179179

180180
static inline const char *nvmem_dev_name(struct nvmem_device *nvmem)
@@ -189,12 +189,12 @@ nvmem_del_cell_lookups(struct nvmem_cell_lookup *entries, size_t nentries) {}
189189

190190
static inline int nvmem_register_notifier(struct notifier_block *nb)
191191
{
192-
return -ENOSYS;
192+
return -EOPNOTSUPP;
193193
}
194194

195195
static inline int nvmem_unregister_notifier(struct notifier_block *nb)
196196
{
197-
return -ENOSYS;
197+
return -EOPNOTSUPP;
198198
}
199199

200200
#endif /* CONFIG_NVMEM */
@@ -208,13 +208,13 @@ struct nvmem_device *of_nvmem_device_get(struct device_node *np,
208208
static inline struct nvmem_cell *of_nvmem_cell_get(struct device_node *np,
209209
const char *id)
210210
{
211-
return ERR_PTR(-ENOSYS);
211+
return ERR_PTR(-EOPNOTSUPP);
212212
}
213213

214214
static inline struct nvmem_device *of_nvmem_device_get(struct device_node *np,
215215
const char *name)
216216
{
217-
return ERR_PTR(-ENOSYS);
217+
return ERR_PTR(-EOPNOTSUPP);
218218
}
219219
#endif /* CONFIG_NVMEM && CONFIG_OF */
220220

include/linux/nvmem-provider.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void nvmem_del_cell_table(struct nvmem_cell_table *table);
100100

101101
static inline struct nvmem_device *nvmem_register(const struct nvmem_config *c)
102102
{
103-
return ERR_PTR(-ENOSYS);
103+
return ERR_PTR(-EOPNOTSUPP);
104104
}
105105

106106
static inline void nvmem_unregister(struct nvmem_device *nvmem) {}
@@ -114,8 +114,7 @@ devm_nvmem_register(struct device *dev, const struct nvmem_config *c)
114114
static inline int
115115
devm_nvmem_unregister(struct device *dev, struct nvmem_device *nvmem)
116116
{
117-
return -ENOSYS;
118-
117+
return -EOPNOTSUPP;
119118
}
120119

121120
static inline void nvmem_add_cell_table(struct nvmem_cell_table *table) {}

0 commit comments

Comments
 (0)