Index: c/src/lib/libbsp/m68k/mcf5206elite/ChangeLog
===================================================================
--- c/src/lib/libbsp/m68k/mcf5206elite/ChangeLog	(revision 4a260f074de547dd91bb0dbc25ab52ca4c94eb53)
+++ c/src/lib/libbsp/m68k/mcf5206elite/ChangeLog	(revision b06d05522831aeb14e40c463a30a9faaca5ecb8b)
@@ -1,2 +1,7 @@
+2008-09-08      Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
+
+	* i2c/i2c.c, i2c/i2cdrv.c, include/i2c.h:
+	converted done_arg to a void pointer 
+	
 2008-09-06	Ralf CorsÃ©pius <ralf.corsepius@rtems.org>
 
Index: c/src/lib/libbsp/m68k/mcf5206elite/i2c/i2c.c
===================================================================
--- c/src/lib/libbsp/m68k/mcf5206elite/i2c/i2c.c	(revision 4a260f074de547dd91bb0dbc25ab52ca4c94eb53)
+++ c/src/lib/libbsp/m68k/mcf5206elite/i2c/i2c.c	(revision b06d05522831aeb14e40c463a30a9faaca5ecb8b)
@@ -24,7 +24,7 @@
  */
 static void
-i2c_transfer_sema_done_func(uint32_t         arg)
-{
-    rtems_id sema = (rtems_id)arg;
+i2c_transfer_sema_done_func(void * arg)
+{
+    rtems_id sema = *(rtems_id *)arg;
     rtems_semaphore_release(sema);
 }
@@ -39,5 +39,5 @@
  */
 static void
-i2c_transfer_poll_done_func(uint32_t         arg)
+i2c_transfer_poll_done_func(void *arg)
 {
     bool *poll_done_flag = (bool *)arg;
@@ -73,5 +73,6 @@
     if (sc != RTEMS_SUCCESSFUL)
         return I2C_RESOURCE_NOT_AVAILABLE;
-    sc = i2c_transfer(bus, nmsg, msg, i2c_transfer_sema_done_func, sema);
+    sc = i2c_transfer(bus, nmsg, msg, 
+		      i2c_transfer_sema_done_func, &sema);
     if (sc != RTEMS_SUCCESSFUL)
     {
@@ -99,9 +100,14 @@
 i2c_transfer_wait_poll(i2c_bus_number bus, i2c_message *msg, int nmsg)
 {
+  /*
+   * this looks nasty, but is correct:
+   * we wait in this function, until the poll_done_flag is
+   * set deep inside the i2c_poll() function
+   */
     volatile bool poll_done_flag;
     rtems_status_code sc;
     poll_done_flag = false;
-    sc = i2c_transfer(bus, nmsg, msg, i2c_transfer_poll_done_func,
-                      (uint32_t)&poll_done_flag);
+    sc = i2c_transfer(bus, nmsg, msg, 
+		      i2c_transfer_poll_done_func,(void *)&poll_done_flag);
     if (sc != RTEMS_SUCCESSFUL)
         return sc;
Index: c/src/lib/libbsp/m68k/mcf5206elite/i2c/i2cdrv.c
===================================================================
--- c/src/lib/libbsp/m68k/mcf5206elite/i2c/i2cdrv.c	(revision 4a260f074de547dd91bb0dbc25ab52ca4c94eb53)
+++ c/src/lib/libbsp/m68k/mcf5206elite/i2c/i2cdrv.c	(revision b06d05522831aeb14e40c463a30a9faaca5ecb8b)
@@ -50,5 +50,5 @@
     int               nmsg;     /* number of messages in transfer */
     i2c_transfer_done done;     /* transfer done callback function */
-    uint32_t          done_arg; /* arbitrary argument to done callback */
+    void *    done_arg_ptr;     /* arbitrary arg pointer to done callback */
 } i2c_qel;
 
@@ -85,9 +85,9 @@
  */
 static void
-i2cdrv_done(uint32_t         arg)
+i2cdrv_done(void * arg_ptr)
 {
     rtems_interrupt_level level;
     i2c_qel *qel = tqueue + tqueue_tail;
-    qel->done(qel->done_arg);
+    qel->done(qel->done_arg_ptr);
     rtems_interrupt_disable(level);
     tqueue_tail = (tqueue_tail + 1) % tqueue_size;
@@ -120,6 +120,6 @@
             mcfmbus_select_clock_divider(&mbus, i2cdrv_bus_clock_div_current);
         }
-        sc = mcfmbus_i2c_transfer(&mbus, qel->nmsg, qel->msg, i2cdrv_done,
-                                  (uint32_t)qel);
+        sc = mcfmbus_i2c_transfer(&mbus, qel->nmsg, qel->msg, 
+				  i2cdrv_done,qel);
         if (sc != RTEMS_SUCCESSFUL)
         {
@@ -129,5 +129,5 @@
                 qel->msg[i].status = I2C_RESOURCE_NOT_AVAILABLE;
             }
-            i2cdrv_done((uint32_t)qel);
+            i2cdrv_done(qel);
         }
     }
@@ -148,5 +148,5 @@
  *     msg - pointer to messages array
  *     done - function which is called when transfer is finished
- *     done_arg - arbitrary argument passed to done funciton
+ *     done_arg_ptr - arbitrary argument pointer passed to done funciton
  *
  * RETURNS:
@@ -156,5 +156,5 @@
 rtems_status_code
 i2c_transfer(i2c_bus_number bus, int nmsg, i2c_message *msg,
-             i2c_transfer_done done, uint32_t         done_arg)
+             i2c_transfer_done done, void *     done_arg_ptr)
 {
     i2c_qel qel;
@@ -175,5 +175,5 @@
     qel.nmsg = nmsg;
     qel.done = done;
-    qel.done_arg = done_arg;
+    qel.done_arg_ptr = done_arg_ptr;
     rtems_interrupt_disable(level);
     if ((tqueue_head + 1) % tqueue_size == tqueue_tail)
Index: c/src/lib/libbsp/m68k/mcf5206elite/include/i2c.h
===================================================================
--- c/src/lib/libbsp/m68k/mcf5206elite/include/i2c.h	(revision 4a260f074de547dd91bb0dbc25ab52ca4c94eb53)
+++ c/src/lib/libbsp/m68k/mcf5206elite/include/i2c.h	(revision b06d05522831aeb14e40c463a30a9faaca5ecb8b)
@@ -117,5 +117,5 @@
  *     msg - pointer to messages array
  *     done - function which is called when transfer is finished
- *     done_arg - arbitrary argument passed to done funciton
+ *     done_arg_ptr - arbitrary argument ptr passed to done funciton
  *
  * RETURNS:
@@ -125,5 +125,5 @@
 rtems_status_code
 i2c_transfer(i2c_bus_number bus, int nmsg, i2c_message *msg,
-             i2c_transfer_done done, uint32_t         done_arg);
+             i2c_transfer_done done, void * done_arg_ptr);
 
 /* i2c_transfer_wait --
