Index: uspace/drv/ohci/batch.c
===================================================================
--- uspace/drv/ohci/batch.c	(revision d017cea07b4e7cb0a582e6b399e54debc2523481)
+++ uspace/drv/ohci/batch.c	(revision 5a2c42bd0e02f21ac673b0897cc3c6cd7816158b)
@@ -43,15 +43,22 @@
 #include "hw_struct/transfer_descriptor.h"
 
-typedef struct ohci_batch {
+typedef struct ohci_transfer_batch {
 	ed_t *ed;
 	td_t *tds;
 	size_t td_count;
-} ohci_batch_t;
+} ohci_transfer_batch_t;
+
+static void ohci_transfer_batch_dispose(void *ohci_batch)
+{
+	//TODO: add buffer disposal
+	ohci_transfer_batch_t *instance = ohci_batch;
+	assert(instance);
+	free32(instance->ed);
+	free32(instance->tds);
+}
 
 static void batch_control(usb_transfer_batch_t *instance,
     usb_direction_t data_dir, usb_direction_t status_dir);
 static void batch_data(usb_transfer_batch_t *instance);
-static void batch_call_in_and_dispose(usb_transfer_batch_t *instance);
-static void batch_call_out_and_dispose(usb_transfer_batch_t *instance);
 
 #define DEFAULT_ERROR_COUNT 3
@@ -65,5 +72,5 @@
                 usb_log_error(message); \
                 if (instance) { \
-                        batch_dispose(instance); \
+                        usb_transfer_batch_dispose(instance); \
                 } \
                 return NULL; \
@@ -74,9 +81,10 @@
 	    "Failed to allocate batch instance.\n");
 	usb_transfer_batch_init(instance, ep, buffer, NULL, buffer_size,
-	    NULL, setup_size, func_in, func_out, arg, fun, NULL);
-
-	ohci_batch_t *data = malloc(sizeof(ohci_batch_t));
+	    NULL, setup_size, func_in, func_out, arg, fun, NULL,
+	    ohci_transfer_batch_dispose);
+
+	ohci_transfer_batch_t *data = malloc(sizeof(ohci_transfer_batch_t));
 	CHECK_NULL_DISPOSE_RETURN(data, "Failed to allocate batch data.\n");
-	bzero(data, sizeof(ohci_batch_t));
+	bzero(data, sizeof(ohci_transfer_batch_t));
 	instance->private_data = data;
 
@@ -113,21 +121,8 @@
 }
 /*----------------------------------------------------------------------------*/
-void batch_dispose(usb_transfer_batch_t *instance)
-{
-	assert(instance);
-	ohci_batch_t *data = instance->private_data;
-	assert(data);
-	free32(data->ed);
-	free32(data->tds);
-	free32(instance->setup_buffer);
-	free32(instance->data_buffer);
-	free(data);
-	free(instance);
-}
-/*----------------------------------------------------------------------------*/
 bool batch_is_complete(usb_transfer_batch_t *instance)
 {
 	assert(instance);
-	ohci_batch_t *data = instance->private_data;
+	ohci_transfer_batch_t *data = instance->private_data;
 	assert(data);
 	size_t tds = data->td_count - 1;
@@ -163,5 +158,5 @@
 	/* We are data out, we are supposed to provide data */
 	memcpy(instance->data_buffer, instance->buffer, instance->buffer_size);
-	instance->next_step = batch_call_out_and_dispose;
+	instance->next_step = usb_transfer_batch_call_out_and_dispose;
 	batch_control(instance, USB_DIRECTION_OUT, USB_DIRECTION_IN);
 	usb_log_debug("Batch(%p) CONTROL WRITE initialized.\n", instance);
@@ -171,5 +166,5 @@
 {
 	assert(instance);
-	instance->next_step = batch_call_in_and_dispose;
+	instance->next_step = usb_transfer_batch_call_in_and_dispose;
 	batch_control(instance, USB_DIRECTION_IN, USB_DIRECTION_OUT);
 	usb_log_debug("Batch(%p) CONTROL READ initialized.\n", instance);
@@ -179,5 +174,5 @@
 {
 	assert(instance);
-	instance->next_step = batch_call_in_and_dispose;
+	instance->next_step = usb_transfer_batch_call_in_and_dispose;
 	batch_data(instance);
 	usb_log_debug("Batch(%p) INTERRUPT IN initialized.\n", instance);
@@ -189,5 +184,5 @@
 	/* We are data out, we are supposed to provide data */
 	memcpy(instance->data_buffer, instance->buffer, instance->buffer_size);
-	instance->next_step = batch_call_out_and_dispose;
+	instance->next_step = usb_transfer_batch_call_out_and_dispose;
 	batch_data(instance);
 	usb_log_debug("Batch(%p) INTERRUPT OUT initialized.\n", instance);
@@ -197,5 +192,5 @@
 {
 	assert(instance);
-	instance->next_step = batch_call_in_and_dispose;
+	instance->next_step = usb_transfer_batch_call_in_and_dispose;
 	batch_data(instance);
 	usb_log_debug("Batch(%p) BULK IN initialized.\n", instance);
@@ -205,5 +200,5 @@
 {
 	assert(instance);
-	instance->next_step = batch_call_in_and_dispose;
+	instance->next_step = usb_transfer_batch_call_in_and_dispose;
 	batch_data(instance);
 	usb_log_debug("Batch(%p) BULK IN initialized.\n", instance);
@@ -213,5 +208,5 @@
 {
 	assert(instance);
-	ohci_batch_t *data = instance->private_data;
+	ohci_transfer_batch_t *data = instance->private_data;
 	assert(data);
 	return data->ed;
@@ -222,5 +217,5 @@
 {
 	assert(instance);
-	ohci_batch_t *data = instance->private_data;
+	ohci_transfer_batch_t *data = instance->private_data;
 	assert(data);
 	ed_init(data->ed, instance->ep);
@@ -270,5 +265,5 @@
 {
 	assert(instance);
-	ohci_batch_t *data = instance->private_data;
+	ohci_transfer_batch_t *data = instance->private_data;
 	assert(data);
 	ed_init(data->ed, instance->ep);
@@ -299,26 +294,4 @@
 	}
 }
-/*----------------------------------------------------------------------------*/
-/** Helper function calls callback and correctly disposes of batch structure.
- *
- * @param[in] instance Batch structure to use.
- */
-void batch_call_in_and_dispose(usb_transfer_batch_t *instance)
-{
-	assert(instance);
-	usb_transfer_batch_call_in(instance);
-	batch_dispose(instance);
-}
-/*----------------------------------------------------------------------------*/
-/** Helper function calls callback and correctly disposes of batch structure.
- *
- * @param[in] instance Batch structure to use.
- */
-void batch_call_out_and_dispose(usb_transfer_batch_t *instance)
-{
-	assert(instance);
-	usb_transfer_batch_call_out(instance);
-	batch_dispose(instance);
-}
 /**
  * @}
