diff mbox series

[5/7] floppy: move cmos_get_fd_drive_type

Message ID 20210804142737.3366441-6-kraxel@redhat.com
State New
Headers show
Series floppy: build as modules. | expand

Commit Message

Gerd Hoffmann Aug. 4, 2021, 2:27 p.m. UTC
Needed by pc machine init.

Move to separate source file so we can keep it in core qemu
when building floppy as module.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/block/fdc-isa.c    | 25 -------------------------
 hw/block/fdc-module.c | 25 +++++++++++++++++++++++++
 2 files changed, 25 insertions(+), 25 deletions(-)
diff mbox series

Patch

diff --git a/hw/block/fdc-isa.c b/hw/block/fdc-isa.c
index 36c246efa822..a5a124fb9236 100644
--- a/hw/block/fdc-isa.c
+++ b/hw/block/fdc-isa.c
@@ -162,31 +162,6 @@  static Aml *build_fdinfo_aml(int idx, FloppyDriveType type)
     return dev;
 }
 
-int cmos_get_fd_drive_type(FloppyDriveType fd0)
-{
-    int val;
-
-    switch (fd0) {
-    case FLOPPY_DRIVE_TYPE_144:
-        /* 1.44 Mb 3"5 drive */
-        val = 4;
-        break;
-    case FLOPPY_DRIVE_TYPE_288:
-        /* 2.88 Mb 3"5 drive */
-        val = 5;
-        break;
-    case FLOPPY_DRIVE_TYPE_120:
-        /* 1.2 Mb 5"5 drive */
-        val = 2;
-        break;
-    case FLOPPY_DRIVE_TYPE_NONE:
-    default:
-        val = 0;
-        break;
-    }
-    return val;
-}
-
 static void fdc_isa_build_aml(ISADevice *isadev, Aml *scope)
 {
     Aml *dev;
diff --git a/hw/block/fdc-module.c b/hw/block/fdc-module.c
index 3682b5c1ebd1..7e2aaf86a0c0 100644
--- a/hw/block/fdc-module.c
+++ b/hw/block/fdc-module.c
@@ -98,3 +98,28 @@  FloppyDriveType isa_fdc_get_drive_type(ISADevice *fdc, int i)
 
     return isa->state.drives[i].drive;
 }
+
+int cmos_get_fd_drive_type(FloppyDriveType fd0)
+{
+    int val;
+
+    switch (fd0) {
+    case FLOPPY_DRIVE_TYPE_144:
+        /* 1.44 Mb 3"5 drive */
+        val = 4;
+        break;
+    case FLOPPY_DRIVE_TYPE_288:
+        /* 2.88 Mb 3"5 drive */
+        val = 5;
+        break;
+    case FLOPPY_DRIVE_TYPE_120:
+        /* 1.2 Mb 5"5 drive */
+        val = 2;
+        break;
+    case FLOPPY_DRIVE_TYPE_NONE:
+    default:
+        val = 0;
+        break;
+    }
+    return val;
+}