diff options
author | Valentina Manea <valentina.manea.m@gmail.com> | 2014-03-08 14:53:26 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-03-08 22:46:42 -0800 |
commit | 021aed845303989f5deb40b950e80342531876ce (patch) | |
tree | 5a3edc6d974fdafecc1ce6b0188b71460c989f32 /drivers/staging/usbip/userspace/src/usbipd.c | |
parent | ecc13b72555323458c5e6931edf81918d9c9abbc (diff) |
staging: usbip: userspace: migrate usbip_host_driver to libudev
This patch modifies usbip_host_driver to use libudev.
Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com>
Reviewed-by: Shuah Khan <shuah.kh@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/usbip/userspace/src/usbipd.c')
-rw-r--r-- | drivers/staging/usbip/userspace/src/usbipd.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/staging/usbip/userspace/src/usbipd.c b/drivers/staging/usbip/userspace/src/usbipd.c index 771d6c238297..2cae4ce48d11 100644 --- a/drivers/staging/usbip/userspace/src/usbipd.c +++ b/drivers/staging/usbip/userspace/src/usbipd.c @@ -43,6 +43,7 @@ #include "usbip_host_driver.h" #include "usbip_common.h" #include "usbip_network.h" +#include "list.h" #undef PROGNAME #define PROGNAME "usbipd" @@ -93,6 +94,7 @@ static int recv_request_import(int sockfd) struct op_common reply; struct usbip_exported_device *edev; struct usbip_usb_device pdu_udev; + struct list_head *i; int found = 0; int error = 0; int rc; @@ -107,8 +109,8 @@ static int recv_request_import(int sockfd) } PACK_OP_IMPORT_REQUEST(0, &req); - dlist_for_each_data(host_driver->edev_list, edev, - struct usbip_exported_device) { + list_for_each(i, &host_driver->edev_list) { + edev = list_entry(i, struct usbip_exported_device, node); if (!strncmp(req.busid, edev->udev.busid, SYSFS_BUS_ID_SIZE)) { info("found requested device: %s", req.busid); found = 1; @@ -161,12 +163,12 @@ static int send_reply_devlist(int connfd) struct usbip_usb_device pdu_udev; struct usbip_usb_interface pdu_uinf; struct op_devlist_reply reply; + struct list_head *j; int rc, i; reply.ndev = 0; /* number of exported devices */ - dlist_for_each_data(host_driver->edev_list, edev, - struct usbip_exported_device) { + list_for_each(j, &host_driver->edev_list) { reply.ndev += 1; } info("exportable devices: %d", reply.ndev); @@ -184,8 +186,8 @@ static int send_reply_devlist(int connfd) return -1; } - dlist_for_each_data(host_driver->edev_list, edev, - struct usbip_exported_device) { + list_for_each(j, &host_driver->edev_list) { + edev = list_entry(j, struct usbip_exported_device, node); dump_usb_device(&edev->udev); memcpy(&pdu_udev, &edev->udev, sizeof(pdu_udev)); usbip_net_pack_usb_device(1, &pdu_udev); |