summary refs log tree commit diff stats
path: root/hw/timer/ds1338.c
diff options
context:
space:
mode:
authorAlastair D'Silva <alastair@d-silva.org>2016-12-27 14:59:29 +0000
committerPeter Maydell <peter.maydell@linaro.org>2016-12-27 14:59:29 +0000
commit9e41bade85ef338afd983c109368d1bbbe931f80 (patch)
tree2356fb69bf69a56f9b21f05945dc368f7c137284 /hw/timer/ds1338.c
parent8e953a658fa13b05bea67899a91d8b65f2b89f11 (diff)
downloadfocaccia-qemu-9e41bade85ef338afd983c109368d1bbbe931f80.tar.gz
focaccia-qemu-9e41bade85ef338afd983c109368d1bbbe931f80.zip
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>
Diffstat (limited to 'hw/timer/ds1338.c')
-rw-r--r--hw/timer/ds1338.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/hw/timer/ds1338.c b/hw/timer/ds1338.c
index 0112949e23..f5d04dd5d7 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;