struct intel_gt *intel_gt_sysfs_get_drvdata(struct kobject *kobj, constchar *name)
{ /* * We are interested at knowing from where the interface * has been called, whether it's called from gt/ or from * the parent directory. * From the interface position it depends also the value of * the private data. * If the interface is called from gt/ then private data is * of the "struct intel_gt *" type, otherwise it's * a * "struct drm_i915_private *" type.
*/ if (!is_object_gt(kobj)) { struct device *dev = kobj_to_dev(kobj); struct drm_i915_private *i915 = kdev_minor_to_i915(dev);
void intel_gt_sysfs_register(struct intel_gt *gt)
{ /* * We need to make things right with the * ABI compatibility. The files were originally * generated under the parent directory. * * We generate the files only for gt 0 * to avoid duplicates.
*/ if (gt_is_root(gt))
intel_gt_sysfs_pm_init(gt, gt_get_parent_obj(gt));
/* init and xfer ownership to sysfs tree */ if (kobject_init_and_add(>->sysfs_gt, &kobj_gt_type,
gt->i915->sysfs_gt, "gt%d", gt->info.id)) goto exit_fail;
gt->sysfs_defaults = kobject_create_and_add(".defaults", >->sysfs_gt); if (!gt->sysfs_defaults) goto exit_fail;
intel_gt_sysfs_pm_init(gt, >->sysfs_gt);
return;
exit_fail:
kobject_put(>->sysfs_gt);
gt_warn(gt, "failed to initialize sysfs root\n");
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.