Lines Matching full:subsys
45 kset_get(&bus->p->subsys); in bus_get()
54 kset_put(&bus->p->subsys); in bus_put()
135 error = sysfs_create_file(&bus->p->subsys.kobj, &attr->attr); in bus_create_file()
146 sysfs_remove_file(&bus->p->subsys.kobj, &attr->attr); in bus_remove_file()
344 * @subsys: subsystem
352 struct device *subsys_find_device_by_id(struct bus_type *subsys, unsigned int id, in subsys_find_device_by_id() argument
358 if (!subsys) in subsys_find_device_by_id()
362 klist_iter_init_node(&subsys->p->klist_devices, &i, &hint->p->knode_bus); in subsys_find_device_by_id()
371 klist_iter_init_node(&subsys->p->klist_devices, &i, NULL); in subsys_find_device_by_id()
456 &dev->bus->p->subsys.kobj, "subsystem"); in bus_add_device()
733 return sysfs_create_groups(&bus->p->subsys.kobj, groups); in bus_add_groups()
739 sysfs_remove_groups(&bus->p->subsys.kobj, groups); in bus_remove_groups()
763 rc = kobject_synth_uevent(&bus->p->subsys.kobj, buf, count); in bus_uevent_store()
798 retval = kobject_set_name(&priv->subsys.kobj, "%s", bus->name); in bus_register()
802 priv->subsys.kobj.kset = bus_kset; in bus_register()
803 priv->subsys.kobj.ktype = &bus_ktype; in bus_register()
806 retval = kset_register(&priv->subsys); in bus_register()
815 &priv->subsys.kobj); in bus_register()
822 &priv->subsys.kobj); in bus_register()
829 __mutex_init(&priv->mutex, "subsys mutex", key); in bus_register()
853 kset_unregister(&bus->p->subsys); in bus_register()
878 kset_unregister(&bus->p->subsys); in bus_unregister()
896 return &bus->p->subsys; in bus_get_kset()
957 * subsys_dev_iter_init - initialize subsys device iterator
958 * @iter: subsys iterator to initialize
959 * @subsys: the subsys we wanna iterate over
963 * Initialize subsys iterator @iter such that it iterates over devices
964 * of @subsys. If @start is set, the list iteration will start there,
968 void subsys_dev_iter_init(struct subsys_dev_iter *iter, struct bus_type *subsys, in subsys_dev_iter_init() argument
975 klist_iter_init_node(&subsys->p->klist_devices, &iter->ki, start_knode); in subsys_dev_iter_init()
982 * @iter: subsys iterator to proceed
990 * calling back into subsys code.
1010 * @iter: subsys iterator to finish
1023 struct bus_type *subsys; in subsys_interface_register() local
1027 if (!sif || !sif->subsys) in subsys_interface_register()
1030 subsys = bus_get(sif->subsys); in subsys_interface_register()
1031 if (!subsys) in subsys_interface_register()
1034 mutex_lock(&subsys->p->mutex); in subsys_interface_register()
1035 list_add_tail(&sif->node, &subsys->p->interfaces); in subsys_interface_register()
1037 subsys_dev_iter_init(&iter, subsys, NULL, NULL); in subsys_interface_register()
1042 mutex_unlock(&subsys->p->mutex); in subsys_interface_register()
1050 struct bus_type *subsys; in subsys_interface_unregister() local
1054 if (!sif || !sif->subsys) in subsys_interface_unregister()
1057 subsys = sif->subsys; in subsys_interface_unregister()
1059 mutex_lock(&subsys->p->mutex); in subsys_interface_unregister()
1062 subsys_dev_iter_init(&iter, subsys, NULL, NULL); in subsys_interface_unregister()
1067 mutex_unlock(&subsys->p->mutex); in subsys_interface_unregister()
1069 bus_put(subsys); in subsys_interface_unregister()
1078 static int subsys_register(struct bus_type *subsys, in subsys_register() argument
1085 err = bus_register(subsys); in subsys_register()
1095 err = dev_set_name(dev, "%s", subsys->name); in subsys_register()
1107 subsys->dev_root = dev; in subsys_register()
1116 bus_unregister(subsys); in subsys_register()
1122 * @subsys: system subsystem
1138 int subsys_system_register(struct bus_type *subsys, in subsys_system_register() argument
1141 return subsys_register(subsys, groups, &system_kset->kobj); in subsys_system_register()
1147 * @subsys: virtual subsystem
1156 int subsys_virtual_register(struct bus_type *subsys, in subsys_virtual_register() argument
1165 return subsys_register(subsys, groups, virtual_dir); in subsys_virtual_register()