Lines Matching defs:syspath
73 free(device->syspath);
151 _cleanup_free_ char *syspath = NULL;
160 log_debug("sd-device: syspath '%s' is not a subdirectory of /sys", _syspath);
165 r = readlink_and_canonicalize(_syspath, &syspath);
171 syspath = canonicalize_file_name(_syspath);
172 if (!syspath) {
184 if (path_startswith(syspath, "/sys/devices/")) {
188 path = strjoina(syspath, "/uevent");
195 log_debug("sd-device: %s does not have an uevent file: %m", syspath);
200 if (!is_dir(syspath, false))
204 syspath = strdup(_syspath);
205 if (!syspath)
209 devpath = syspath + strlen("/sys");
215 free(device->syspath);
216 device->syspath = syspath;
217 syspath = NULL;
224 _public_ int sd_device_new_from_syspath(sd_device **ret, const char *syspath) {
229 assert_return(syspath, -EINVAL);
235 r = device_set_syspath(device, syspath, true);
246 char *syspath;
255 syspath = strjoina("/sys/dev/", (type == 'b' ? "block" : "char"), "/", id);
257 return sd_device_new_from_syspath(ret, syspath);
261 char *syspath;
268 syspath = strjoina("/sys/subsystem/", sysname);
269 if (access(syspath, F_OK) >= 0)
270 return sd_device_new_from_syspath(ret, syspath);
272 syspath = strjoina("/sys/bus/", sysname);
273 if (access(syspath, F_OK) >= 0)
274 return sd_device_new_from_syspath(ret, syspath);
276 syspath = strjoina("/sys/class/", sysname);
277 if (access(syspath, F_OK) >= 0)
278 return sd_device_new_from_syspath(ret, syspath);
280 syspath = strjoina("/sys/module/", sysname);
281 if (access(syspath, F_OK) >= 0)
282 return sd_device_new_from_syspath(ret, syspath);
293 syspath = strjoina("/sys/subsystem/", subsys, "/drivers/", driver);
294 if (access(syspath, F_OK) >= 0)
295 return sd_device_new_from_syspath(ret, syspath);
297 syspath = strjoina("/sys/bus/", subsys, "/drivers/", driver);
298 if (access(syspath, F_OK) >= 0)
299 return sd_device_new_from_syspath(ret, syspath);
315 syspath = strjoina("/sys/subsystem/", subsystem, "/devices/", name);
316 if (access(syspath, F_OK) >= 0)
317 return sd_device_new_from_syspath(ret, syspath);
319 syspath = strjoina("/sys/bus/", subsystem, "/devices/", name);
320 if (access(syspath, F_OK) >= 0)
321 return sd_device_new_from_syspath(ret, syspath);
323 syspath = strjoina("/sys/class/", subsystem, "/", name);
324 if (access(syspath, F_OK) >= 0)
325 return sd_device_new_from_syspath(ret, syspath);
497 const char *syspath, *key = NULL, *value = NULL, *major = NULL, *minor = NULL;
518 r = sd_device_get_syspath(device, &syspath);
522 path = strjoina(syspath, "/uevent");
685 assert(path_startswith(device->syspath, "/sys/"));
687 *ret = device->syspath;
694 const char *subdir, *syspath;
700 r = sd_device_get_syspath(child, &syspath);
704 path = strdup(syspath);
777 const char *syspath;
782 r = sd_device_get_syspath(device, &syspath);
786 path = strjoina(syspath, "/subsystem");
905 const char *syspath;
909 r = sd_device_get_syspath(device, &syspath);
913 path = strjoina(syspath, "/driver");
1546 const char *syspath;
1555 r = sd_device_get_syspath(device, &syspath);
1559 dir = opendir(syspath);
1575 path = strjoina(syspath, "/", dent->d_name);
1704 const char *syspath, *cached_value = NULL;
1728 r = sd_device_get_syspath(device, &syspath);
1732 path = strjoina(syspath, "/", sysattr);
1796 const char *syspath;
1812 r = sd_device_get_syspath(device, &syspath);
1816 path = strjoina(syspath, "/", sysattr);