- /* get scsi parent device */
- dev_scsi = sysfs_device_get_parent_with_subsystem(dev, "scsi");
- if (dev_scsi == NULL) {
- err("unable to find parent 'scsi' device of '%s'", devpath);
- return 1;
- }
-
- /* target directory */
- dev_target = sysfs_device_get_parent(dev_scsi);
- if (dev_target == NULL) {
- err("unable to access parent device of '%s'", devpath);
- return 1;
- }
-
- /* host directory */
- dev_host = sysfs_device_get_parent(dev_target);
- if (dev_host == NULL) {
- err("unable to access parent device of '%s'", devpath);
- return 1;
- }
-