Lines Matching defs:block

405 /* edac_dev -> instance -> block information */
412 * Set of low-level block attribute show functions
417 struct edac_device_block *block = to_block(kobj);
419 return sprintf(data, "%u\n", block->counters.ue_count);
425 struct edac_device_block *block = to_block(kobj);
427 return sprintf(data, "%u\n", block->counters.ce_count);
430 /* DEVICE block kobject release() function */
433 struct edac_device_block *block;
438 block = to_block(kobj);
440 /* map from 'block kobj' to 'block->instance->controller->main_kobj'
441 * now 'release' the block kobject
443 kobject_put(&block->instance->ctl->kobj);
447 /* Function to 'show' fields from the edac_dev 'block' structure */
459 /* Function to 'store' fields into the edac_dev 'block' structure */
473 /* edac_dev file operations for a 'block' */
489 /* list of edac_dev 'block' attributes */
496 /* The 'ktype' for each edac_dev 'block' */
503 /* block ctor/dtor code */
510 struct edac_device_block *block)
517 edac_dbg(4, "Instance '%s' inst_p=%p block '%s' block_p=%p\n",
518 instance->name, instance, block->name, block);
519 edac_dbg(4, "block kobj=%p block kobj->parent=%p\n",
520 &block->kobj, &block->kobj.parent);
522 /* init this block's kobject */
523 memset(&block->kobj, 0, sizeof(struct kobject));
534 /* Add this block's kobject */
535 err = kobject_init_and_add(&block->kobj, &ktype_block_ctrl,
537 "%s", block->name);
539 edac_dbg(1, "Failed to register instance '%s'\n", block->name);
545 /* If there are driver level block attributes, then added them
546 * to the block kobject
548 sysfs_attrib = block->block_attributes;
549 if (sysfs_attrib && block->nr_attribs) {
550 for (i = 0; i < block->nr_attribs; i++, sysfs_attrib++) {
552 edac_dbg(4, "creating block attrib='%s' attrib->%p to kobj=%p\n",
554 sysfs_attrib, &block->kobj);
557 err = sysfs_create_file(&block->kobj,
563 kobject_uevent(&block->kobj, KOBJ_ADD);
569 kobject_put(&block->kobj);
576 * edac_device_delete_block(edac_dev,block);
579 struct edac_device_block *block)
584 /* if this block has 'attributes' then we need to iterate over the list
585 * and 'remove' the attributes on this block
587 sysfs_attrib = block->block_attributes;
588 if (sysfs_attrib && block->nr_attribs) {
589 for (i = 0; i < block->nr_attribs; i++, sysfs_attrib++) {
592 sysfs_remove_file(&block->kobj,
597 /* unregister this block's kobject, SEE:
600 kobject_put(&block->kobj);
793 * created. 'instance' and 'block' kobjects should be registered
794 * along with any 'block' attributes from the low driver. In addition,
869 /* walk the instance/block kobject tree, deconstructing it */