Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 259496
b: refs/heads/master
c: 5805842
h: refs/heads/master
v: v3
  • Loading branch information
matt mooney authored and Greg Kroah-Hartman committed Jun 7, 2011
1 parent 7c7431c commit 34a1e13
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7e485ee7f530bb8f5c02c2ae68d73ce7ee3dfad5
refs/heads/master: 58058422f84523d8ab73b98753670dc9377e071a
22 changes: 17 additions & 5 deletions trunk/drivers/staging/usbip/userspace/libsrc/vhci_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,20 @@ static int refresh_class_device_list(void)
int ret;
struct dlist *cname_list;
char *cname;
char sysfs_mntpath[SYSFS_PATH_MAX];
char class_path[SYSFS_PATH_MAX];

ret = sysfs_get_mnt_path(sysfs_mntpath, SYSFS_PATH_MAX);
if (ret < 0) {
err("sysfs must be mounted");
return -1;
}

snprintf(class_path, sizeof(class_path), "%s/%s", sysfs_mntpath,
SYSFS_CLASS_NAME);

/* search under /sys/class */
cname_list = sysfs_open_directory_list("/sys/class");
cname_list = sysfs_open_directory_list(class_path);
if (!cname_list) {
err("open class directory");
return -1;
Expand Down Expand Up @@ -274,9 +285,9 @@ static int get_hc_busid(char *sysfs_mntpath, char *hc_busid)

int found = 0;

snprintf(sdriver_path, SYSFS_PATH_MAX, "%s/%s/platform/%s/%s",
sysfs_mntpath, SYSFS_BUS_NAME, SYSFS_DRIVERS_NAME,
USBIP_VHCI_DRV_NAME);
snprintf(sdriver_path, SYSFS_PATH_MAX, "%s/%s/%s/%s/%s", sysfs_mntpath,
SYSFS_BUS_NAME, USBIP_VHCI_BUS_TYPE, SYSFS_DRIVERS_NAME,
USBIP_VHCI_DRV_NAME);

sdriver = sysfs_open_driver_path(sdriver_path);
if (!sdriver) {
Expand Down Expand Up @@ -333,7 +344,8 @@ int usbip_vhci_driver_open(void)
goto err;

/* will be freed in usbip_driver_close() */
vhci_driver->hc_device = sysfs_open_device("platform", hc_busid);
vhci_driver->hc_device = sysfs_open_device(USBIP_VHCI_BUS_TYPE,
hc_busid);
if (!vhci_driver->hc_device) {
err("get sysfs vhci_driver");
goto err;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/usbip/userspace/libsrc/vhci_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "usbip.h"


#define USBIP_VHCI_BUS_TYPE "platform"

#define MAXNPORT 128

Expand Down

0 comments on commit 34a1e13

Please sign in to comment.