From c4f05c8cf715fa613e1985421080e62a7b169284 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Fri, 29 Jul 2011 16:35:18 +0100 Subject: lm832x: Take DeviceState pointer in lm832x_key_event() Since lm832x has been qdev'ified, its users will generally have a DeviceState pointer rather than an i2c_slave pointer, so adjust lm832x_key_event's prototype to suit. This allows the n810 (its only user) to actually pass a correct pointer to it rather than NULL. The effect is that we no longer segfault when a key is pressed. Signed-off-by: Peter Maydell Signed-off-by: Andrzej Zaborowski --- hw/lm832x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hw/lm832x.c') diff --git a/hw/lm832x.c b/hw/lm832x.c index 590a4cc..992ce49 100644 --- a/hw/lm832x.c +++ b/hw/lm832x.c @@ -474,9 +474,9 @@ static int lm8323_init(i2c_slave *i2c) return 0; } -void lm832x_key_event(struct i2c_slave *i2c, int key, int state) +void lm832x_key_event(DeviceState *dev, int key, int state) { - LM823KbdState *s = (LM823KbdState *) i2c; + LM823KbdState *s = FROM_I2C_SLAVE(LM823KbdState, I2C_SLAVE_FROM_QDEV(dev)); if ((s->status & INT_ERROR) && (s->error & ERR_FIFOOVR)) return; -- cgit v1.1