Lines Matching refs:subsystem
77 free(device->subsystem);
260 _public_ int sd_device_new_from_subsystem_sysname(sd_device **ret, const char *subsystem, const char *sysname) {
264 assert_return(subsystem, -EINVAL);
267 if (streq(subsystem, "subsystem")) {
268 syspath = strjoina("/sys/subsystem/", sysname);
279 } else if (streq(subsystem, "module")) {
283 } else if (streq(subsystem, "drivers")) {
293 syspath = strjoina("/sys/subsystem/", subsys, "/drivers/", driver);
315 syspath = strjoina("/sys/subsystem/", subsystem, "/devices/", name);
319 syspath = strjoina("/sys/bus/", subsystem, "/devices/", name);
323 syspath = strjoina("/sys/class/", subsystem, "/", name);
748 _cleanup_free_ char *subsystem = NULL;
754 subsystem = strdup(_subsystem);
755 if (!subsystem)
758 r = device_add_property_internal(device, "SUBSYSTEM", subsystem);
762 free(device->subsystem);
763 device->subsystem = subsystem;
764 subsystem = NULL;
776 _cleanup_free_ char *subsystem = NULL;
781 /* read 'subsystem' link */
786 path = strjoina(syspath, "/subsystem");
787 r = readlink_value(path, &subsystem);
789 r = device_set_subsystem(device, subsystem);
795 else if (path_startswith(device->devpath, "/subsystem/") ||
798 r = device_set_subsystem(device, "subsystem");
800 return log_debug_errno(r, "sd-device: could not set subsystem for %s: %m", device->devpath);
805 if (!device->subsystem)
808 *ret = device->subsystem;
828 _public_ int sd_device_get_parent_with_subsystem_devtype(sd_device *child, const char *subsystem, const char *devtype, sd_device **ret) {
833 assert_return(subsystem, -EINVAL);
841 if (streq_ptr(parent_subsystem, subsystem)) {
1196 const char *subsystem;
1200 r = sd_device_get_subsystem(device, &subsystem);
1213 assert(subsystem);
1217 streq(subsystem, "block") ? 'b' : 'c',
1236 if (!subsystem)
1239 r = asprintf(&id, "+%s:%s", subsystem, sysname);
1744 if (STR_IN_SET(sysattr, "driver", "subsystem", "module")) {