Commit e325e1f83e803922e5d33b47203d49e4ba2d5a0a
1 parent
0077147e
I2C cleanup
Signed-off-by: Paul Brook <paul@codesourcery.com>
Showing
2 changed files
with
0 additions
and
26 deletions
hw/i2c.c
| ... | ... | @@ -48,23 +48,6 @@ i2c_bus *i2c_init_bus(void) |
| 48 | 48 | return bus; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | -/* Create a new slave device. */ | |
| 52 | -i2c_slave *i2c_slave_init(i2c_bus *bus, int address, int size) | |
| 53 | -{ | |
| 54 | - i2c_slave *dev; | |
| 55 | - | |
| 56 | - if (size < sizeof(i2c_slave)) | |
| 57 | - hw_error("I2C struct too small"); | |
| 58 | - | |
| 59 | - dev = (i2c_slave *)qemu_mallocz(size); | |
| 60 | - dev->address = address; | |
| 61 | - dev->next = bus->dev; | |
| 62 | - bus->dev = dev; | |
| 63 | - dev->qdev.bus = bus; | |
| 64 | - | |
| 65 | - return dev; | |
| 66 | -} | |
| 67 | - | |
| 68 | 51 | void i2c_set_slave_address(i2c_slave *dev, int address) |
| 69 | 52 | { |
| 70 | 53 | dev->address = address; |
| ... | ... | @@ -165,10 +148,6 @@ static void i2c_slave_qdev_init(DeviceState *dev, void *opaque) |
| 165 | 148 | s->next = s->bus->dev; |
| 166 | 149 | s->bus->dev = s; |
| 167 | 150 | |
| 168 | - s->event = info->event; | |
| 169 | - s->recv = info->recv; | |
| 170 | - s->send = info->send; | |
| 171 | - | |
| 172 | 151 | info->init(s); |
| 173 | 152 | } |
| 174 | 153 | ... | ... |
hw/i2c.h
| ... | ... | @@ -36,10 +36,6 @@ struct i2c_slave |
| 36 | 36 | { |
| 37 | 37 | DeviceState qdev; |
| 38 | 38 | I2CSlaveInfo *info; |
| 39 | - /* FIXME: These 3 should go away once all devices have been converted. */ | |
| 40 | - i2c_event_cb event; | |
| 41 | - i2c_recv_cb recv; | |
| 42 | - i2c_send_cb send; | |
| 43 | 39 | |
| 44 | 40 | /* Remaining fields for internal use by the I2C code. */ |
| 45 | 41 | int address; |
| ... | ... | @@ -48,7 +44,6 @@ struct i2c_slave |
| 48 | 44 | }; |
| 49 | 45 | |
| 50 | 46 | i2c_bus *i2c_init_bus(void); |
| 51 | -i2c_slave *i2c_slave_init(i2c_bus *bus, int address, int size); | |
| 52 | 47 | void i2c_set_slave_address(i2c_slave *dev, int address); |
| 53 | 48 | int i2c_bus_busy(i2c_bus *bus); |
| 54 | 49 | int i2c_start_transfer(i2c_bus *bus, int address, int recv); | ... | ... |