Index: uspace/lib/usb/Makefile
===================================================================
--- uspace/lib/usb/Makefile	(revision 6df14c51d616cbf1e61302a8b1257b88cbe815a5)
+++ uspace/lib/usb/Makefile	(revision a045ab1e7bd6bb7cd550b95bb706e6279dbb08cc)
@@ -37,4 +37,5 @@
 	src/class.c \
 	src/ddfiface.c \
+	src/dev.c \
 	src/debug.c \
 	src/dump.c \
Index: uspace/lib/usb/include/usb/dev.h
===================================================================
--- uspace/lib/usb/include/usb/dev.h	(revision a045ab1e7bd6bb7cd550b95bb706e6279dbb08cc)
+++ uspace/lib/usb/include/usb/dev.h	(revision a045ab1e7bd6bb7cd550b95bb706e6279dbb08cc)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2011 Jan Vesely
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/** @addtogroup libusb
+ * @{
+ */
+/** @file
+ * Common USB types and functions.
+ */
+#ifndef LIBUSB_DEV_H_
+#define LIBUSB_DEV_H_
+
+#include <usb/usb.h>
+#include <devman.h>
+
+usb_address_t usb_get_address_by_handle(devman_handle_t);
+
+int usb_find_hc(devman_handle_t, devman_handle_t *);
+
+int usb_resolve_device_handle(const char *, devman_handle_t *, usb_address_t *,
+    devman_handle_t *);
+#endif
+/**
+ * @}
+ */
Index: uspace/lib/usb/include/usb/hc.h
===================================================================
--- uspace/lib/usb/include/usb/hc.h	(revision 6df14c51d616cbf1e61302a8b1257b88cbe815a5)
+++ uspace/lib/usb/include/usb/hc.h	(revision a045ab1e7bd6bb7cd550b95bb706e6279dbb08cc)
@@ -114,11 +114,4 @@
 }
 
-usb_address_t usb_get_address_by_handle(devman_handle_t);
-
-int usb_find_hc(devman_handle_t, devman_handle_t *);
-
-int usb_resolve_device_handle(const char *, devman_handle_t *, usb_address_t *,
-    devman_handle_t *);
-
 int usb_ddf_get_hc_handle_by_sid(service_id_t, devman_handle_t *);
 
Index: uspace/lib/usb/include/usb/usb.h
===================================================================
--- uspace/lib/usb/include/usb/usb.h	(revision 6df14c51d616cbf1e61302a8b1257b88cbe815a5)
+++ uspace/lib/usb/include/usb/usb.h	(revision a045ab1e7bd6bb7cd550b95bb706e6279dbb08cc)
@@ -26,5 +26,4 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-
 /** @addtogroup libusb
  * @{
Index: uspace/lib/usb/src/ddfiface.c
===================================================================
--- uspace/lib/usb/src/ddfiface.c	(revision 6df14c51d616cbf1e61302a8b1257b88cbe815a5)
+++ uspace/lib/usb/src/ddfiface.c	(revision a045ab1e7bd6bb7cd550b95bb706e6279dbb08cc)
@@ -43,4 +43,6 @@
 #include <errno.h>
 #include <assert.h>
+
+#include <usb/dev.h>
 
 /** DDF interface for USB device, implementation for typical hub. */
@@ -134,5 +136,5 @@
 	assert(fun);
 	assert(fun->driver_data);
-	usb_hub_attached_device_t *device = fun->driver_data;
+	const usb_hub_attached_device_t *device = fun->driver_data;
 	assert(device->fun == fun);
 	if (address)
Index: uspace/lib/usb/src/dev.c
===================================================================
--- uspace/lib/usb/src/dev.c	(revision a045ab1e7bd6bb7cd550b95bb706e6279dbb08cc)
+++ uspace/lib/usb/src/dev.c	(revision a045ab1e7bd6bb7cd550b95bb706e6279dbb08cc)
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2011 Jan Vesely
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <usb/dev.h>
+#include <errno.h>
+#include <usb_iface.h>
+
+/** Tell USB address assigned to device with given handle.
+ *
+ * @param dev_handle Devman handle of the USB device in question.
+ * @return USB address or negative error code.
+ */
+usb_address_t usb_get_address_by_handle(devman_handle_t dev_handle)
+{
+	async_sess_t *parent_sess =
+	    devman_parent_device_connect(EXCHANGE_ATOMIC, dev_handle,
+	    IPC_FLAG_BLOCKING);
+	if (!parent_sess)
+		return ENOMEM;
+
+	async_exch_t *exch = async_exchange_begin(parent_sess);
+	if (!exch) {
+		async_hangup(parent_sess);
+		return ENOMEM;
+	}
+	usb_address_t address;
+	const int ret = usb_get_my_address(exch, &address);
+
+	async_exchange_end(exch);
+	async_hangup(parent_sess);
+
+	if (ret != EOK)
+		return ret;
+
+	return address;
+}
+/*----------------------------------------------------------------------------*/
+/** Find host controller handle for the device.
+ *
+ * @param[in] device_handle Device devman handle.
+ * @param[out] hc_handle Where to store handle of host controller
+ *	controlling device with @p device_handle handle.
+ * @return Error code.
+ */
+int usb_find_hc(devman_handle_t device_handle, devman_handle_t *hc_handle)
+{
+	async_sess_t *parent_sess =
+	    devman_parent_device_connect(EXCHANGE_ATOMIC, device_handle,
+	    IPC_FLAG_BLOCKING);
+	if (!parent_sess)
+		return ENOMEM;
+
+	async_exch_t *exch = async_exchange_begin(parent_sess);
+	if (!exch) {
+		async_hangup(parent_sess);
+		return ENOMEM;
+	}
+	const int ret = usb_get_hc_handle(exch, hc_handle);
+
+	async_exchange_end(exch);
+	async_hangup(parent_sess);
+
+	return ret;
+}
Index: uspace/lib/usb/src/hc.c
===================================================================
--- uspace/lib/usb/src/hc.c	(revision 6df14c51d616cbf1e61302a8b1257b88cbe815a5)
+++ uspace/lib/usb/src/hc.c	(revision a045ab1e7bd6bb7cd550b95bb706e6279dbb08cc)
@@ -37,8 +37,8 @@
 #include <async.h>
 #include <dev_iface.h>
-#include <usb_iface.h>
 #include <usbhc_iface.h>
 #include <usb/hc.h>
 #include <usb/debug.h>
+#include <usb/dev.h>
 #include <errno.h>
 #include <assert.h>
@@ -288,62 +288,4 @@
 	return ret;
 }
-/*----------------------------------------------------------------------------*/
-/** Tell USB address assigned to device with given handle.
- *
- * @param dev_handle Devman handle of the USB device in question.
- * @return USB address or negative error code.
- */
-usb_address_t usb_get_address_by_handle(devman_handle_t dev_handle)
-{
-	async_sess_t *parent_sess =
-	    devman_parent_device_connect(EXCHANGE_ATOMIC, dev_handle,
-	    IPC_FLAG_BLOCKING);
-	if (!parent_sess)
-		return ENOMEM;
-
-	async_exch_t *exch = async_exchange_begin(parent_sess);
-	if (!exch) {
-		async_hangup(parent_sess);
-		return ENOMEM;
-	}
-	usb_address_t address;
-	const int ret = usb_get_my_address(exch, &address);
-
-	async_exchange_end(exch);
-	async_hangup(parent_sess);
-
-	if (ret != EOK)
-		return ret;
-
-	return address;
-}
-
-/** Find host controller handle for the device.
- *
- * @param[in] device_handle Device devman handle.
- * @param[out] hc_handle Where to store handle of host controller
- *	controlling device with @p device_handle handle.
- * @return Error code.
- */
-int usb_find_hc(devman_handle_t device_handle, devman_handle_t *hc_handle)
-{
-	async_sess_t *parent_sess =
-	    devman_parent_device_connect(EXCHANGE_ATOMIC, device_handle,
-	    IPC_FLAG_BLOCKING);
-	if (!parent_sess)
-		return ENOMEM;
-
-	async_exch_t *exch = async_exchange_begin(parent_sess);
-	if (!exch) {
-		async_hangup(parent_sess);
-		return ENOMEM;
-	}
-	const int ret = usb_get_hc_handle(exch, hc_handle);
-
-	async_exchange_end(exch);
-	async_hangup(parent_sess);
-
-	return ret;
-}
 
 /**
Index: uspace/lib/usb/src/resolve.c
===================================================================
--- uspace/lib/usb/src/resolve.c	(revision 6df14c51d616cbf1e61302a8b1257b88cbe815a5)
+++ uspace/lib/usb/src/resolve.c	(revision a045ab1e7bd6bb7cd550b95bb706e6279dbb08cc)
@@ -34,4 +34,5 @@
  */
 #include <inttypes.h>
+#include <usb/dev.h>
 #include <usb/hc.h>
 #include <devman.h>
@@ -77,16 +78,8 @@
     devman_handle_t *dev_handle)
 {
-	int rc;
 	usb_hc_connection_t conn;
-
 	usb_hc_connection_initialize(&conn, hc_handle);
-	rc = usb_hc_connection_open(&conn);
-	if (rc != EOK) {
-		return rc;
-	}
-
-	rc = usb_hc_get_handle_by_address(&conn, addr, dev_handle);
-
-	usb_hc_connection_close(&conn);
+
+	const int rc = usb_hc_get_handle_by_address(&conn, addr, dev_handle);
 
 	return rc;
