]> git.proxmox.com Git - qemu.git/commit - hw/block/m25p80.c
m25p80.c: Use QOM classes for part differentiation
authorPeter Crosthwaite <peter.crosthwaite@xilinx.com>
Thu, 28 Feb 2013 18:23:15 +0000 (18:23 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 28 Feb 2013 18:49:24 +0000 (18:49 +0000)
commita7fd6915d84b20d5ff9ae287ddfabb9b222e7067
tree411b2f17349af1857137d3f44da6f2204095c7d4
parentb972b4e25340abdd23238bc8f3bdacbef533bd5a
m25p80.c: Use QOM classes for part differentiation

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 <peter.crosthwaite@xilinx.com>
Message-id: e24e156d-ff96-4901-997a-e31178b08bee@VA3EHSMHS021.ehs.local
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/m25p80.c
hw/petalogix_ml605_mmu.c
hw/xilinx_zynq.c