mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
qdev: move name+size into DeviceInfo (v2)
Rationale: move device information from code to data structures. v2: Adapt the drivers missed in the first version. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
57b452a848
commit
074f2fff79
27 changed files with 95 additions and 61 deletions
|
@ -252,6 +252,8 @@ static void tosapda_machine_init(void)
|
|||
machine_init(tosapda_machine_init);
|
||||
|
||||
static I2CSlaveInfo tosa_dac_info = {
|
||||
.qdev.name = "tosa_dac",
|
||||
.qdev.size = sizeof(TosaDACState),
|
||||
.init = tosa_dac_init,
|
||||
.event = tosa_dac_event,
|
||||
.recv = tosa_dac_recv,
|
||||
|
@ -259,14 +261,16 @@ static I2CSlaveInfo tosa_dac_info = {
|
|||
};
|
||||
|
||||
static SSISlaveInfo tosa_ssp_info = {
|
||||
.qdev.name = "tosa-ssp",
|
||||
.qdev.size = sizeof(SSISlave),
|
||||
.init = tosa_ssp_init,
|
||||
.transfer = tosa_ssp_tansfer
|
||||
};
|
||||
|
||||
static void tosa_register_devices(void)
|
||||
{
|
||||
i2c_register_slave("tosa_dac", sizeof(TosaDACState), &tosa_dac_info);
|
||||
ssi_register_slave("tosa-ssp", sizeof(SSISlave), &tosa_ssp_info);
|
||||
i2c_register_slave(&tosa_dac_info);
|
||||
ssi_register_slave(&tosa_ssp_info);
|
||||
}
|
||||
|
||||
device_init(tosa_register_devices)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue