Lines Matching full:instance

226  *	perform the high level setup for the new edac_device instance
246 /* Point to the 'edac_subsys' this instance 'reports' to */ in edac_device_register_sysfs_main_kobj()
314 /* edac_dev -> instance information */
317 * Set of low-level instance attribute show functions
319 static ssize_t instance_ue_count_show(struct edac_device_instance *instance, in instance_ue_count_show() argument
322 return sprintf(data, "%u\n", instance->counters.ue_count); in instance_ue_count_show()
325 static ssize_t instance_ce_count_show(struct edac_device_instance *instance, in instance_ce_count_show() argument
328 return sprintf(data, "%u\n", instance->counters.ce_count); in instance_ce_count_show()
334 /* DEVICE instance kobject release() function */
337 struct edac_device_instance *instance; in edac_device_ctrl_instance_release() local
344 instance = to_instance(kobj); in edac_device_ctrl_instance_release()
345 kobject_put(&instance->ctl->kobj); in edac_device_ctrl_instance_release()
348 /* instance specific attribute structure */
355 /* Function to 'show' fields from the edac_dev 'instance' structure */
359 struct edac_device_instance *instance = to_instance(kobj); in edac_dev_instance_show() local
363 return instance_attr->show(instance, buffer); in edac_dev_instance_show()
367 /* Function to 'store' fields into the edac_dev 'instance' structure */
372 struct edac_device_instance *instance = to_instance(kobj); in edac_dev_instance_store() local
376 return instance_attr->store(instance, buffer, count); in edac_dev_instance_store()
380 /* edac_dev file operations for an 'instance' */
394 * Define attributes visible for the edac_device instance object
401 /* list of edac_dev 'instance' attributes */
408 /* The 'ktype' for each edac_dev 'instance' */
415 /* edac_dev -> instance -> block information */
450 /* map from 'block kobj' to 'block->instance->controller->main_kobj' in edac_device_ctrl_block_release()
453 kobject_put(&block->instance->ctl->kobj); in edac_device_ctrl_block_release()
519 struct edac_device_instance *instance, in edac_device_create_block() argument
527 debugf4("%s() Instance '%s' inst_p=%p block '%s' block_p=%p\n", in edac_device_create_block()
528 __func__, instance->name, instance, block->name, block); in edac_device_create_block()
536 * and this instance is dependent on the main in edac_device_create_block()
546 &instance->kobj, in edac_device_create_block()
549 debugf1("%s() Failed to register instance '%s'\n", in edac_device_create_block()
616 /* instance ctor/dtor code */
620 * create just one instance of an edac_device 'instance'
627 struct edac_device_instance *instance; in edac_device_create_instance() local
630 instance = &edac_dev->instances[idx]; in edac_device_create_instance()
632 /* Init the instance's kobject */ in edac_device_create_instance()
633 memset(&instance->kobj, 0, sizeof(struct kobject)); in edac_device_create_instance()
635 instance->ctl = edac_dev; in edac_device_create_instance()
638 * and this instance is dependent on the main in edac_device_create_instance()
646 /* Formally register this instance's kobject under the edac_device */ in edac_device_create_instance()
647 err = kobject_init_and_add(&instance->kobj, &ktype_instance_ctrl, in edac_device_create_instance()
648 &edac_dev->kobj, "%s", instance->name); in edac_device_create_instance()
650 debugf2("%s() Failed to register instance '%s'\n", in edac_device_create_instance()
651 __func__, instance->name); in edac_device_create_instance()
656 debugf4("%s() now register '%d' blocks for instance %d\n", in edac_device_create_instance()
657 __func__, instance->nr_blocks, idx); in edac_device_create_instance()
659 /* register all blocks of this instance */ in edac_device_create_instance()
660 for (i = 0; i < instance->nr_blocks; i++) { in edac_device_create_instance()
661 err = edac_device_create_block(edac_dev, instance, in edac_device_create_instance()
662 &instance->blocks[i]); in edac_device_create_instance()
667 &instance->blocks[j]); in edac_device_create_instance()
671 kobject_uevent(&instance->kobj, KOBJ_ADD); in edac_device_create_instance()
673 debugf4("%s() Registered instance %d '%s' kobject\n", in edac_device_create_instance()
674 __func__, idx, instance->name); in edac_device_create_instance()
680 kobject_put(&instance->kobj); in edac_device_create_instance()
688 * remove an edac_device instance
693 struct edac_device_instance *instance; in edac_device_delete_instance() local
696 instance = &edac_dev->instances[idx]; in edac_device_delete_instance()
698 /* unregister all blocks in this instance */ in edac_device_delete_instance()
699 for (i = 0; i < instance->nr_blocks; i++) in edac_device_delete_instance()
700 edac_device_delete_block(edac_dev, &instance->blocks[i]); in edac_device_delete_instance()
702 /* unregister this instance's kobject, SEE: in edac_device_delete_instance()
705 kobject_put(&instance->kobj); in edac_device_delete_instance()
751 * add some attributes to this instance's main kobject
780 * remove any attributes to this instance's main kobject
789 * removing each attribute listed from this device's instance's kobject in edac_device_remove_main_sysfs_attributes()
806 * created. 'instance' and 'block' kobjects should be registered
840 /* Create the first level instance directories in edac_device_create_sysfs()
884 /* walk the instance/block kobject tree, deconstructing it */ in edac_device_remove_sysfs()