dbg(udev, "syspath %s\n", udev_device_get_syspath(dev));
/* usb interface directory */
- dev_interface = udev_device_get_parent_with_subsystem(dev, "usb");
+ dev_interface = udev_device_get_parent_with_subsystem_devtype(dev, "usb", NULL);
if (dev_interface == NULL) {
info(udev, "unable to access usb_interface device of '%s'\n",
udev_device_get_syspath(dev));
udev_device_get_syspath(dev_interface), if_class_num, protocol);
/* usb device directory */
- dev_usb = udev_device_get_parent_with_subsystem(dev_interface, "usb");
+ dev_usb = udev_device_get_parent_with_subsystem_devtype(dev_interface, "usb", NULL);
if (!dev_usb) {
info(udev, "unable to find parent 'usb' device of '%s'\n",
udev_device_get_syspath(dev));
int host, bus, target, lun;
/* get scsi device */
- dev_scsi = udev_device_get_parent_with_subsystem(dev, "scsi");
+ dev_scsi = udev_device_get_parent_with_subsystem_devtype(dev, "scsi", NULL);
if (dev_scsi == NULL) {
info(udev, "unable to find parent 'scsi' device of '%s'\n",
udev_device_get_syspath(dev));
return udev_device->parent_device;
}
-struct udev_device *udev_device_get_parent_with_subsystem(struct udev_device *udev_device, const char *subsystem)
-{
- struct udev_device *parent;
-
- parent = udev_device_get_parent(udev_device);
- while (parent != NULL) {
- const char *parent_subsystem;
-
- parent_subsystem = udev_device_get_subsystem(parent);
- if (parent_subsystem != NULL && strcmp(parent_subsystem, subsystem) == 0)
- break;
- parent = udev_device_get_parent(parent);
- }
- return parent;
-}
-
struct udev_device *udev_device_get_parent_with_subsystem_devtype(struct udev_device *udev_device, const char *subsystem, const char *devtype)
{
struct udev_device *parent;
extern struct udev_device *udev_device_new_from_devnum(struct udev *udev, char type, dev_t devnum);
extern struct udev_device *udev_device_new_from_subsystem_sysname(struct udev *udev, const char *subsystem, const char *sysname);
extern struct udev_device *udev_device_get_parent(struct udev_device *udev_device);
-extern struct udev_device *udev_device_get_parent_with_subsystem(struct udev_device *udev_device, const char *subsystem);
extern struct udev_device *udev_device_get_parent_with_subsytem_devtype(struct udev_device *udev_device, const char *subsystem, const char *devtype);
extern struct udev_device *udev_device_ref(struct udev_device *udev_device);
extern void udev_device_unref(struct udev_device *udev_device);