aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/edac_device_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/edac/edac_device_sysfs.c')
-rw-r--r--drivers/edac/edac_device_sysfs.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/edac/edac_device_sysfs.c b/drivers/edac/edac_device_sysfs.c
index 7a233e6e2b36..235b4c79355d 100644
--- a/drivers/edac/edac_device_sysfs.c
+++ b/drivers/edac/edac_device_sysfs.c
@@ -456,8 +456,10 @@ static int edac_device_create_block(struct edac_device_ctl_info *edac_dev,
456 struct edac_device_instance *instance, 456 struct edac_device_instance *instance,
457 int idx) 457 int idx)
458{ 458{
459 int i;
459 int err; 460 int err;
460 struct edac_device_block *block; 461 struct edac_device_block *block;
462 struct edac_dev_sysfs_block_attribute *sysfs_attrib;
461 463
462 block = &instance->blocks[idx]; 464 block = &instance->blocks[idx];
463 465
@@ -480,7 +482,27 @@ static int edac_device_create_block(struct edac_device_ctl_info *edac_dev,
480 return err; 482 return err;
481 } 483 }
482 484
485 /* If there are driver level block attributes, then added them
486 * to the block kobject
487 */
488 sysfs_attrib = block->block_attributes;
489 if (sysfs_attrib != NULL) {
490 for (i = 0; i < block->nr_attribs; i++) {
491 err = sysfs_create_file(&block->kobj,
492 (struct attribute *) &sysfs_attrib[i]);
493 if (err)
494 goto err_on_attrib;
495
496 sysfs_attrib++;
497 }
498 }
499
483 return 0; 500 return 0;
501
502err_on_attrib:
503 kobject_unregister(&block->kobj);
504
505 return err;
484} 506}
485 507
486/* 508/*