diff options
Diffstat (limited to 'drivers/staging/usbip/userspace/libsrc/vhci_driver.c')
-rw-r--r-- | drivers/staging/usbip/userspace/libsrc/vhci_driver.c | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/drivers/staging/usbip/userspace/libsrc/vhci_driver.c b/drivers/staging/usbip/userspace/libsrc/vhci_driver.c index 0958ba53e94a..25e62e9f0a33 100644 --- a/drivers/staging/usbip/userspace/libsrc/vhci_driver.c +++ b/drivers/staging/usbip/userspace/libsrc/vhci_driver.c @@ -10,7 +10,8 @@ struct usbip_vhci_driver *vhci_driver; -static struct usbip_imported_device *imported_device_init(struct usbip_imported_device *idev, char *busid) +static struct usbip_imported_device * +imported_device_init(struct usbip_imported_device *idev, char *busid) { struct sysfs_device *sudev; @@ -29,14 +30,16 @@ static struct usbip_imported_device *imported_device_init(struct usbip_imported_ if (!strncmp(cdev->dev_path, idev->udev.path, strlen(idev->udev.path))) { struct usbip_class_device *new_cdev; - - /* alloc and copy because dlist is linked from only one list */ + /* + * alloc and copy because dlist is linked + * from only one list + */ new_cdev = calloc(1, sizeof(*new_cdev)); if (!new_cdev) goto err; memcpy(new_cdev, cdev, sizeof(*new_cdev)); - dlist_unshift(idev->cdev_list, (void*) new_cdev); + dlist_unshift(idev->cdev_list, (void *) new_cdev); } } @@ -101,7 +104,8 @@ static int parse_status(char *value) return -1; } - if (idev->status != VDEV_ST_NULL && idev->status != VDEV_ST_NOTASSIGNED) { + if (idev->status != VDEV_ST_NULL + && idev->status != VDEV_ST_NOTASSIGNED) { idev = imported_device_init(idev, lbusid); if (!idev) { dbg("imported_device_init failed"); @@ -126,8 +130,10 @@ static int parse_status(char *value) static int check_usbip_device(struct sysfs_class_device *cdev) { - char class_path[SYSFS_PATH_MAX]; /* /sys/class/video4linux/video0/device */ - char dev_path[SYSFS_PATH_MAX]; /* /sys/devices/platform/vhci_hcd/usb6/6-1:1.1 */ + /* /sys/class/video4linux/video0/device */ + char class_path[SYSFS_PATH_MAX]; + /* /sys/devices/platform/vhci_hcd/usb6/6-1:1.1 */ + char dev_path[SYSFS_PATH_MAX]; int ret; struct usbip_class_device *usbip_cdev; @@ -289,25 +295,25 @@ static int get_nports(void) static int get_hc_busid(char *sysfs_mntpath, char *hc_busid) { - struct sysfs_driver *sdriver; - char sdriver_path[SYSFS_PATH_MAX]; + struct sysfs_driver *sdriver; + char sdriver_path[SYSFS_PATH_MAX]; struct sysfs_device *hc_dev; struct dlist *hc_devs; int found = 0; - 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); + 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) { + sdriver = sysfs_open_driver_path(sdriver_path); + if (!sdriver) { dbg("sysfs_open_driver_path failed: %s", sdriver_path); - dbg("make sure " USBIP_CORE_MOD_NAME ".ko and " + dbg("make sure " USBIP_CORE_MOD_NAME ".ko and " USBIP_VHCI_DRV_NAME ".ko are loaded!"); - return -1; - } + return -1; + } hc_devs = sysfs_get_driver_devices(sdriver); if (!hc_devs) { |