Lines Matching full:instance

224  *	perform the high level setup for the new edac_device instance
240 /* Point to the 'edac_subsys' this instance 'reports' to */ in edac_device_register_sysfs_main_kobj()
304 /* edac_dev -> instance information */
307 * Set of low-level instance attribute show functions
309 static ssize_t instance_ue_count_show(struct edac_device_instance *instance, in instance_ue_count_show() argument
312 return sprintf(data, "%u\n", instance->counters.ue_count); in instance_ue_count_show()
315 static ssize_t instance_ce_count_show(struct edac_device_instance *instance, in instance_ce_count_show() argument
318 return sprintf(data, "%u\n", instance->counters.ce_count); in instance_ce_count_show()
324 /* DEVICE instance kobject release() function */
327 struct edac_device_instance *instance; in edac_device_ctrl_instance_release() local
334 instance = to_instance(kobj); in edac_device_ctrl_instance_release()
335 kobject_put(&instance->ctl->kobj); in edac_device_ctrl_instance_release()
338 /* instance specific attribute structure */
345 /* Function to 'show' fields from the edac_dev 'instance' structure */
349 struct edac_device_instance *instance = to_instance(kobj); in edac_dev_instance_show() local
353 return instance_attr->show(instance, buffer); in edac_dev_instance_show()
357 /* Function to 'store' fields into the edac_dev 'instance' structure */
362 struct edac_device_instance *instance = to_instance(kobj); in edac_dev_instance_store() local
366 return instance_attr->store(instance, buffer, count); in edac_dev_instance_store()
370 /* edac_dev file operations for an 'instance' */
384 * Define attributes visible for the edac_device instance object
391 /* list of edac_dev 'instance' attributes */
399 /* The 'ktype' for each edac_dev 'instance' */
406 /* edac_dev -> instance -> block information */
441 /* map from 'block kobj' to 'block->instance->controller->main_kobj' in edac_device_ctrl_block_release()
444 kobject_put(&block->instance->ctl->kobj); in edac_device_ctrl_block_release()
495 struct edac_device_instance *instance, in edac_device_create_block() argument
503 edac_dbg(4, "Instance '%s' inst_p=%p block '%s' block_p=%p\n", in edac_device_create_block()
504 instance->name, instance, block->name, block); in edac_device_create_block()
512 * and this instance is dependent on the main in edac_device_create_block()
522 &instance->kobj, in edac_device_create_block()
525 edac_dbg(1, "Failed to register instance '%s'\n", block->name); in edac_device_create_block()
589 /* instance ctor/dtor code */
593 * create just one instance of an edac_device 'instance'
600 struct edac_device_instance *instance; in edac_device_create_instance() local
603 instance = &edac_dev->instances[idx]; in edac_device_create_instance()
605 /* Init the instance's kobject */ in edac_device_create_instance()
606 memset(&instance->kobj, 0, sizeof(struct kobject)); in edac_device_create_instance()
608 instance->ctl = edac_dev; in edac_device_create_instance()
611 * and this instance is dependent on the main in edac_device_create_instance()
619 /* Formally register this instance's kobject under the edac_device */ in edac_device_create_instance()
620 err = kobject_init_and_add(&instance->kobj, &ktype_instance_ctrl, in edac_device_create_instance()
621 &edac_dev->kobj, "%s", instance->name); in edac_device_create_instance()
623 edac_dbg(2, "Failed to register instance '%s'\n", in edac_device_create_instance()
624 instance->name); in edac_device_create_instance()
629 edac_dbg(4, "now register '%d' blocks for instance %d\n", in edac_device_create_instance()
630 instance->nr_blocks, idx); in edac_device_create_instance()
632 /* register all blocks of this instance */ in edac_device_create_instance()
633 for (i = 0; i < instance->nr_blocks; i++) { in edac_device_create_instance()
634 err = edac_device_create_block(edac_dev, instance, in edac_device_create_instance()
635 &instance->blocks[i]); in edac_device_create_instance()
640 &instance->blocks[j]); in edac_device_create_instance()
644 kobject_uevent(&instance->kobj, KOBJ_ADD); in edac_device_create_instance()
646 edac_dbg(4, "Registered instance %d '%s' kobject\n", in edac_device_create_instance()
647 idx, instance->name); in edac_device_create_instance()
653 kobject_put(&instance->kobj); in edac_device_create_instance()
661 * remove an edac_device instance
666 struct edac_device_instance *instance; in edac_device_delete_instance() local
669 instance = &edac_dev->instances[idx]; in edac_device_delete_instance()
671 /* unregister all blocks in this instance */ in edac_device_delete_instance()
672 for (i = 0; i < instance->nr_blocks; i++) in edac_device_delete_instance()
673 edac_device_delete_block(edac_dev, &instance->blocks[i]); in edac_device_delete_instance()
675 /* unregister this instance's kobject, SEE: in edac_device_delete_instance()
678 kobject_put(&instance->kobj); in edac_device_delete_instance()
724 * add some attributes to this instance's main kobject
753 * remove any attributes to this instance's main kobject
762 * removing each attribute listed from this device's instance's kobject in edac_device_remove_main_sysfs_attributes()
779 * created. 'instance' and 'block' kobjects should be registered
812 /* Create the first level instance directories in edac_device_create_sysfs()
855 /* walk the instance/block kobject tree, deconstructing it */ in edac_device_remove_sysfs()