- err("unable to access '%s'", devpath);
- return 1;
- }
-
- /* get scsi parent device */
- dev_scsi = sysfs_device_get_parent(dev);
- if (dev_scsi == NULL) {
- err("unable to access parent device of '%s'", devpath);
- return 1;
- }
- /* allow only scsi devices */
- if (strcmp(dev_scsi->subsystem, "scsi") != 0) {
- info("%s is not a scsi device", 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);