aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2016-10-26 14:13:43 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-12-15 05:54:51 -0500
commitfdaf0b3505f330b8a56ddec4e904049be998d6d1 (patch)
tree5f1dd970d1896b9615f890d29259bca796f942df
parent5336f75499bbb293910b3502b3c4a4f9ab9ff078 (diff)
edac: move documentation from edac_pci*.c to edac_pci.h
Several functions are documented at edac_pci.c and edac_pci_sysfs.c. As we'll be including edac_pci.h at drivers-api book, move those, in order for the kernel-doc markups be part of the API documentation book. As several of those kernel-doc macros are not in the right format, fix them. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r--drivers/edac/edac_pci.c65
-rw-r--r--drivers/edac/edac_pci.h98
-rw-r--r--drivers/edac/edac_pci_sysfs.c11
3 files changed, 98 insertions, 76 deletions
diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c
index 02a0af4f53b3..4e9d5632041a 100644
--- a/drivers/edac/edac_pci.c
+++ b/drivers/edac/edac_pci.c
@@ -28,13 +28,6 @@ static DEFINE_MUTEX(edac_pci_ctls_mutex);
28static LIST_HEAD(edac_pci_list); 28static LIST_HEAD(edac_pci_list);
29static atomic_t pci_indexes = ATOMIC_INIT(0); 29static atomic_t pci_indexes = ATOMIC_INIT(0);
30 30
31/*
32 * edac_pci_alloc_ctl_info
33 *
34 * The alloc() function for the 'edac_pci' control info
35 * structure. The chip driver will allocate one of these for each
36 * edac_pci it is going to control/register with the EDAC CORE.
37 */
38struct edac_pci_ctl_info *edac_pci_alloc_ctl_info(unsigned int sz_pvt, 31struct edac_pci_ctl_info *edac_pci_alloc_ctl_info(unsigned int sz_pvt,
39 const char *edac_pci_name) 32 const char *edac_pci_name)
40{ 33{
@@ -65,16 +58,6 @@ struct edac_pci_ctl_info *edac_pci_alloc_ctl_info(unsigned int sz_pvt,
65} 58}
66EXPORT_SYMBOL_GPL(edac_pci_alloc_ctl_info); 59EXPORT_SYMBOL_GPL(edac_pci_alloc_ctl_info);
67 60
68/*
69 * edac_pci_free_ctl_info()
70 *
71 * Last action on the pci control structure.
72 *
73 * call the remove sysfs information, which will unregister
74 * this control struct's kobj. When that kobj's ref count
75 * goes to zero, its release function will be call and then
76 * kfree() the memory.
77 */
78void edac_pci_free_ctl_info(struct edac_pci_ctl_info *pci) 61void edac_pci_free_ctl_info(struct edac_pci_ctl_info *pci)
79{ 62{
80 edac_dbg(1, "\n"); 63 edac_dbg(1, "\n");
@@ -212,31 +195,12 @@ static void edac_pci_workq_function(struct work_struct *work_req)
212 mutex_unlock(&edac_pci_ctls_mutex); 195 mutex_unlock(&edac_pci_ctls_mutex);
213} 196}
214 197
215/*
216 * edac_pci_alloc_index: Allocate a unique PCI index number
217 *
218 * Return:
219 * allocated index number
220 *
221 */
222int edac_pci_alloc_index(void) 198int edac_pci_alloc_index(void)
223{ 199{
224 return atomic_inc_return(&pci_indexes) - 1; 200 return atomic_inc_return(&pci_indexes) - 1;
225} 201}
226EXPORT_SYMBOL_GPL(edac_pci_alloc_index); 202EXPORT_SYMBOL_GPL(edac_pci_alloc_index);
227 203
228/*
229 * edac_pci_add_device: Insert the 'edac_dev' structure into the
230 * edac_pci global list and create sysfs entries associated with
231 * edac_pci structure.
232 * @pci: pointer to the edac_device structure to be added to the list
233 * @edac_idx: A unique numeric identifier to be assigned to the
234 * 'edac_pci' structure.
235 *
236 * Return:
237 * 0 Success
238 * !0 Failure
239 */
240int edac_pci_add_device(struct edac_pci_ctl_info *pci, int edac_idx) 204int edac_pci_add_device(struct edac_pci_ctl_info *pci, int edac_idx)
241{ 205{
242 edac_dbg(0, "\n"); 206 edac_dbg(0, "\n");
@@ -282,19 +246,6 @@ fail0:
282} 246}
283EXPORT_SYMBOL_GPL(edac_pci_add_device); 247EXPORT_SYMBOL_GPL(edac_pci_add_device);
284 248
285/*
286 * edac_pci_del_device()
287 * Remove sysfs entries for specified edac_pci structure and
288 * then remove edac_pci structure from global list
289 *
290 * @dev:
291 * Pointer to 'struct device' representing edac_pci structure
292 * to remove
293 *
294 * Return:
295 * Pointer to removed edac_pci structure,
296 * or NULL if device not found
297 */
298struct edac_pci_ctl_info *edac_pci_del_device(struct device *dev) 249struct edac_pci_ctl_info *edac_pci_del_device(struct device *dev)
299{ 250{
300 struct edac_pci_ctl_info *pci; 251 struct edac_pci_ctl_info *pci;
@@ -348,17 +299,6 @@ struct edac_pci_gen_data {
348 int edac_idx; 299 int edac_idx;
349}; 300};
350 301
351/*
352 * edac_pci_create_generic_ctl
353 *
354 * A generic constructor for a PCI parity polling device
355 * Some systems have more than one domain of PCI busses.
356 * For systems with one domain, then this API will
357 * provide for a generic poller.
358 *
359 * This routine calls the edac_pci_alloc_ctl_info() for
360 * the generic device, with default values
361 */
362struct edac_pci_ctl_info *edac_pci_create_generic_ctl(struct device *dev, 302struct edac_pci_ctl_info *edac_pci_create_generic_ctl(struct device *dev,
363 const char *mod_name) 303 const char *mod_name)
364{ 304{
@@ -391,11 +331,6 @@ struct edac_pci_ctl_info *edac_pci_create_generic_ctl(struct device *dev,
391} 331}
392EXPORT_SYMBOL_GPL(edac_pci_create_generic_ctl); 332EXPORT_SYMBOL_GPL(edac_pci_create_generic_ctl);
393 333
394/*
395 * edac_pci_release_generic_ctl
396 *
397 * The release function of a generic EDAC PCI polling device
398 */
399void edac_pci_release_generic_ctl(struct edac_pci_ctl_info *pci) 334void edac_pci_release_generic_ctl(struct edac_pci_ctl_info *pci)
400{ 335{
401 edac_dbg(0, "pci mod=%s\n", pci->mod_name); 336 edac_dbg(0, "pci mod=%s\n", pci->mod_name);
diff --git a/drivers/edac/edac_pci.h b/drivers/edac/edac_pci.h
index 9da0c6fb0634..5175f5724cfa 100644
--- a/drivers/edac/edac_pci.h
+++ b/drivers/edac/edac_pci.h
@@ -153,21 +153,119 @@ static inline void pci_write_bits32(struct pci_dev *pdev, int offset,
153 153
154#endif /* CONFIG_PCI */ 154#endif /* CONFIG_PCI */
155 155
156/*
157 * edac_pci APIs
158 */
159
160/**
161 * edac_pci_alloc_ctl_info:
162 * The alloc() function for the 'edac_pci' control info
163 * structure.
164 *
165 * @sz_pvt: size of the private info at struct &edac_pci_ctl_info
166 * @edac_pci_name: name of the PCI device
167 *
168 * The chip driver will allocate one of these for each
169 * edac_pci it is going to control/register with the EDAC CORE.
170 *
171 * Returns: a pointer to struct &edac_pci_ctl_info on success; %NULL otherwise.
172 */
156extern struct edac_pci_ctl_info *edac_pci_alloc_ctl_info(unsigned int sz_pvt, 173extern struct edac_pci_ctl_info *edac_pci_alloc_ctl_info(unsigned int sz_pvt,
157 const char *edac_pci_name); 174 const char *edac_pci_name);
158 175
176/**
177 * edac_pci_free_ctl_info():
178 * Last action on the pci control structure.
179 *
180 * @pci: pointer to struct &edac_pci_ctl_info
181 *
182 * Calls the remove sysfs information, which will unregister
183 * this control struct's kobj. When that kobj's ref count
184 * goes to zero, its release function will be call and then
185 * kfree() the memory.
186 */
159extern void edac_pci_free_ctl_info(struct edac_pci_ctl_info *pci); 187extern void edac_pci_free_ctl_info(struct edac_pci_ctl_info *pci);
160 188
189/**
190 * edac_pci_alloc_index: Allocate a unique PCI index number
191 *
192 * Returns:
193 * allocated index number
194 *
195 */
161extern int edac_pci_alloc_index(void); 196extern int edac_pci_alloc_index(void);
197
198/**
199 * edac_pci_add_device(): Insert the 'edac_dev' structure into the
200 * edac_pci global list and create sysfs entries associated with
201 * edac_pci structure.
202 *
203 * @pci: pointer to the edac_device structure to be added to the list
204 * @edac_idx: A unique numeric identifier to be assigned to the
205 * 'edac_pci' structure.
206 *
207 * Returns:
208 * 0 on Success, or an error code on failure
209 */
162extern int edac_pci_add_device(struct edac_pci_ctl_info *pci, int edac_idx); 210extern int edac_pci_add_device(struct edac_pci_ctl_info *pci, int edac_idx);
211
212/**
213 * edac_pci_del_device()
214 * Remove sysfs entries for specified edac_pci structure and
215 * then remove edac_pci structure from global list
216 *
217 * @dev:
218 * Pointer to 'struct device' representing edac_pci structure
219 * to remove
220 *
221 * Returns:
222 * Pointer to removed edac_pci structure,
223 * or %NULL if device not found
224 */
163extern struct edac_pci_ctl_info *edac_pci_del_device(struct device *dev); 225extern struct edac_pci_ctl_info *edac_pci_del_device(struct device *dev);
164 226
227/**
228 * edac_pci_create_generic_ctl()
229 * A generic constructor for a PCI parity polling device
230 * Some systems have more than one domain of PCI busses.
231 * For systems with one domain, then this API will
232 * provide for a generic poller.
233 *
234 * @dev: pointer to struct &device;
235 * @mod_name: name of the PCI device
236 *
237 * This routine calls the edac_pci_alloc_ctl_info() for
238 * the generic device, with default values
239 *
240 * Returns: Pointer to struct &edac_pci_ctl_info on success, %NULL on
241 * failure.
242 */
165extern struct edac_pci_ctl_info *edac_pci_create_generic_ctl( 243extern struct edac_pci_ctl_info *edac_pci_create_generic_ctl(
166 struct device *dev, 244 struct device *dev,
167 const char *mod_name); 245 const char *mod_name);
168 246
247/**
248 * edac_pci_release_generic_ctl
249 * The release function of a generic EDAC PCI polling device
250 *
251 * @pci: pointer to struct &edac_pci_ctl_info
252 */
169extern void edac_pci_release_generic_ctl(struct edac_pci_ctl_info *pci); 253extern void edac_pci_release_generic_ctl(struct edac_pci_ctl_info *pci);
254
255/**
256 * edac_pci_create_sysfs
257 * Create the controls/attributes for the specified EDAC PCI device
258 *
259 * @pci: pointer to struct &edac_pci_ctl_info
260 */
170extern int edac_pci_create_sysfs(struct edac_pci_ctl_info *pci); 261extern int edac_pci_create_sysfs(struct edac_pci_ctl_info *pci);
262
263/**
264 * edac_pci_remove_sysfs()
265 * remove the controls and attributes for this EDAC PCI device
266 *
267 * @pci: pointer to struct &edac_pci_ctl_info
268 */
171extern void edac_pci_remove_sysfs(struct edac_pci_ctl_info *pci); 269extern void edac_pci_remove_sysfs(struct edac_pci_ctl_info *pci);
172 270
173#endif 271#endif
diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c
index dbeb048d8efb..72c9eb9fdffb 100644
--- a/drivers/edac/edac_pci_sysfs.c
+++ b/drivers/edac/edac_pci_sysfs.c
@@ -418,12 +418,6 @@ static void edac_pci_main_kobj_teardown(void)
418 } 418 }
419} 419}
420 420
421/*
422 *
423 * edac_pci_create_sysfs
424 *
425 * Create the controls/attributes for the specified EDAC PCI device
426 */
427int edac_pci_create_sysfs(struct edac_pci_ctl_info *pci) 421int edac_pci_create_sysfs(struct edac_pci_ctl_info *pci)
428{ 422{
429 int err; 423 int err;
@@ -459,11 +453,6 @@ unregister_cleanup:
459 return err; 453 return err;
460} 454}
461 455
462/*
463 * edac_pci_remove_sysfs
464 *
465 * remove the controls and attributes for this EDAC PCI device
466 */
467void edac_pci_remove_sysfs(struct edac_pci_ctl_info *pci) 456void edac_pci_remove_sysfs(struct edac_pci_ctl_info *pci)
468{ 457{
469 edac_dbg(0, "index=%d\n", pci->pci_idx); 458 edac_dbg(0, "index=%d\n", pci->pci_idx);