Lines Matching refs:devname
67 free(device->devname); in device_free()
485 _public_ int sd_device_new_from_devname(sd_device **ret, const char *devname) { in sd_device_new_from_devname() argument
491 assert_return(devname, -EINVAL); in sd_device_new_from_devname()
497 if (isempty(path_startswith(devname, "/dev"))) in sd_device_new_from_devname()
500 if (device_path_parse_major_minor(devname, &mode, &devnum) >= 0) in sd_device_new_from_devname()
506 if (stat(devname, &st) < 0) in sd_device_new_from_devname()
559 int device_set_devname(sd_device *device, const char *devname) { in device_set_devname() argument
564 assert(devname); in device_set_devname()
566 if (devname[0] != '/') in device_set_devname()
567 t = strjoin("/dev/", devname); in device_set_devname()
569 t = strdup(devname); in device_set_devname()
577 return free_and_replace(device->devname, t); in device_set_devname()
1153 _public_ int sd_device_get_devname(sd_device *device, const char **devname) { in sd_device_get_devname() argument
1162 if (!device->devname) in sd_device_get_devname()
1165 assert(path_startswith(device->devname, "/dev/")); in sd_device_get_devname()
1167 if (devname) in sd_device_get_devname()
1168 *devname = device->devname; in sd_device_get_devname()
2311 const char *devname, *subsystem = NULL; in sd_device_open() local
2320 r = sd_device_get_devname(device, &devname); in sd_device_open()
2336 fd = open(devname, FLAGS_SET(flags, O_PATH) ? flags : O_CLOEXEC|O_NOFOLLOW|O_PATH); in sd_device_open()