Index: uspace/lib/c/generic/device/hw_res.c
===================================================================
--- uspace/lib/c/generic/device/hw_res.c	(revision f77c1c90c1f223647872d5cefa2d86f63bc846d7)
+++ uspace/lib/c/generic/device/hw_res.c	(revision c19a5a59bb6be5cf8da4e0c9a6a35d207103bc14)
@@ -140,9 +140,10 @@
  * @param channel DMA channel.
  *
- * @return Number of bytes remaining in the buffer if positive.
- * @return Error code if negative.
+ * @param[out] rem Number of bytes remaining in the buffer if positive.
+ *
+ * @return Error code.
  *
  */
-int hw_res_dma_channel_remain(async_sess_t *sess, unsigned channel)
+int hw_res_dma_channel_remain(async_sess_t *sess, unsigned channel, size_t *rem)
 {
 	async_exch_t *exch = async_exchange_begin(sess);
@@ -155,5 +156,5 @@
 	
 	if (ret == EOK)
-		return remain;
+		*rem = remain;
 	
 	return ret;
Index: uspace/lib/c/include/device/hw_res.h
===================================================================
--- uspace/lib/c/include/device/hw_res.h	(revision f77c1c90c1f223647872d5cefa2d86f63bc846d7)
+++ uspace/lib/c/include/device/hw_res.h	(revision c19a5a59bb6be5cf8da4e0c9a6a35d207103bc14)
@@ -123,5 +123,5 @@
 extern int hw_res_dma_channel_setup(async_sess_t *, unsigned int, uint32_t,
     uint32_t, uint8_t);
-extern int hw_res_dma_channel_remain(async_sess_t *, unsigned);
+extern int hw_res_dma_channel_remain(async_sess_t *, unsigned, size_t *);
 
 #endif
