summaryrefslogtreecommitdiff
path: root/hw/arm/virt.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2019-03-08 10:46:00 +0100
committerMarkus Armbruster <armbru@redhat.com>2019-03-11 22:53:44 +0100
commit81c7db723ebd0c677784a728020c7e8845868daf (patch)
tree3094bc659ad728fb889bcbe308244771dec573a4 /hw/arm/virt.c
parente7b6274197c5f096860014ca750544d6aca0b9b9 (diff)
downloadqemu-81c7db723ebd0c677784a728020c7e8845868daf.zip
hw: Use PFLASH_CFI0{1,2} and TYPE_PFLASH_CFI0{1,2}
We have two open-coded copies of macro PFLASH_CFI01(). Move the macro to the header, so we can ditch the copies. Move PFLASH_CFI02() to the header for symmetry. We define macros TYPE_PFLASH_CFI01 and TYPE_PFLASH_CFI02 for type name strings, then mostly use the strings. If the macros are worth defining, they are worth using. Replace the strings by the macros. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20190308094610.21210-6-armbru@redhat.com>
Diffstat (limited to 'hw/arm/virt.c')
-rw-r--r--hw/arm/virt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 7f66ddad89..1e8485ff7c 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -35,6 +35,7 @@
#include "hw/arm/arm.h"
#include "hw/arm/primecell.h"
#include "hw/arm/virt.h"
+#include "hw/block/flash.h"
#include "hw/vfio/vfio-calxeda-xgmac.h"
#include "hw/vfio/vfio-amd-xgbe.h"
#include "hw/display/ramfb.h"
@@ -878,7 +879,7 @@ static void create_one_flash(const char *name, hwaddr flashbase,
* parameters as the flash devices on the Versatile Express board.
*/
DriveInfo *dinfo = drive_get_next(IF_PFLASH);
- DeviceState *dev = qdev_create(NULL, "cfi.pflash01");
+ DeviceState *dev = qdev_create(NULL, TYPE_PFLASH_CFI01);
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
const uint64_t sectorlength = 256 * 1024;