Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+98 -76
-65
drivers/edac/edac_pci.c
··· 28 28 static LIST_HEAD(edac_pci_list); 29 29 static 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 - */ 38 31 struct edac_pci_ctl_info *edac_pci_alloc_ctl_info(unsigned int sz_pvt, 39 32 const char *edac_pci_name) 40 33 { ··· 58 65 } 59 66 EXPORT_SYMBOL_GPL(edac_pci_alloc_ctl_info); 60 67 61 - /* 62 - * edac_pci_free_ctl_info() 63 - * 64 - * Last action on the pci control structure. 65 - * 66 - * call the remove sysfs information, which will unregister 67 - * this control struct's kobj. When that kobj's ref count 68 - * goes to zero, its release function will be call and then 69 - * kfree() the memory. 70 - */ 71 68 void edac_pci_free_ctl_info(struct edac_pci_ctl_info *pci) 72 69 { 73 70 edac_dbg(1, "\n"); ··· 195 212 mutex_unlock(&edac_pci_ctls_mutex); 196 213 } 197 214 198 - /* 199 - * edac_pci_alloc_index: Allocate a unique PCI index number 200 - * 201 - * Return: 202 - * allocated index number 203 - * 204 - */ 205 215 int edac_pci_alloc_index(void) 206 216 { 207 217 return atomic_inc_return(&pci_indexes) - 1; 208 218 } 209 219 EXPORT_SYMBOL_GPL(edac_pci_alloc_index); 210 220 211 - /* 212 - * edac_pci_add_device: Insert the 'edac_dev' structure into the 213 - * edac_pci global list and create sysfs entries associated with 214 - * edac_pci structure. 215 - * @pci: pointer to the edac_device structure to be added to the list 216 - * @edac_idx: A unique numeric identifier to be assigned to the 217 - * 'edac_pci' structure. 218 - * 219 - * Return: 220 - * 0 Success 221 - * !0 Failure 222 - */ 223 221 int edac_pci_add_device(struct edac_pci_ctl_info *pci, int edac_idx) 224 222 { 225 223 edac_dbg(0, "\n"); ··· 246 282 } 247 283 EXPORT_SYMBOL_GPL(edac_pci_add_device); 248 284 249 - /* 250 - * edac_pci_del_device() 251 - * Remove sysfs entries for specified edac_pci structure and 252 - * then remove edac_pci structure from global list 253 - * 254 - * @dev: 255 - * Pointer to 'struct device' representing edac_pci structure 256 - * to remove 257 - * 258 - * Return: 259 - * Pointer to removed edac_pci structure, 260 - * or NULL if device not found 261 - */ 262 285 struct edac_pci_ctl_info *edac_pci_del_device(struct device *dev) 263 286 { 264 287 struct edac_pci_ctl_info *pci; ··· 299 348 int edac_idx; 300 349 }; 301 350 302 - /* 303 - * edac_pci_create_generic_ctl 304 - * 305 - * A generic constructor for a PCI parity polling device 306 - * Some systems have more than one domain of PCI busses. 307 - * For systems with one domain, then this API will 308 - * provide for a generic poller. 309 - * 310 - * This routine calls the edac_pci_alloc_ctl_info() for 311 - * the generic device, with default values 312 - */ 313 351 struct edac_pci_ctl_info *edac_pci_create_generic_ctl(struct device *dev, 314 352 const char *mod_name) 315 353 { ··· 331 391 } 332 392 EXPORT_SYMBOL_GPL(edac_pci_create_generic_ctl); 333 393 334 - /* 335 - * edac_pci_release_generic_ctl 336 - * 337 - * The release function of a generic EDAC PCI polling device 338 - */ 339 394 void edac_pci_release_generic_ctl(struct edac_pci_ctl_info *pci) 340 395 { 341 396 edac_dbg(0, "pci mod=%s\n", pci->mod_name);
+98
drivers/edac/edac_pci.h
··· 153 153 154 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 + */ 156 173 extern struct edac_pci_ctl_info *edac_pci_alloc_ctl_info(unsigned int sz_pvt, 157 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 + */ 159 187 extern 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 + */ 161 196 extern 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 + */ 162 210 extern 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 + */ 163 225 extern 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 + */ 165 243 extern struct edac_pci_ctl_info *edac_pci_create_generic_ctl( 166 244 struct device *dev, 167 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 + */ 169 253 extern 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 + */ 170 261 extern 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 + */ 171 269 extern void edac_pci_remove_sysfs(struct edac_pci_ctl_info *pci); 172 270 173 271 #endif
-11
drivers/edac/edac_pci_sysfs.c
··· 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 - */ 427 421 int edac_pci_create_sysfs(struct edac_pci_ctl_info *pci) 428 422 { 429 423 int err; ··· 453 459 return err; 454 460 } 455 461 456 - /* 457 - * edac_pci_remove_sysfs 458 - * 459 - * remove the controls and attributes for this EDAC PCI device 460 - */ 461 462 void edac_pci_remove_sysfs(struct edac_pci_ctl_info *pci) 462 463 { 463 464 edac_dbg(0, "index=%d\n", pci->pci_idx);