From a7fd6915d84b20d5ff9ae287ddfabb9b222e7067 Mon Sep 17 00:00:00 2001 From: Peter Crosthwaite Date: Thu, 28 Feb 2013 18:23:15 +0000 Subject: m25p80.c: Use QOM classes for part differentiation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, M25P80 uses an object property to differentiate between flash parts. Changed this over to use QOM sub-classes - the actual names of the different parts are used to create a set of dynamic classes which passes the part info as class data. The object no longer needs to search the known_devices table for itself, instead it just gets its info from its own class. Kept the intermediate class definition private to m25p80.c for the moment, as the expectation is parts will only be added as new entries in the table. We can factor out the TYPE_M25P80 abstraction into a header on a demand basis. Signed-off-by: Peter Crosthwaite Message-id: e24e156d-ff96-4901-997a-e31178b08bee@VA3EHSMHS021.ehs.local Reviewed-by: Andreas Färber Signed-off-by: Peter Maydell --- hw/xilinx_zynq.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'hw/xilinx_zynq.c') diff --git a/hw/xilinx_zynq.c b/hw/xilinx_zynq.c index 39d9fb3e73..2f67d90ee1 100644 --- a/hw/xilinx_zynq.c +++ b/hw/xilinx_zynq.c @@ -82,8 +82,7 @@ static inline void zynq_init_spi_flashes(uint32_t base_addr, qemu_irq irq, spi = (SSIBus *)qdev_get_child_bus(dev, bus_name); for (j = 0; j < num_ss; ++j) { - flash_dev = ssi_create_slave_no_init(spi, "m25p80"); - qdev_prop_set_string(flash_dev, "partname", "n25q128"); + flash_dev = ssi_create_slave_no_init(spi, "n25q128"); qdev_init_nofail(flash_dev); cs_line = qdev_get_gpio_in(flash_dev, 0); -- cgit v1.2.1