+ memset(subsys, 0, SYSFS_PATH_MAX);
+ strcat(subsys, "/");
+ strcpy(subsys, SYSFS_BUS_NAME);
+ buslist = sysfs_open_subsystem_list(subsys);
+ if (buslist != NULL) {
+ dlist_for_each_data(buslist, bus, char) {
+ memset(subsys, 0, SYSFS_PATH_MAX);
+ strcat(subsys, "/");
+ strcpy(subsys, SYSFS_BUS_NAME);
+ strcat(subsys, "/");
+ strcat(subsys, bus);
+ strcat(subsys, "/");
+ strcat(subsys, SYSFS_DRIVERS_NAME);
+ drivers = sysfs_open_subsystem_list(subsys);
+ if (drivers != NULL) {
+ dlist_for_each_data(drivers, curdrv, char) {
+ if (strcmp(driver, curdrv) == 0) {
+ strncpy(busname, bus, bsize);
+ sysfs_close_list(drivers);
+ sysfs_close_list(buslist);
+ return 0;
+ }
+ }
+ sysfs_close_list(drivers);
+ }
+ }
+ sysfs_close_list(buslist);
+ }
+ return -1;