diff options
Diffstat (limited to 'drivers/edac/edac_mc.c')
-rw-r--r-- | drivers/edac/edac_mc.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index 811f09a38f3a..61ae34643b49 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c | |||
@@ -218,7 +218,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num, | |||
218 | unsigned size, tot_dimms = 1, count = 1; | 218 | unsigned size, tot_dimms = 1, count = 1; |
219 | unsigned tot_csrows = 1, tot_channels = 1, tot_errcount = 0; | 219 | unsigned tot_csrows = 1, tot_channels = 1, tot_errcount = 0; |
220 | void *pvt, *p, *ptr = NULL; | 220 | void *pvt, *p, *ptr = NULL; |
221 | int i, j, err, row, chn, n, len; | 221 | int i, j, row, chn, n, len; |
222 | bool per_rank = false; | 222 | bool per_rank = false; |
223 | 223 | ||
224 | BUG_ON(n_layers > EDAC_MAX_LAYERS || n_layers == 0); | 224 | BUG_ON(n_layers > EDAC_MAX_LAYERS || n_layers == 0); |
@@ -374,15 +374,6 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num, | |||
374 | mci->op_state = OP_ALLOC; | 374 | mci->op_state = OP_ALLOC; |
375 | INIT_LIST_HEAD(&mci->grp_kobj_list); | 375 | INIT_LIST_HEAD(&mci->grp_kobj_list); |
376 | 376 | ||
377 | /* | ||
378 | * Initialize the 'root' kobj for the edac_mc controller | ||
379 | */ | ||
380 | err = edac_mc_register_sysfs_main_kobj(mci); | ||
381 | if (err) { | ||
382 | kfree(mci); | ||
383 | return NULL; | ||
384 | } | ||
385 | |||
386 | /* at this point, the root kobj is valid, and in order to | 377 | /* at this point, the root kobj is valid, and in order to |
387 | * 'free' the object, then the function: | 378 | * 'free' the object, then the function: |
388 | * edac_mc_unregister_sysfs_main_kobj() must be called | 379 | * edac_mc_unregister_sysfs_main_kobj() must be called |
@@ -403,7 +394,7 @@ void edac_mc_free(struct mem_ctl_info *mci) | |||
403 | { | 394 | { |
404 | debugf1("%s()\n", __func__); | 395 | debugf1("%s()\n", __func__); |
405 | 396 | ||
406 | edac_mc_unregister_sysfs_main_kobj(mci); | 397 | edac_unregister_sysfs(mci); |
407 | 398 | ||
408 | /* free the mci instance memory here */ | 399 | /* free the mci instance memory here */ |
409 | kfree(mci); | 400 | kfree(mci); |