OSDN Git Service

fdc: Fix inheritence for SUNW,fdtwo
authorAndreas Färber <afaerber@suse.de>
Fri, 26 Jul 2013 23:55:26 +0000 (01:55 +0200)
committerAndreas Färber <afaerber@suse.de>
Mon, 29 Jul 2013 18:41:13 +0000 (20:41 +0200)
commit19d46d711d93cb3a37dada945cb3410278b94bc3
treeb0d2dd52d14154a9c0a577dcb8cd204d0a679fb1
parenteddbf0ab9db8385d7cb57e23891c1d41488b303e
fdc: Fix inheritence for SUNW,fdtwo

Since commit dd3be7420774f7dc8f37a96ca24d07f0b6f31b3b SUNW,fdtwo's
initfn (realizefn since 940194c2369e50d91d1abf6f36d43853eea5e539)
was using SYSBUS_FDC() cast. This uses type sysbus-fdc rather than
SUNW,fdtwo.

Fix this by letting SUNW,fdtwo and sysbus-fdc both inherit from an
abstract type base-sysbus-fdc.

This allows to consolidate realizefns by using instance_init functions.
Clean up variable names and variable order while at it.

Reported-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: Hu Tao <hutao@cn.fujitsu.com>
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Andreas Färber <afaerber@suse.de>
hw/block/fdc.c