Lines Matching refs:svc

874 	struct tb_service *svc = container_of(dev, struct tb_service, dev);  in key_show()  local
880 return sysfs_emit(buf, "%*pE\n", (int)strlen(svc->key), svc->key); in key_show()
884 static int get_modalias(struct tb_service *svc, char *buf, size_t size) in get_modalias() argument
886 return snprintf(buf, size, "tbsvc:k%sp%08Xv%08Xr%08X", svc->key, in get_modalias()
887 svc->prtcid, svc->prtcvers, svc->prtcrevs); in get_modalias()
893 struct tb_service *svc = container_of(dev, struct tb_service, dev); in modalias_show() local
896 get_modalias(svc, buf, PAGE_SIZE - 2); in modalias_show()
904 struct tb_service *svc = container_of(dev, struct tb_service, dev); in prtcid_show() local
906 return sysfs_emit(buf, "%u\n", svc->prtcid); in prtcid_show()
913 struct tb_service *svc = container_of(dev, struct tb_service, dev); in prtcvers_show() local
915 return sysfs_emit(buf, "%u\n", svc->prtcvers); in prtcvers_show()
922 struct tb_service *svc = container_of(dev, struct tb_service, dev); in prtcrevs_show() local
924 return sysfs_emit(buf, "%u\n", svc->prtcrevs); in prtcrevs_show()
931 struct tb_service *svc = container_of(dev, struct tb_service, dev); in prtcstns_show() local
933 return sysfs_emit(buf, "0x%08x\n", svc->prtcstns); in prtcstns_show()
958 struct tb_service *svc = container_of(dev, struct tb_service, dev); in tb_service_uevent() local
961 get_modalias(svc, modalias, sizeof(modalias)); in tb_service_uevent()
967 struct tb_service *svc = container_of(dev, struct tb_service, dev); in tb_service_release() local
968 struct tb_xdomain *xd = tb_service_parent(svc); in tb_service_release()
970 tb_service_debugfs_remove(svc); in tb_service_release()
971 ida_simple_remove(&xd->service_ids, svc->id); in tb_service_release()
972 kfree(svc->key); in tb_service_release()
973 kfree(svc); in tb_service_release()
987 struct tb_service *svc; in remove_missing_service() local
989 svc = tb_to_service(dev); in remove_missing_service()
990 if (!svc) in remove_missing_service()
993 if (!tb_property_find(xd->remote_properties, svc->key, in remove_missing_service()
1003 struct tb_service *svc; in find_service() local
1005 svc = tb_to_service(dev); in find_service()
1006 if (!svc) in find_service()
1009 return !strcmp(svc->key, p->key); in find_service()
1012 static int populate_service(struct tb_service *svc, in populate_service() argument
1021 svc->prtcid = p->value.immediate; in populate_service()
1024 svc->prtcvers = p->value.immediate; in populate_service()
1027 svc->prtcrevs = p->value.immediate; in populate_service()
1030 svc->prtcstns = p->value.immediate; in populate_service()
1032 svc->key = kstrdup(property->key, GFP_KERNEL); in populate_service()
1033 if (!svc->key) in populate_service()
1041 struct tb_service *svc; in enumerate_services() local
1064 svc = kzalloc(sizeof(*svc), GFP_KERNEL); in enumerate_services()
1065 if (!svc) in enumerate_services()
1068 if (populate_service(svc, p)) { in enumerate_services()
1069 kfree(svc); in enumerate_services()
1075 kfree(svc->key); in enumerate_services()
1076 kfree(svc); in enumerate_services()
1079 svc->id = id; in enumerate_services()
1080 svc->dev.bus = &tb_bus_type; in enumerate_services()
1081 svc->dev.type = &tb_service_type; in enumerate_services()
1082 svc->dev.parent = &xd->dev; in enumerate_services()
1083 dev_set_name(&svc->dev, "%s.%d", dev_name(&xd->dev), svc->id); in enumerate_services()
1085 tb_service_debugfs_init(svc); in enumerate_services()
1087 if (device_register(&svc->dev)) { in enumerate_services()
1088 put_device(&svc->dev); in enumerate_services()