Lines Matching full:instance
224 * perform the high level setup for the new edac_device instance
239 /* Point to the 'edac_subsys' this instance 'reports' to */ in edac_device_register_sysfs_main_kobj()
302 /* edac_dev -> instance information */
305 * Set of low-level instance attribute show functions
307 static ssize_t instance_ue_count_show(struct edac_device_instance *instance, in instance_ue_count_show() argument
310 return sprintf(data, "%u\n", instance->counters.ue_count); in instance_ue_count_show()
313 static ssize_t instance_ce_count_show(struct edac_device_instance *instance, in instance_ce_count_show() argument
316 return sprintf(data, "%u\n", instance->counters.ce_count); in instance_ce_count_show()
322 /* DEVICE instance kobject release() function */
325 struct edac_device_instance *instance; in edac_device_ctrl_instance_release() local
332 instance = to_instance(kobj); in edac_device_ctrl_instance_release()
333 kobject_put(&instance->ctl->kobj); in edac_device_ctrl_instance_release()
336 /* instance specific attribute structure */
343 /* Function to 'show' fields from the edac_dev 'instance' structure */
347 struct edac_device_instance *instance = to_instance(kobj); in edac_dev_instance_show() local
351 return instance_attr->show(instance, buffer); in edac_dev_instance_show()
355 /* Function to 'store' fields into the edac_dev 'instance' structure */
360 struct edac_device_instance *instance = to_instance(kobj); in edac_dev_instance_store() local
364 return instance_attr->store(instance, buffer, count); in edac_dev_instance_store()
368 /* edac_dev file operations for an 'instance' */
382 * Define attributes visible for the edac_device instance object
389 /* list of edac_dev 'instance' attributes */
397 /* The 'ktype' for each edac_dev 'instance' */
404 /* edac_dev -> instance -> block information */
439 /* map from 'block kobj' to 'block->instance->controller->main_kobj' in edac_device_ctrl_block_release()
442 kobject_put(&block->instance->ctl->kobj); in edac_device_ctrl_block_release()
509 struct edac_device_instance *instance, in edac_device_create_block() argument
517 edac_dbg(4, "Instance '%s' inst_p=%p block '%s' block_p=%p\n", in edac_device_create_block()
518 instance->name, instance, block->name, block); in edac_device_create_block()
526 * and this instance is dependent on the main in edac_device_create_block()
536 &instance->kobj, in edac_device_create_block()
539 edac_dbg(1, "Failed to register instance '%s'\n", block->name); in edac_device_create_block()
603 /* instance ctor/dtor code */
607 * create just one instance of an edac_device 'instance'
614 struct edac_device_instance *instance; in edac_device_create_instance() local
617 instance = &edac_dev->instances[idx]; in edac_device_create_instance()
619 /* Init the instance's kobject */ in edac_device_create_instance()
620 memset(&instance->kobj, 0, sizeof(struct kobject)); in edac_device_create_instance()
622 instance->ctl = edac_dev; in edac_device_create_instance()
625 * and this instance is dependent on the main in edac_device_create_instance()
633 /* Formally register this instance's kobject under the edac_device */ in edac_device_create_instance()
634 err = kobject_init_and_add(&instance->kobj, &ktype_instance_ctrl, in edac_device_create_instance()
635 &edac_dev->kobj, "%s", instance->name); in edac_device_create_instance()
637 edac_dbg(2, "Failed to register instance '%s'\n", in edac_device_create_instance()
638 instance->name); in edac_device_create_instance()
643 edac_dbg(4, "now register '%d' blocks for instance %d\n", in edac_device_create_instance()
644 instance->nr_blocks, idx); in edac_device_create_instance()
646 /* register all blocks of this instance */ in edac_device_create_instance()
647 for (i = 0; i < instance->nr_blocks; i++) { in edac_device_create_instance()
648 err = edac_device_create_block(edac_dev, instance, in edac_device_create_instance()
649 &instance->blocks[i]); in edac_device_create_instance()
654 &instance->blocks[j]); in edac_device_create_instance()
658 kobject_uevent(&instance->kobj, KOBJ_ADD); in edac_device_create_instance()
660 edac_dbg(4, "Registered instance %d '%s' kobject\n", in edac_device_create_instance()
661 idx, instance->name); in edac_device_create_instance()
667 kobject_put(&instance->kobj); in edac_device_create_instance()
675 * remove an edac_device instance
680 struct edac_device_instance *instance; in edac_device_delete_instance() local
683 instance = &edac_dev->instances[idx]; in edac_device_delete_instance()
685 /* unregister all blocks in this instance */ in edac_device_delete_instance()
686 for (i = 0; i < instance->nr_blocks; i++) in edac_device_delete_instance()
687 edac_device_delete_block(edac_dev, &instance->blocks[i]); in edac_device_delete_instance()
689 /* unregister this instance's kobject, SEE: in edac_device_delete_instance()
692 kobject_put(&instance->kobj); in edac_device_delete_instance()
738 * add some attributes to this instance's main kobject
767 * remove any attributes to this instance's main kobject
776 * removing each attribute listed from this device's instance's kobject in edac_device_remove_main_sysfs_attributes()
793 * created. 'instance' and 'block' kobjects should be registered
826 /* Create the first level instance directories in edac_device_create_sysfs()
869 /* walk the instance/block kobject tree, deconstructing it */ in edac_device_remove_sysfs()