aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/edac_mc_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/edac/edac_mc_sysfs.c')
-rw-r--r--drivers/edac/edac_mc_sysfs.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
index f72de8ba6a3b..eace646b57f0 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
@@ -287,7 +287,7 @@ static void csrow_attr_release(struct device *dev)
287{ 287{
288 struct csrow_info *csrow = container_of(dev, struct csrow_info, dev); 288 struct csrow_info *csrow = container_of(dev, struct csrow_info, dev);
289 289
290 debugf1("Releasing csrow device %s\n", dev_name(dev)); 290 edac_dbg(1, "Releasing csrow device %s\n", dev_name(dev));
291 kfree(csrow); 291 kfree(csrow);
292} 292}
293 293
@@ -376,7 +376,8 @@ static int edac_create_csrow_object(struct mem_ctl_info *mci,
376 dev_set_name(&csrow->dev, "csrow%d", index); 376 dev_set_name(&csrow->dev, "csrow%d", index);
377 dev_set_drvdata(&csrow->dev, csrow); 377 dev_set_drvdata(&csrow->dev, csrow);
378 378
379 debugf0("creating (virtual) csrow node %s\n", dev_name(&csrow->dev)); 379 edac_dbg(0, "creating (virtual) csrow node %s\n",
380 dev_name(&csrow->dev));
380 381
381 err = device_add(&csrow->dev); 382 err = device_add(&csrow->dev);
382 if (err < 0) 383 if (err < 0)
@@ -460,8 +461,8 @@ static void edac_delete_csrow_objects(struct mem_ctl_info *mci)
460 for (chan = csrow->nr_channels - 1; chan >= 0; chan--) { 461 for (chan = csrow->nr_channels - 1; chan >= 0; chan--) {
461 if (!csrow->channels[chan]->dimm->nr_pages) 462 if (!csrow->channels[chan]->dimm->nr_pages)
462 continue; 463 continue;
463 debugf1("Removing csrow %d channel %d sysfs nodes\n", 464 edac_dbg(1, "Removing csrow %d channel %d sysfs nodes\n",
464 i, chan); 465 i, chan);
465 device_remove_file(&csrow->dev, 466 device_remove_file(&csrow->dev,
466 dynamic_csrow_dimm_attr[chan]); 467 dynamic_csrow_dimm_attr[chan]);
467 device_remove_file(&csrow->dev, 468 device_remove_file(&csrow->dev,
@@ -591,7 +592,7 @@ static void dimm_attr_release(struct device *dev)
591{ 592{
592 struct dimm_info *dimm = container_of(dev, struct dimm_info, dev); 593 struct dimm_info *dimm = container_of(dev, struct dimm_info, dev);
593 594
594 debugf1("Releasing dimm device %s\n", dev_name(dev)); 595 edac_dbg(1, "Releasing dimm device %s\n", dev_name(dev));
595 kfree(dimm); 596 kfree(dimm);
596} 597}
597 598
@@ -622,7 +623,7 @@ static int edac_create_dimm_object(struct mem_ctl_info *mci,
622 623
623 err = device_add(&dimm->dev); 624 err = device_add(&dimm->dev);
624 625
625 debugf0("creating rank/dimm device %s\n", dev_name(&dimm->dev)); 626 edac_dbg(0, "creating rank/dimm device %s\n", dev_name(&dimm->dev));
626 627
627 return err; 628 return err;
628} 629}
@@ -897,7 +898,7 @@ static void mci_attr_release(struct device *dev)
897{ 898{
898 struct mem_ctl_info *mci = container_of(dev, struct mem_ctl_info, dev); 899 struct mem_ctl_info *mci = container_of(dev, struct mem_ctl_info, dev);
899 900
900 debugf1("Releasing csrow device %s\n", dev_name(dev)); 901 edac_dbg(1, "Releasing csrow device %s\n", dev_name(dev));
901 kfree(mci); 902 kfree(mci);
902} 903}
903 904
@@ -964,7 +965,7 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
964 mci->bus.name = kasprintf(GFP_KERNEL, "mc%d", mci->mc_idx); 965 mci->bus.name = kasprintf(GFP_KERNEL, "mc%d", mci->mc_idx);
965 if (!mci->bus.name) 966 if (!mci->bus.name)
966 return -ENOMEM; 967 return -ENOMEM;
967 debugf0("creating bus %s\n",mci->bus.name); 968 edac_dbg(0, "creating bus %s\n", mci->bus.name);
968 err = bus_register(&mci->bus); 969 err = bus_register(&mci->bus);
969 if (err < 0) 970 if (err < 0)
970 return err; 971 return err;
@@ -979,7 +980,7 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
979 dev_set_drvdata(&mci->dev, mci); 980 dev_set_drvdata(&mci->dev, mci);
980 pm_runtime_forbid(&mci->dev); 981 pm_runtime_forbid(&mci->dev);
981 982
982 debugf0("creating device %s\n", dev_name(&mci->dev)); 983 edac_dbg(0, "creating device %s\n", dev_name(&mci->dev));
983 err = device_add(&mci->dev); 984 err = device_add(&mci->dev);
984 if (err < 0) { 985 if (err < 0) {
985 bus_unregister(&mci->bus); 986 bus_unregister(&mci->bus);
@@ -996,8 +997,7 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
996 if (dimm->nr_pages == 0) 997 if (dimm->nr_pages == 0)
997 continue; 998 continue;
998#ifdef CONFIG_EDAC_DEBUG 999#ifdef CONFIG_EDAC_DEBUG
999 debugf1("creating dimm%d, located at ", 1000 edac_dbg(1, "creating dimm%d, located at ", i);
1000 i);
1001 if (edac_debug_level >= 1) { 1001 if (edac_debug_level >= 1) {
1002 int lay; 1002 int lay;
1003 for (lay = 0; lay < mci->n_layers; lay++) 1003 for (lay = 0; lay < mci->n_layers; lay++)
@@ -1009,8 +1009,7 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
1009#endif 1009#endif
1010 err = edac_create_dimm_object(mci, dimm, i); 1010 err = edac_create_dimm_object(mci, dimm, i);
1011 if (err) { 1011 if (err) {
1012 debugf1("failure: create dimm %d obj\n", 1012 edac_dbg(1, "failure: create dimm %d obj\n", i);
1013 i);
1014 goto fail; 1013 goto fail;
1015 } 1014 }
1016 } 1015 }
@@ -1048,7 +1047,7 @@ void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci)
1048{ 1047{
1049 int i; 1048 int i;
1050 1049
1051 debugf0("\n"); 1050 edac_dbg(0, "\n");
1052 1051
1053#ifdef CONFIG_EDAC_DEBUG 1052#ifdef CONFIG_EDAC_DEBUG
1054 debugfs_remove(mci->debugfs); 1053 debugfs_remove(mci->debugfs);
@@ -1061,7 +1060,7 @@ void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci)
1061 struct dimm_info *dimm = mci->dimms[i]; 1060 struct dimm_info *dimm = mci->dimms[i];
1062 if (dimm->nr_pages == 0) 1061 if (dimm->nr_pages == 0)
1063 continue; 1062 continue;
1064 debugf0("removing device %s\n", dev_name(&dimm->dev)); 1063 edac_dbg(0, "removing device %s\n", dev_name(&dimm->dev));
1065 put_device(&dimm->dev); 1064 put_device(&dimm->dev);
1066 device_del(&dimm->dev); 1065 device_del(&dimm->dev);
1067 } 1066 }
@@ -1069,7 +1068,7 @@ void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci)
1069 1068
1070void edac_unregister_sysfs(struct mem_ctl_info *mci) 1069void edac_unregister_sysfs(struct mem_ctl_info *mci)
1071{ 1070{
1072 debugf1("Unregistering device %s\n", dev_name(&mci->dev)); 1071 edac_dbg(1, "Unregistering device %s\n", dev_name(&mci->dev));
1073 put_device(&mci->dev); 1072 put_device(&mci->dev);
1074 device_del(&mci->dev); 1073 device_del(&mci->dev);
1075 bus_unregister(&mci->bus); 1074 bus_unregister(&mci->bus);
@@ -1083,7 +1082,7 @@ static void mc_attr_release(struct device *dev)
1083 * parent device, used to create the /sys/devices/mc sysfs node. 1082 * parent device, used to create the /sys/devices/mc sysfs node.
1084 * So, there are no attributes on it. 1083 * So, there are no attributes on it.
1085 */ 1084 */
1086 debugf1("Releasing device %s\n", dev_name(dev)); 1085 edac_dbg(1, "Releasing device %s\n", dev_name(dev));
1087 kfree(dev); 1086 kfree(dev);
1088} 1087}
1089 1088
@@ -1101,7 +1100,7 @@ int __init edac_mc_sysfs_init(void)
1101 /* get the /sys/devices/system/edac subsys reference */ 1100 /* get the /sys/devices/system/edac subsys reference */
1102 edac_subsys = edac_get_sysfs_subsys(); 1101 edac_subsys = edac_get_sysfs_subsys();
1103 if (edac_subsys == NULL) { 1102 if (edac_subsys == NULL) {
1104 debugf1("no edac_subsys\n"); 1103 edac_dbg(1, "no edac_subsys\n");
1105 return -EINVAL; 1104 return -EINVAL;
1106 } 1105 }
1107 1106
@@ -1116,7 +1115,7 @@ int __init edac_mc_sysfs_init(void)
1116 if (err < 0) 1115 if (err < 0)
1117 return err; 1116 return err;
1118 1117
1119 debugf0("device %s created\n", dev_name(mci_pdev)); 1118 edac_dbg(0, "device %s created\n", dev_name(mci_pdev));
1120 1119
1121 return 0; 1120 return 0;
1122} 1121}