From 9e41bade85ef338afd983c109368d1bbbe931f80 Mon Sep 17 00:00:00 2001 From: Alastair D'Silva Date: Tue, 27 Dec 2016 14:59:29 +0000 Subject: 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 Message-id: 20161202054617.6749-4-alastair@au1.ibm.com Reviewed-by: Peter Maydell [PMM: squashed in later tweak from Alistair to if() phrasing] Signed-off-by: Peter Maydell --- hw/timer/ds1338.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'hw/timer') diff --git a/hw/timer/ds1338.c b/hw/timer/ds1338.c index 0112949..f5d04dd 100644 --- a/hw/timer/ds1338.c +++ b/hw/timer/ds1338.c @@ -198,11 +198,6 @@ static int ds1338_send(I2CSlave *i2c, uint8_t data) return 0; } -static int ds1338_init(I2CSlave *i2c) -{ - return 0; -} - static void ds1338_reset(DeviceState *dev) { DS1338State *s = DS1338(dev); @@ -220,7 +215,6 @@ static void ds1338_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); I2CSlaveClass *k = I2C_SLAVE_CLASS(klass); - k->init = ds1338_init; k->event = ds1338_event; k->recv = ds1338_recv; k->send = ds1338_send; -- cgit v1.1