mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 10:13:56 -06:00
hw/i2c: Add a NULL check for i2c slave init callbacks
Add a NULL check for i2c slave init callbacks, so that we no longer need to implement empty init functions. Signed-off-by: Alastair D'Silva <alastair@d-silva.org> Message-id: 20161202054617.6749-4-alastair@au1.ibm.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> [PMM: squashed in later tweak from Alistair to if() phrasing] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
8e953a658f
commit
9e41bade85
5 changed files with 5 additions and 28 deletions
|
@ -1449,17 +1449,10 @@ static const VMStateDescription vmstate_pxa2xx_i2c = {
|
|||
}
|
||||
};
|
||||
|
||||
static int pxa2xx_i2c_slave_init(I2CSlave *i2c)
|
||||
{
|
||||
/* Nothing to do. */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void pxa2xx_i2c_slave_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
I2CSlaveClass *k = I2C_SLAVE_CLASS(klass);
|
||||
|
||||
k->init = pxa2xx_i2c_slave_init;
|
||||
k->event = pxa2xx_i2c_event;
|
||||
k->recv = pxa2xx_i2c_rx;
|
||||
k->send = pxa2xx_i2c_tx;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue