- if (sysfs_get_actual_dev(target_path, full_dev_path, MAX_NAME_LEN))
- return 1;
-
- dprintf("full_dev_path %s\n", full_dev_path);
-
- /*
- * Allow only scsi devices (those that have a matching device
- * under /bus/scsi/devices).
- *
- * Other block devices can support SG IO, but only ide-cd does, so
- * for now, don't bother with anything else.
- */
- retval = sysfs_is_bus(full_dev_path, "scsi");
- if (retval == 0) {
- if (hotplug_mode)
- /*
- * Expected in some cases.
- */
- dprintf("%s is not a scsi device\n", target_path);
- else
- log_message(LOG_WARNING, "%s is not a scsi device\n",
- target_path);
- return 1;
- } else if (retval < 0) {
- log_message(LOG_WARNING, "sysfs_is_bus failed: %s\n",
- strerror(errno));
+ /* get scsi parent device */
+ dev_scsi = sysfs_device_get_parent_with_subsystem(dev, "scsi");
+ if (dev_scsi == NULL) {
+ err("unable to access parent device of '%s'", devpath);