aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio/radio-tea5764.c
diff options
context:
space:
mode:
authorShubhrajyoti D <shubhrajyoti@ti.com>2012-09-18 07:22:33 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-09-27 06:38:56 -0400
commit66ba9590c97abd69ea1340b90946363a6b1d33c3 (patch)
treefe108c0c5c9ac4733c8491aff226cfce643e6fb5 /drivers/media/radio/radio-tea5764.c
parent752d283a70a246140c67daf355f04136e2bf340f (diff)
[media] radio-tea5764: convert struct i2c_msg initialization to C99 format
Convert the struct i2c_msg initialization to C99 format. This makes maintaining and editing the code simpler. Also helps once other fields like transferred are added in future. Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/radio/radio-tea5764.c')
-rw-r--r--drivers/media/radio/radio-tea5764.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/media/radio/radio-tea5764.c b/drivers/media/radio/radio-tea5764.c
index efb05aa81d08..d0c905310071 100644
--- a/drivers/media/radio/radio-tea5764.c
+++ b/drivers/media/radio/radio-tea5764.c
@@ -151,8 +151,11 @@ int tea5764_i2c_read(struct tea5764_device *radio)
151 u16 *p = (u16 *) &radio->regs; 151 u16 *p = (u16 *) &radio->regs;
152 152
153 struct i2c_msg msgs[1] = { 153 struct i2c_msg msgs[1] = {
154 { radio->i2c_client->addr, I2C_M_RD, sizeof(radio->regs), 154 { .addr = radio->i2c_client->addr,
155 (void *)&radio->regs }, 155 .flags = I2C_M_RD,
156 .len = sizeof(radio->regs),
157 .buf = (void *)&radio->regs
158 },
156 }; 159 };
157 if (i2c_transfer(radio->i2c_client->adapter, msgs, 1) != 1) 160 if (i2c_transfer(radio->i2c_client->adapter, msgs, 1) != 1)
158 return -EIO; 161 return -EIO;
@@ -167,7 +170,11 @@ int tea5764_i2c_write(struct tea5764_device *radio)
167 struct tea5764_write_regs wr; 170 struct tea5764_write_regs wr;
168 struct tea5764_regs *r = &radio->regs; 171 struct tea5764_regs *r = &radio->regs;
169 struct i2c_msg msgs[1] = { 172 struct i2c_msg msgs[1] = {
170 { radio->i2c_client->addr, 0, sizeof(wr), (void *) &wr }, 173 {
174 .addr = radio->i2c_client->addr,
175 .len = sizeof(wr),
176 .buf = (void *)&wr
177 },
171 }; 178 };
172 wr.intreg = r->intreg & 0xff; 179 wr.intreg = r->intreg & 0xff;
173 wr.frqset = __cpu_to_be16(r->frqset); 180 wr.frqset = __cpu_to_be16(r->frqset);