omap: eliminate l4_register_io_memory
authorAvi Kivity <avi@redhat.com>
Wed, 23 Nov 2011 12:58:10 +0000 (14:58 +0200)
committerAvi Kivity <avi@redhat.com>
Mon, 28 Nov 2011 13:38:40 +0000 (15:38 +0200)
This is a trivial wrapper around cpu_register_io_memory(), adding
no value.  Inline it into all callers.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Avi Kivity <avi@redhat.com>
hw/omap.h
hw/omap2.c
hw/omap_dss.c
hw/omap_gptimer.c
hw/omap_i2c.c
hw/omap_l4.c
hw/omap_mmc.c
hw/omap_spi.c
hw/omap_synctimer.c
hw/omap_tap.c

index 8bd1810eb3439fff272570b3addac41e66a84024..d12f4027a27367ff32945b582f5d65173dcee039 100644 (file)
--- a/hw/omap.h
+++ b/hw/omap.h
@@ -96,8 +96,6 @@ target_phys_addr_t omap_l4_attach(struct omap_target_agent_s *ta, int region,
                 int iotype);
 target_phys_addr_t omap_l4_region_base(struct omap_target_agent_s *ta,
                                        int region);
-int l4_register_io_memory(CPUReadMemoryFunc * const *mem_read,
-                CPUWriteMemoryFunc * const *mem_write, void *opaque);
 
 /* OMAP2 SDRAM controller */
 struct omap_sdrc_s;
index e2998847f2a546e82c7c3fc632dc66a9a015fdfe..8a0fa73191974971c29c53296c5140c031748d5d 100644 (file)
@@ -784,8 +784,8 @@ static struct omap_sti_s *omap_sti_init(struct omap_target_agent_s *ta,
 
     s->chr = chr ?: qemu_chr_new("null", "null", NULL);
 
-    iomemtype = l4_register_io_memory(omap_sti_readfn,
-                    omap_sti_writefn, s);
+    iomemtype = cpu_register_io_memory(omap_sti_readfn,
+                    omap_sti_writefn, s, DEVICE_NATIVE_ENDIAN);
     omap_l4_attach(ta, 0, iomemtype);
 
     iomemtype = cpu_register_io_memory(omap_sti_fifo_readfn,
@@ -1798,8 +1798,8 @@ static struct omap_prcm_s *omap_prcm_init(struct omap_target_agent_s *ta,
     s->mpu = mpu;
     omap_prcm_coldreset(s);
 
-    iomemtype = l4_register_io_memory(omap_prcm_readfn,
-                    omap_prcm_writefn, s);
+    iomemtype = cpu_register_io_memory(omap_prcm_readfn,
+                    omap_prcm_writefn, s, DEVICE_NATIVE_ENDIAN);
     omap_l4_attach(ta, 0, iomemtype);
     omap_l4_attach(ta, 1, iomemtype);
 
@@ -2168,8 +2168,8 @@ static struct omap_sysctl_s *omap_sysctl_init(struct omap_target_agent_s *ta,
     s->mpu = mpu;
     omap_sysctl_reset(s);
 
-    iomemtype = l4_register_io_memory(omap_sysctl_readfn,
-                    omap_sysctl_writefn, s);
+    iomemtype = cpu_register_io_memory(omap_sysctl_readfn,
+                    omap_sysctl_writefn, s, DEVICE_NATIVE_ENDIAN);
     omap_l4_attach(ta, 0, iomemtype);
 
     return s;
index b4a8b4c45d4c207c23d4b5da105bac45cda2549e..b138c23d614fb4b243ee0a4abeee07193c2d60fe 100644 (file)
@@ -1037,14 +1037,14 @@ struct omap_dss_s *omap_dss_init(struct omap_target_agent_s *ta,
     s->drq = drq;
     omap_dss_reset(s);
 
-    iomemtype[0] = l4_register_io_memory(omap_diss1_readfn,
-                    omap_diss1_writefn, s);
-    iomemtype[1] = l4_register_io_memory(omap_disc1_readfn,
-                    omap_disc1_writefn, s);
-    iomemtype[2] = l4_register_io_memory(omap_rfbi1_readfn,
-                    omap_rfbi1_writefn, s);
-    iomemtype[3] = l4_register_io_memory(omap_venc1_readfn,
-                    omap_venc1_writefn, s);
+    iomemtype[0] = cpu_register_io_memory(omap_diss1_readfn,
+                    omap_diss1_writefn, s, DEVICE_NATIVE_ENDIAN);
+    iomemtype[1] = cpu_register_io_memory(omap_disc1_readfn,
+                    omap_disc1_writefn, s, DEVICE_NATIVE_ENDIAN);
+    iomemtype[2] = cpu_register_io_memory(omap_rfbi1_readfn,
+                    omap_rfbi1_writefn, s, DEVICE_NATIVE_ENDIAN);
+    iomemtype[3] = cpu_register_io_memory(omap_venc1_readfn,
+                    omap_venc1_writefn, s, DEVICE_NATIVE_ENDIAN);
     iomemtype[4] = cpu_register_io_memory(omap_im3_readfn,
                     omap_im3_writefn, s, DEVICE_NATIVE_ENDIAN);
     omap_l4_attach(ta, 0, iomemtype[0]);
index 704b000636db79d014c8124d2b94fefc7d35d665..c1cbdf8dcf624180550aa6743534a58fdfc0a60d 100644 (file)
@@ -476,8 +476,8 @@ struct omap_gp_timer_s *omap_gp_timer_init(struct omap_target_agent_s *ta,
     omap_gp_timer_reset(s);
     omap_gp_timer_clk_setup(s);
 
-    iomemtype = l4_register_io_memory(omap_gp_timer_readfn,
-                    omap_gp_timer_writefn, s);
+    iomemtype = cpu_register_io_memory(omap_gp_timer_readfn,
+                    omap_gp_timer_writefn, s, DEVICE_NATIVE_ENDIAN);
     omap_l4_attach(ta, 0, iomemtype);
 
     return s;
index 11577b1eecaecf12fe71253f705c579d8a61a247..52c38ba25dbfc0e17e99dd8b96ce6d120396b816 100644 (file)
@@ -457,8 +457,8 @@ struct omap_i2c_s *omap2_i2c_init(struct omap_target_agent_s *ta,
     s->bus = i2c_init_bus(NULL, "i2c");
     omap_i2c_reset(s);
 
-    iomemtype = l4_register_io_memory(omap_i2c_readfn,
-                    omap_i2c_writefn, s);
+    iomemtype = cpu_register_io_memory(omap_i2c_readfn,
+                    omap_i2c_writefn, s, DEVICE_NATIVE_ENDIAN);
     omap_l4_attach(ta, 0, iomemtype);
 
     return s;
index ebec8747a9d46d8ca9921609c568ca76f8e02bf9..a19ea702d6389828ec3c32d92a3cb401f2a2287f 100644 (file)
 #include "hw.h"
 #include "omap.h"
 
-int l4_register_io_memory(CPUReadMemoryFunc * const *mem_read,
-                          CPUWriteMemoryFunc * const *mem_write,
-                          void *opaque)
-{
-    return cpu_register_io_memory(mem_read, mem_write, opaque,
-                                  DEVICE_NATIVE_ENDIAN);
-}
-
 struct omap_l4_s {
     target_phys_addr_t base;
     int ta_num;
@@ -132,8 +124,8 @@ struct omap_target_agent_s *omap_l4ta_get(struct omap_l4_s *bus,
     ta->status = 0x00000000;
     ta->control = 0x00000200;  /* XXX 01000200 for L4TAO */
 
-    iomemtype = l4_register_io_memory(omap_l4ta_readfn,
-                    omap_l4ta_writefn, ta);
+    iomemtype = cpu_register_io_memory(omap_l4ta_readfn,
+                    omap_l4ta_writefn, ta, DEVICE_NATIVE_ENDIAN);
     ta->base = omap_l4_attach(ta, info->ta_region, iomemtype);
 
     return ta;
index a1afeb5c91975de1017e22a258dd88858d7523b0..b42cf904c272fefbd6944f000344b4cdb5a8ecb2 100644 (file)
@@ -612,8 +612,8 @@ struct omap_mmc_s *omap2_mmc_init(struct omap_target_agent_s *ta,
 
     omap_mmc_reset(s);
 
-    iomemtype = l4_register_io_memory(omap_mmc_readfn,
-                    omap_mmc_writefn, s);
+    iomemtype = cpu_register_io_memory(omap_mmc_readfn,
+                    omap_mmc_writefn, s, DEVICE_NATIVE_ENDIAN);
     omap_l4_attach(ta, 0, iomemtype);
 
     /* Instantiate the storage */
index 6030ad9551a4af8b5658367049abff7b3c894b2a..c20f425776f13bb3685c7394d14d8b64366f0f74 100644 (file)
@@ -327,8 +327,8 @@ struct omap_mcspi_s *omap_mcspi_init(struct omap_target_agent_s *ta, int chnum,
     }
     omap_mcspi_reset(s);
 
-    iomemtype = l4_register_io_memory(omap_mcspi_readfn,
-                    omap_mcspi_writefn, s);
+    iomemtype = cpu_register_io_memory(omap_mcspi_readfn,
+                    omap_mcspi_writefn, s, DEVICE_NATIVE_ENDIAN);
     omap_l4_attach(ta, 0, iomemtype);
 
     return s;
index b47ca881959c4f2b6395d548c7a3282973e4401c..ece53882f9ea12c56ffc6d8992fe93aa030e3a75 100644 (file)
@@ -89,8 +89,9 @@ struct omap_synctimer_s *omap_synctimer_init(struct omap_target_agent_s *ta,
     struct omap_synctimer_s *s = g_malloc0(sizeof(*s));
 
     omap_synctimer_reset(s);
-    omap_l4_attach(ta, 0, l4_register_io_memory(
-                      omap_synctimer_readfn, omap_synctimer_writefn, s));
+    omap_l4_attach(ta, 0, cpu_register_io_memory(
+                      omap_synctimer_readfn, omap_synctimer_writefn, s,
+                      DEVICE_NATIVE_ENDIAN));
 
     return s;
 }
index 1f18dddb225fff58732b11439bf20ac375ceb3f3..e6852889ba45d133f5dc5e88f1be1d6ac6268c4a 100644 (file)
@@ -107,6 +107,7 @@ static CPUWriteMemoryFunc * const omap_tap_writefn[] = {
 void omap_tap_init(struct omap_target_agent_s *ta,
                 struct omap_mpu_state_s *mpu)
 {
-    omap_l4_attach(ta, 0, l4_register_io_memory(
-                            omap_tap_readfn, omap_tap_writefn, mpu));
+    omap_l4_attach(ta, 0, cpu_register_io_memory(
+                            omap_tap_readfn, omap_tap_writefn, mpu,
+                            DEVICE_NATIVE_ENDIAN));
 }