pflash: make TYPE_CFI_PFLASH0{1,2} macros public
authorEfimov Vasily <real@ispras.ru>
Wed, 22 Jun 2016 12:24:48 +0000 (15:24 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 29 Jun 2016 12:03:46 +0000 (14:03 +0200)
qdev API can be used to create CFI pflash devices despite existance of helper
functions. The type name is needed in course of such creation. Using the
preprocessor alias instead of the string literal itself is preferable.

The patch makes the aliases accessible through the header.

Signed-off-by: Efimov Vasily <real@ispras.ru>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/block/pflash_cfi01.c
hw/block/pflash_cfi02.c
include/hw/block/flash.h

index 31585e3aa16ffb70af7bb18cb8b084a642102df6..62d7a5661d45c33995d7805fa1454faff38c43ed 100644 (file)
@@ -65,7 +65,6 @@ do {                                                        \
 #define DPRINTF(fmt, ...) do { } while (0)
 #endif
 
-#define TYPE_CFI_PFLASH01 "cfi.pflash01"
 #define CFI_PFLASH01(obj) OBJECT_CHECK(pflash_t, (obj), TYPE_CFI_PFLASH01)
 
 #define PFLASH_BE          0
index 5f106102c54f5448985b5d3311325732a8306249..4f6105cc58b25b14d5779cf3f3d67f3b2986b464 100644 (file)
@@ -57,7 +57,6 @@ do {                                                       \
 
 #define PFLASH_LAZY_ROMD_THRESHOLD 42
 
-#define TYPE_CFI_PFLASH02 "cfi.pflash02"
 #define CFI_PFLASH02(obj) OBJECT_CHECK(pflash_t, (obj), TYPE_CFI_PFLASH02)
 
 struct pflash_t {
index 50ccbbcf135249b7d109842370321d6c0b1dd2fa..a088baa4e4a844ac235d60dfaa1e2d79e33001ac 100644 (file)
@@ -5,6 +5,9 @@
 
 #include "exec/memory.h"
 
+#define TYPE_CFI_PFLASH01 "cfi.pflash01"
+#define TYPE_CFI_PFLASH02 "cfi.pflash02"
+
 typedef struct pflash_t pflash_t;
 
 /* pflash_cfi01.c */