Lines Matching refs:cr
508 int cr;
519 struct afu_config_record *cr = to_cr(kobj);
521 return scnprintf(buf, PAGE_SIZE, "0x%.4x\n", cr->vendor);
527 struct afu_config_record *cr = to_cr(kobj);
529 return scnprintf(buf, PAGE_SIZE, "0x%.4x\n", cr->device);
535 struct afu_config_record *cr = to_cr(kobj);
537 return scnprintf(buf, PAGE_SIZE, "0x%.6x\n", cr->class);
544 struct afu_config_record *cr = to_cr(kobj);
550 rc = cxl_ops->afu_cr_read64(afu, cr->cr, off & ~0x7, &val);
576 struct afu_config_record *cr = to_cr(kobj);
578 kfree(cr);
589 struct afu_config_record *cr;
592 cr = kzalloc(sizeof(struct afu_config_record), GFP_KERNEL);
593 if (!cr)
596 cr->cr = cr_idx;
598 rc = cxl_ops->afu_cr_read16(afu, cr_idx, PCI_DEVICE_ID, &cr->device);
601 rc = cxl_ops->afu_cr_read16(afu, cr_idx, PCI_VENDOR_ID, &cr->vendor);
604 rc = cxl_ops->afu_cr_read32(afu, cr_idx, PCI_CLASS_REVISION, &cr->class);
607 cr->class >>= 8;
618 sysfs_bin_attr_init(&cr->config_attr);
619 cr->config_attr.attr.name = "config";
620 cr->config_attr.attr.mode = S_IRUSR;
621 cr->config_attr.size = afu->crs_len;
622 cr->config_attr.read = afu_read_config;
624 rc = kobject_init_and_add(&cr->kobj, &afu_config_record_type,
625 &afu->dev.kobj, "cr%i", cr->cr);
629 rc = sysfs_create_bin_file(&cr->kobj, &cr->config_attr);
633 rc = kobject_uevent(&cr->kobj, KOBJ_ADD);
637 return cr;
639 sysfs_remove_bin_file(&cr->kobj, &cr->config_attr);
641 kobject_put(&cr->kobj);
644 kfree(cr);
651 struct afu_config_record *cr, *tmp;
665 list_for_each_entry_safe(cr, tmp, &afu->crs, list) {
666 sysfs_remove_bin_file(&cr->kobj, &cr->config_attr);
667 kobject_put(&cr->kobj);
674 struct afu_config_record *cr;
707 cr = cxl_sysfs_afu_new_cr(afu, i);
708 if (IS_ERR(cr)) {
709 rc = PTR_ERR(cr);
712 list_add(&cr->list, &afu->crs);