aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/edac_pci_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/edac/edac_pci_sysfs.c')
-rw-r--r--drivers/edac/edac_pci_sysfs.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c
index 97f5064e3992..6678216a7cbc 100644
--- a/drivers/edac/edac_pci_sysfs.c
+++ b/drivers/edac/edac_pci_sysfs.c
@@ -78,7 +78,7 @@ static void edac_pci_instance_release(struct kobject *kobj)
78{ 78{
79 struct edac_pci_ctl_info *pci; 79 struct edac_pci_ctl_info *pci;
80 80
81 debugf0("%s()\n", __func__); 81 debugf0("\n");
82 82
83 /* Form pointer to containing struct, the pci control struct */ 83 /* Form pointer to containing struct, the pci control struct */
84 pci = to_instance(kobj); 84 pci = to_instance(kobj);
@@ -161,7 +161,7 @@ static int edac_pci_create_instance_kobj(struct edac_pci_ctl_info *pci, int idx)
161 struct kobject *main_kobj; 161 struct kobject *main_kobj;
162 int err; 162 int err;
163 163
164 debugf0("%s()\n", __func__); 164 debugf0("\n");
165 165
166 /* First bump the ref count on the top main kobj, which will 166 /* First bump the ref count on the top main kobj, which will
167 * track the number of PCI instances we have, and thus nest 167 * track the number of PCI instances we have, and thus nest
@@ -177,14 +177,14 @@ static int edac_pci_create_instance_kobj(struct edac_pci_ctl_info *pci, int idx)
177 err = kobject_init_and_add(&pci->kobj, &ktype_pci_instance, 177 err = kobject_init_and_add(&pci->kobj, &ktype_pci_instance,
178 edac_pci_top_main_kobj, "pci%d", idx); 178 edac_pci_top_main_kobj, "pci%d", idx);
179 if (err != 0) { 179 if (err != 0) {
180 debugf2("%s() failed to register instance pci%d\n", 180 debugf2("failed to register instance pci%d\n",
181 __func__, idx); 181 idx);
182 kobject_put(edac_pci_top_main_kobj); 182 kobject_put(edac_pci_top_main_kobj);
183 goto error_out; 183 goto error_out;
184 } 184 }
185 185
186 kobject_uevent(&pci->kobj, KOBJ_ADD); 186 kobject_uevent(&pci->kobj, KOBJ_ADD);
187 debugf1("%s() Register instance 'pci%d' kobject\n", __func__, idx); 187 debugf1("Register instance 'pci%d' kobject\n", idx);
188 188
189 return 0; 189 return 0;
190 190
@@ -201,7 +201,7 @@ error_out:
201static void edac_pci_unregister_sysfs_instance_kobj( 201static void edac_pci_unregister_sysfs_instance_kobj(
202 struct edac_pci_ctl_info *pci) 202 struct edac_pci_ctl_info *pci)
203{ 203{
204 debugf0("%s()\n", __func__); 204 debugf0("\n");
205 205
206 /* Unregister the instance kobject and allow its release 206 /* Unregister the instance kobject and allow its release
207 * function release the main reference count and then 207 * function release the main reference count and then
@@ -317,7 +317,7 @@ static struct edac_pci_dev_attribute *edac_pci_attr[] = {
317 */ 317 */
318static void edac_pci_release_main_kobj(struct kobject *kobj) 318static void edac_pci_release_main_kobj(struct kobject *kobj)
319{ 319{
320 debugf0("%s() here to module_put(THIS_MODULE)\n", __func__); 320 debugf0("here to module_put(THIS_MODULE)\n");
321 321
322 kfree(kobj); 322 kfree(kobj);
323 323
@@ -345,7 +345,7 @@ static int edac_pci_main_kobj_setup(void)
345 int err; 345 int err;
346 struct bus_type *edac_subsys; 346 struct bus_type *edac_subsys;
347 347
348 debugf0("%s()\n", __func__); 348 debugf0("\n");
349 349
350 /* check and count if we have already created the main kobject */ 350 /* check and count if we have already created the main kobject */
351 if (atomic_inc_return(&edac_pci_sysfs_refcount) != 1) 351 if (atomic_inc_return(&edac_pci_sysfs_refcount) != 1)
@@ -356,7 +356,7 @@ static int edac_pci_main_kobj_setup(void)
356 */ 356 */
357 edac_subsys = edac_get_sysfs_subsys(); 357 edac_subsys = edac_get_sysfs_subsys();
358 if (edac_subsys == NULL) { 358 if (edac_subsys == NULL) {
359 debugf1("%s() no edac_subsys\n", __func__); 359 debugf1("no edac_subsys\n");
360 err = -ENODEV; 360 err = -ENODEV;
361 goto decrement_count_fail; 361 goto decrement_count_fail;
362 } 362 }
@@ -366,7 +366,7 @@ static int edac_pci_main_kobj_setup(void)
366 * level main kobj for EDAC PCI 366 * level main kobj for EDAC PCI
367 */ 367 */
368 if (!try_module_get(THIS_MODULE)) { 368 if (!try_module_get(THIS_MODULE)) {
369 debugf1("%s() try_module_get() failed\n", __func__); 369 debugf1("try_module_get() failed\n");
370 err = -ENODEV; 370 err = -ENODEV;
371 goto mod_get_fail; 371 goto mod_get_fail;
372 } 372 }
@@ -421,15 +421,14 @@ decrement_count_fail:
421 */ 421 */
422static void edac_pci_main_kobj_teardown(void) 422static void edac_pci_main_kobj_teardown(void)
423{ 423{
424 debugf0("%s()\n", __func__); 424 debugf0("\n");
425 425
426 /* Decrement the count and only if no more controller instances 426 /* Decrement the count and only if no more controller instances
427 * are connected perform the unregisteration of the top level 427 * are connected perform the unregisteration of the top level
428 * main kobj 428 * main kobj
429 */ 429 */
430 if (atomic_dec_return(&edac_pci_sysfs_refcount) == 0) { 430 if (atomic_dec_return(&edac_pci_sysfs_refcount) == 0) {
431 debugf0("%s() called kobject_put on main kobj\n", 431 debugf0("called kobject_put on main kobj\n");
432 __func__);
433 kobject_put(edac_pci_top_main_kobj); 432 kobject_put(edac_pci_top_main_kobj);
434 } 433 }
435 edac_put_sysfs_subsys(); 434 edac_put_sysfs_subsys();
@@ -446,7 +445,7 @@ int edac_pci_create_sysfs(struct edac_pci_ctl_info *pci)
446 int err; 445 int err;
447 struct kobject *edac_kobj = &pci->kobj; 446 struct kobject *edac_kobj = &pci->kobj;
448 447
449 debugf0("%s() idx=%d\n", __func__, pci->pci_idx); 448 debugf0("idx=%d\n", pci->pci_idx);
450 449
451 /* create the top main EDAC PCI kobject, IF needed */ 450 /* create the top main EDAC PCI kobject, IF needed */
452 err = edac_pci_main_kobj_setup(); 451 err = edac_pci_main_kobj_setup();
@@ -460,8 +459,8 @@ int edac_pci_create_sysfs(struct edac_pci_ctl_info *pci)
460 459
461 err = sysfs_create_link(edac_kobj, &pci->dev->kobj, EDAC_PCI_SYMLINK); 460 err = sysfs_create_link(edac_kobj, &pci->dev->kobj, EDAC_PCI_SYMLINK);
462 if (err) { 461 if (err) {
463 debugf0("%s() sysfs_create_link() returned err= %d\n", 462 debugf0("sysfs_create_link() returned err= %d\n",
464 __func__, err); 463 err);
465 goto symlink_fail; 464 goto symlink_fail;
466 } 465 }
467 466
@@ -484,7 +483,7 @@ unregister_cleanup:
484 */ 483 */
485void edac_pci_remove_sysfs(struct edac_pci_ctl_info *pci) 484void edac_pci_remove_sysfs(struct edac_pci_ctl_info *pci)
486{ 485{
487 debugf0("%s() index=%d\n", __func__, pci->pci_idx); 486 debugf0("index=%d\n", pci->pci_idx);
488 487
489 /* Remove the symlink */ 488 /* Remove the symlink */
490 sysfs_remove_link(&pci->kobj, EDAC_PCI_SYMLINK); 489 sysfs_remove_link(&pci->kobj, EDAC_PCI_SYMLINK);
@@ -496,7 +495,7 @@ void edac_pci_remove_sysfs(struct edac_pci_ctl_info *pci)
496 * if this 'pci' is the last instance. 495 * if this 'pci' is the last instance.
497 * If it is, the main kobject will be unregistered as a result 496 * If it is, the main kobject will be unregistered as a result
498 */ 497 */
499 debugf0("%s() calling edac_pci_main_kobj_teardown()\n", __func__); 498 debugf0("calling edac_pci_main_kobj_teardown()\n");
500 edac_pci_main_kobj_teardown(); 499 edac_pci_main_kobj_teardown();
501} 500}
502 501
@@ -671,7 +670,7 @@ void edac_pci_do_parity_check(void)
671{ 670{
672 int before_count; 671 int before_count;
673 672
674 debugf3("%s()\n", __func__); 673 debugf3("\n");
675 674
676 /* if policy has PCI check off, leave now */ 675 /* if policy has PCI check off, leave now */
677 if (!check_pci_errors) 676 if (!check_pci_errors)