diff mbox series

[1/4] hw/lm32/milkymist: Un-inline milkymist_memcard_create()

Message ID 20200705211016.15241-2-f4bug@amsat.org
State New
Headers show
Series hw/sd/milkymist: Do not create SD card within the SDHCI controller | expand

Commit Message

Philippe Mathieu-Daudé July 5, 2020, 9:10 p.m. UTC
As we will modify milkymist_memcard_create(), move it first
to the source file where it is used.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/lm32/milkymist-hw.h | 11 -----------
 hw/lm32/milkymist.c    | 11 +++++++++++
 2 files changed, 11 insertions(+), 11 deletions(-)

Comments

Alistair Francis July 6, 2020, 4:17 p.m. UTC | #1
On Sun, Jul 5, 2020 at 2:13 PM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> As we will modify milkymist_memcard_create(), move it first
> to the source file where it is used.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  hw/lm32/milkymist-hw.h | 11 -----------
>  hw/lm32/milkymist.c    | 11 +++++++++++
>  2 files changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/hw/lm32/milkymist-hw.h b/hw/lm32/milkymist-hw.h
> index 05e2c2a5a7..5dca5d52f5 100644
> --- a/hw/lm32/milkymist-hw.h
> +++ b/hw/lm32/milkymist-hw.h
> @@ -31,17 +31,6 @@ static inline DeviceState *milkymist_hpdmc_create(hwaddr base)
>      return dev;
>  }
>
> -static inline DeviceState *milkymist_memcard_create(hwaddr base)
> -{
> -    DeviceState *dev;
> -
> -    dev = qdev_new("milkymist-memcard");
> -    sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
> -    sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
> -
> -    return dev;
> -}
> -
>  static inline DeviceState *milkymist_vgafb_create(hwaddr base,
>          uint32_t fb_offset, uint32_t fb_mask)
>  {
> diff --git a/hw/lm32/milkymist.c b/hw/lm32/milkymist.c
> index 85913bb68b..469e3c4322 100644
> --- a/hw/lm32/milkymist.c
> +++ b/hw/lm32/milkymist.c
> @@ -80,6 +80,17 @@ static void main_cpu_reset(void *opaque)
>      env->deba = reset_info->flash_base;
>  }
>
> +static DeviceState *milkymist_memcard_create(hwaddr base)
> +{
> +    DeviceState *dev;
> +
> +    dev = qdev_new("milkymist-memcard");
> +    sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
> +    sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
> +
> +    return dev;
> +}
> +
>  static void
>  milkymist_init(MachineState *machine)
>  {
> --
> 2.21.3
>
>
diff mbox series

Patch

diff --git a/hw/lm32/milkymist-hw.h b/hw/lm32/milkymist-hw.h
index 05e2c2a5a7..5dca5d52f5 100644
--- a/hw/lm32/milkymist-hw.h
+++ b/hw/lm32/milkymist-hw.h
@@ -31,17 +31,6 @@  static inline DeviceState *milkymist_hpdmc_create(hwaddr base)
     return dev;
 }
 
-static inline DeviceState *milkymist_memcard_create(hwaddr base)
-{
-    DeviceState *dev;
-
-    dev = qdev_new("milkymist-memcard");
-    sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
-    sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
-
-    return dev;
-}
-
 static inline DeviceState *milkymist_vgafb_create(hwaddr base,
         uint32_t fb_offset, uint32_t fb_mask)
 {
diff --git a/hw/lm32/milkymist.c b/hw/lm32/milkymist.c
index 85913bb68b..469e3c4322 100644
--- a/hw/lm32/milkymist.c
+++ b/hw/lm32/milkymist.c
@@ -80,6 +80,17 @@  static void main_cpu_reset(void *opaque)
     env->deba = reset_info->flash_base;
 }
 
+static DeviceState *milkymist_memcard_create(hwaddr base)
+{
+    DeviceState *dev;
+
+    dev = qdev_new("milkymist-memcard");
+    sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
+    sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
+
+    return dev;
+}
+
 static void
 milkymist_init(MachineState *machine)
 {