- dprintf("%s\n", sysfs_path);
- strncpy(dev, sysfs_path, len);
- strncat(dev, "/device", len);
- if (sysfs_get_link(dev, dev, len)) {
- if (!hotplug_mode)
- log_message(LOG_WARNING, "%s: %s\n", dev,
- strerror(errno));
- return -1;
- }
- return 0;
-}
-
-/*
- * sysfs_is_bus: Given the sysfs_path to a device, return 1 if sysfs_path
- * is on bus, 0 if not on bus, and < 0 on error
- */
-static int sysfs_is_bus(const char *sysfs_path, const char *bus)
-{
- char bus_dev_name[SYSFS_PATH_MAX];
- char bus_id[SYSFS_NAME_LEN];
- struct stat stat_buf;
- ino_t dev_inode;
-
- dprintf("%s\n", sysfs_path);
-
- if (sysfs_get_name_from_path(sysfs_path, bus_id, SYSFS_NAME_LEN))
- return -1;
-
- snprintf(bus_dev_name, MAX_NAME_LEN, "%s/%s/%s/%s/%s", sysfs_mnt_path,
- SYSFS_BUS_NAME, bus, SYSFS_DEVICES_NAME, bus_id);