Lines Matching refs:svc

903 	struct tb_service *svc = container_of(dev, struct tb_service, dev);
909 return sysfs_emit(buf, "%*pE\n", (int)strlen(svc->key), svc->key);
913 static int get_modalias(const struct tb_service *svc, char *buf, size_t size)
915 return snprintf(buf, size, "tbsvc:k%sp%08Xv%08Xr%08X", svc->key,
916 svc->prtcid, svc->prtcvers, svc->prtcrevs);
922 struct tb_service *svc = container_of(dev, struct tb_service, dev);
925 get_modalias(svc, buf, PAGE_SIZE - 2);
933 struct tb_service *svc = container_of(dev, struct tb_service, dev);
935 return sysfs_emit(buf, "%u\n", svc->prtcid);
942 struct tb_service *svc = container_of(dev, struct tb_service, dev);
944 return sysfs_emit(buf, "%u\n", svc->prtcvers);
951 struct tb_service *svc = container_of(dev, struct tb_service, dev);
953 return sysfs_emit(buf, "%u\n", svc->prtcrevs);
960 struct tb_service *svc = container_of(dev, struct tb_service, dev);
962 return sysfs_emit(buf, "0x%08x\n", svc->prtcstns);
987 const struct tb_service *svc = container_of_const(dev, struct tb_service, dev);
990 get_modalias(svc, modalias, sizeof(modalias));
996 struct tb_service *svc = container_of(dev, struct tb_service, dev);
997 struct tb_xdomain *xd = tb_service_parent(svc);
999 tb_service_debugfs_remove(svc);
1000 ida_free(&xd->service_ids, svc->id);
1001 kfree(svc->key);
1002 kfree(svc);
1016 struct tb_service *svc;
1018 svc = tb_to_service(dev);
1019 if (!svc)
1022 if (!tb_property_find(xd->remote_properties, svc->key,
1032 struct tb_service *svc;
1034 svc = tb_to_service(dev);
1035 if (!svc)
1038 return !strcmp(svc->key, p->key);
1041 static int populate_service(struct tb_service *svc,
1050 svc->prtcid = p->value.immediate;
1053 svc->prtcvers = p->value.immediate;
1056 svc->prtcrevs = p->value.immediate;
1059 svc->prtcstns = p->value.immediate;
1061 svc->key = kstrdup(property->key, GFP_KERNEL);
1062 if (!svc->key)
1070 struct tb_service *svc;
1093 svc = kzalloc(sizeof(*svc), GFP_KERNEL);
1094 if (!svc)
1097 if (populate_service(svc, p)) {
1098 kfree(svc);
1104 kfree(svc->key);
1105 kfree(svc);
1108 svc->id = id;
1109 svc->dev.bus = &tb_bus_type;
1110 svc->dev.type = &tb_service_type;
1111 svc->dev.parent = &xd->dev;
1112 dev_set_name(&svc->dev, "%s.%d", dev_name(&xd->dev), svc->id);
1114 tb_service_debugfs_init(svc);
1116 if (device_register(&svc->dev)) {
1117 put_device(&svc->dev);