Commit d3151521ab5da56bddfb1733baaf7ed4976e1c76

Authored by Paul Brook
1 parent f3bc5238

Follow coding conventions.

More structure renaming.

Signed-off-by: Paul Brook <paul@codesourcery.com>
Showing 1 changed file with 6 additions and 6 deletions
hw/tosa.c
@@ -124,15 +124,15 @@ static void tosa_ssp_write(void *opaque, uint32_t value) @@ -124,15 +124,15 @@ static void tosa_ssp_write(void *opaque, uint32_t value)
124 fprintf(stderr, "TG: %d %02x\n", value >> 5, value & 0x1f); 124 fprintf(stderr, "TG: %d %02x\n", value >> 5, value & 0x1f);
125 } 125 }
126 126
127 -struct tosa_dac_i2c { 127 +typedef struct {
128 i2c_slave i2c; 128 i2c_slave i2c;
129 int len; 129 int len;
130 char buf[3]; 130 char buf[3];
131 -}; 131 +} TosaDACState;
132 132
133 static int tosa_dac_send(i2c_slave *i2c, uint8_t data) 133 static int tosa_dac_send(i2c_slave *i2c, uint8_t data)
134 { 134 {
135 - struct tosa_dac_i2c *s = (struct tosa_dac_i2c *)i2c; 135 + TosaDACState *s = (TosaDACState *)i2c;
136 s->buf[s->len] = data; 136 s->buf[s->len] = data;
137 if (s->len ++ > 2) { 137 if (s->len ++ > 2) {
138 #ifdef VERBOSE 138 #ifdef VERBOSE
@@ -151,7 +151,7 @@ static int tosa_dac_send(i2c_slave *i2c, uint8_t data) @@ -151,7 +151,7 @@ static int tosa_dac_send(i2c_slave *i2c, uint8_t data)
151 151
152 static void tosa_dac_event(i2c_slave *i2c, enum i2c_event event) 152 static void tosa_dac_event(i2c_slave *i2c, enum i2c_event event)
153 { 153 {
154 - struct tosa_dac_i2c *s = (struct tosa_dac_i2c *)i2c; 154 + TosaDACState *s = (TosaDACState *)i2c;
155 s->len = 0; 155 s->len = 0;
156 switch (event) { 156 switch (event) {
157 case I2C_START_SEND: 157 case I2C_START_SEND:
@@ -180,8 +180,8 @@ static int tosa_dac_recv(i2c_slave *s) @@ -180,8 +180,8 @@ static int tosa_dac_recv(i2c_slave *s)
180 180
181 static void tosa_tg_init(PXA2xxState *cpu) 181 static void tosa_tg_init(PXA2xxState *cpu)
182 { 182 {
183 - struct i2c_bus *bus = pxa2xx_i2c_bus(cpu->i2c[0]);  
184 - struct i2c_slave *dac = i2c_slave_init(bus, 0, sizeof(struct tosa_dac_i2c)); 183 + i2c_bus *bus = pxa2xx_i2c_bus(cpu->i2c[0]);
  184 + i2c_slave *dac = i2c_slave_init(bus, 0, sizeof(TosaDACState));
185 dac->send = tosa_dac_send; 185 dac->send = tosa_dac_send;
186 dac->event = tosa_dac_event; 186 dac->event = tosa_dac_event;
187 dac->recv = tosa_dac_recv; 187 dac->recv = tosa_dac_recv;