diff options
Diffstat (limited to 'hw/gpio/pca9554.c')
-rw-r--r-- | hw/gpio/pca9554.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/hw/gpio/pca9554.c b/hw/gpio/pca9554.c index 7d10a64..de3f883 100644 --- a/hw/gpio/pca9554.c +++ b/hw/gpio/pca9554.c @@ -118,11 +118,8 @@ static void pca9554_write(PCA9554State *s, uint8_t reg, uint8_t data) static uint8_t pca9554_recv(I2CSlave *i2c) { PCA9554State *s = PCA9554(i2c); - uint8_t ret; - ret = pca9554_read(s, s->pointer & 0x3); - - return ret; + return pca9554_read(s, s->pointer & 0x3); } static int pca9554_send(I2CSlave *i2c, uint8_t data) @@ -291,12 +288,11 @@ static void pca9554_realize(DeviceState *dev, Error **errp) qdev_init_gpio_in(dev, pca9554_gpio_in_handler, PCA9554_PIN_COUNT); } -static Property pca9554_properties[] = { +static const Property pca9554_properties[] = { DEFINE_PROP_STRING("description", PCA9554State, description), - DEFINE_PROP_END_OF_LIST(), }; -static void pca9554_class_init(ObjectClass *klass, void *data) +static void pca9554_class_init(ObjectClass *klass, const void *data) { DeviceClass *dc = DEVICE_CLASS(klass); I2CSlaveClass *k = I2C_SLAVE_CLASS(klass); @@ -305,7 +301,7 @@ static void pca9554_class_init(ObjectClass *klass, void *data) k->recv = pca9554_recv; k->send = pca9554_send; dc->realize = pca9554_realize; - dc->reset = pca9554_reset; + device_class_set_legacy_reset(dc, pca9554_reset); dc->vmsd = &pca9554_vmstate; device_class_set_props(dc, pca9554_properties); } |