diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-06-15 16:52:24 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-20 06:21:59 -0400 |
commit | 18245e18eeae15e928b46c1ae0f3a19bdc50419d (patch) | |
tree | ad4944cb0d154e737ab979d4010240f66275e291 /drivers/media/dvb/siano/smsdvb.c | |
parent | ca78373687bddcd436e1bf2d9b6806cfd9cad8b8 (diff) |
V4L/DVB (8286): sms1xxx: remove typedefs
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/siano/smsdvb.c')
-rw-r--r-- | drivers/media/dvb/siano/smsdvb.c | 70 |
1 files changed, 38 insertions, 32 deletions
diff --git a/drivers/media/dvb/siano/smsdvb.c b/drivers/media/dvb/siano/smsdvb.c index 65b1db61ac15..b17696fcbbc6 100644 --- a/drivers/media/dvb/siano/smsdvb.c +++ b/drivers/media/dvb/siano/smsdvb.c | |||
@@ -29,15 +29,16 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); | |||
29 | struct list_head g_smsdvb_clients; | 29 | struct list_head g_smsdvb_clients; |
30 | kmutex_t g_smsdvb_clientslock; | 30 | kmutex_t g_smsdvb_clientslock; |
31 | 31 | ||
32 | int smsdvb_onresponse(void *context, smscore_buffer_t *cb) | 32 | int smsdvb_onresponse(void *context, struct smscore_buffer_t *cb) |
33 | { | 33 | { |
34 | smsdvb_client_t *client = (smsdvb_client_t *) context; | 34 | struct smsdvb_client_t *client = (struct smsdvb_client_t *) context; |
35 | SmsMsgHdr_ST *phdr = (SmsMsgHdr_ST *)(((u8 *) cb->p) + cb->offset); | 35 | struct SmsMsgHdr_ST *phdr = |
36 | (struct SmsMsgHdr_ST *)(((u8 *) cb->p) + cb->offset); | ||
36 | 37 | ||
37 | switch (phdr->msgType) { | 38 | switch (phdr->msgType) { |
38 | case MSG_SMS_DVBT_BDA_DATA: | 39 | case MSG_SMS_DVBT_BDA_DATA: |
39 | dvb_dmx_swfilter(&client->demux, (u8 *)(phdr + 1), | 40 | dvb_dmx_swfilter(&client->demux, (u8 *)(phdr + 1), |
40 | cb->size - sizeof(SmsMsgHdr_ST)); | 41 | cb->size - sizeof(struct SmsMsgHdr_ST)); |
41 | break; | 42 | break; |
42 | 43 | ||
43 | case MSG_SMS_RF_TUNE_RES: | 44 | case MSG_SMS_RF_TUNE_RES: |
@@ -46,8 +47,8 @@ int smsdvb_onresponse(void *context, smscore_buffer_t *cb) | |||
46 | 47 | ||
47 | case MSG_SMS_GET_STATISTICS_RES: | 48 | case MSG_SMS_GET_STATISTICS_RES: |
48 | { | 49 | { |
49 | SmsMsgStatisticsInfo_ST *p = | 50 | struct SmsMsgStatisticsInfo_ST *p = |
50 | (SmsMsgStatisticsInfo_ST *)(phdr + 1); | 51 | (struct SmsMsgStatisticsInfo_ST *)(phdr + 1); |
51 | 52 | ||
52 | if (p->Stat.IsDemodLocked) { | 53 | if (p->Stat.IsDemodLocked) { |
53 | client->fe_status = FE_HAS_SIGNAL | | 54 | client->fe_status = FE_HAS_SIGNAL | |
@@ -82,7 +83,7 @@ int smsdvb_onresponse(void *context, smscore_buffer_t *cb) | |||
82 | return 0; | 83 | return 0; |
83 | } | 84 | } |
84 | 85 | ||
85 | void smsdvb_unregister_client(smsdvb_client_t *client) | 86 | void smsdvb_unregister_client(struct smsdvb_client_t *client) |
86 | { | 87 | { |
87 | /* must be called under clientslock */ | 88 | /* must be called under clientslock */ |
88 | 89 | ||
@@ -100,16 +101,16 @@ void smsdvb_onremove(void *context) | |||
100 | { | 101 | { |
101 | kmutex_lock(&g_smsdvb_clientslock); | 102 | kmutex_lock(&g_smsdvb_clientslock); |
102 | 103 | ||
103 | smsdvb_unregister_client((smsdvb_client_t *) context); | 104 | smsdvb_unregister_client((struct smsdvb_client_t *) context); |
104 | 105 | ||
105 | kmutex_unlock(&g_smsdvb_clientslock); | 106 | kmutex_unlock(&g_smsdvb_clientslock); |
106 | } | 107 | } |
107 | 108 | ||
108 | static int smsdvb_start_feed(struct dvb_demux_feed *feed) | 109 | static int smsdvb_start_feed(struct dvb_demux_feed *feed) |
109 | { | 110 | { |
110 | smsdvb_client_t *client = | 111 | struct smsdvb_client_t *client = |
111 | container_of(feed->demux, smsdvb_client_t, demux); | 112 | container_of(feed->demux, struct smsdvb_client_t, demux); |
112 | SmsMsgData_ST PidMsg; | 113 | struct SmsMsgData_ST PidMsg; |
113 | 114 | ||
114 | printk(KERN_DEBUG "%s add pid %d(%x)\n", __func__, | 115 | printk(KERN_DEBUG "%s add pid %d(%x)\n", __func__, |
115 | feed->pid, feed->pid); | 116 | feed->pid, feed->pid); |
@@ -127,9 +128,9 @@ static int smsdvb_start_feed(struct dvb_demux_feed *feed) | |||
127 | 128 | ||
128 | static int smsdvb_stop_feed(struct dvb_demux_feed *feed) | 129 | static int smsdvb_stop_feed(struct dvb_demux_feed *feed) |
129 | { | 130 | { |
130 | smsdvb_client_t *client = | 131 | struct smsdvb_client_t *client = |
131 | container_of(feed->demux, smsdvb_client_t, demux); | 132 | container_of(feed->demux, struct smsdvb_client_t, demux); |
132 | SmsMsgData_ST PidMsg; | 133 | struct SmsMsgData_ST PidMsg; |
133 | 134 | ||
134 | printk(KERN_DEBUG "%s remove pid %d(%x)\n", __func__, | 135 | printk(KERN_DEBUG "%s remove pid %d(%x)\n", __func__, |
135 | feed->pid, feed->pid); | 136 | feed->pid, feed->pid); |
@@ -145,7 +146,7 @@ static int smsdvb_stop_feed(struct dvb_demux_feed *feed) | |||
145 | &PidMsg, sizeof(PidMsg)); | 146 | &PidMsg, sizeof(PidMsg)); |
146 | } | 147 | } |
147 | 148 | ||
148 | static int smsdvb_sendrequest_and_wait(smsdvb_client_t *client, | 149 | static int smsdvb_sendrequest_and_wait(struct smsdvb_client_t *client, |
149 | void *buffer, size_t size, | 150 | void *buffer, size_t size, |
150 | struct completion *completion) | 151 | struct completion *completion) |
151 | { | 152 | { |
@@ -158,18 +159,19 @@ static int smsdvb_sendrequest_and_wait(smsdvb_client_t *client, | |||
158 | 0 : -ETIME; | 159 | 0 : -ETIME; |
159 | } | 160 | } |
160 | 161 | ||
161 | static int smsdvb_send_statistics_request(smsdvb_client_t *client) | 162 | static int smsdvb_send_statistics_request(struct smsdvb_client_t *client) |
162 | { | 163 | { |
163 | SmsMsgHdr_ST Msg = { MSG_SMS_GET_STATISTICS_REQ, | 164 | struct SmsMsgHdr_ST Msg = { MSG_SMS_GET_STATISTICS_REQ, |
164 | DVBT_BDA_CONTROL_MSG_ID, | 165 | DVBT_BDA_CONTROL_MSG_ID, |
165 | HIF_TASK, sizeof(SmsMsgHdr_ST), 0 }; | 166 | HIF_TASK, sizeof(struct SmsMsgHdr_ST), 0 }; |
166 | return smsdvb_sendrequest_and_wait(client, &Msg, sizeof(Msg), | 167 | return smsdvb_sendrequest_and_wait(client, &Msg, sizeof(Msg), |
167 | &client->stat_done); | 168 | &client->stat_done); |
168 | } | 169 | } |
169 | 170 | ||
170 | static int smsdvb_read_status(struct dvb_frontend *fe, fe_status_t *stat) | 171 | static int smsdvb_read_status(struct dvb_frontend *fe, fe_status_t *stat) |
171 | { | 172 | { |
172 | smsdvb_client_t *client = container_of(fe, smsdvb_client_t, frontend); | 173 | struct smsdvb_client_t *client = |
174 | container_of(fe, struct smsdvb_client_t, frontend); | ||
173 | int rc = smsdvb_send_statistics_request(client); | 175 | int rc = smsdvb_send_statistics_request(client); |
174 | 176 | ||
175 | if (!rc) | 177 | if (!rc) |
@@ -180,7 +182,8 @@ static int smsdvb_read_status(struct dvb_frontend *fe, fe_status_t *stat) | |||
180 | 182 | ||
181 | static int smsdvb_read_ber(struct dvb_frontend *fe, u32 *ber) | 183 | static int smsdvb_read_ber(struct dvb_frontend *fe, u32 *ber) |
182 | { | 184 | { |
183 | smsdvb_client_t *client = container_of(fe, smsdvb_client_t, frontend); | 185 | struct smsdvb_client_t *client = |
186 | container_of(fe, struct smsdvb_client_t, frontend); | ||
184 | int rc = smsdvb_send_statistics_request(client); | 187 | int rc = smsdvb_send_statistics_request(client); |
185 | 188 | ||
186 | if (!rc) | 189 | if (!rc) |
@@ -191,7 +194,8 @@ static int smsdvb_read_ber(struct dvb_frontend *fe, u32 *ber) | |||
191 | 194 | ||
192 | static int smsdvb_read_signal_strength(struct dvb_frontend *fe, u16 *strength) | 195 | static int smsdvb_read_signal_strength(struct dvb_frontend *fe, u16 *strength) |
193 | { | 196 | { |
194 | smsdvb_client_t *client = container_of(fe, smsdvb_client_t, frontend); | 197 | struct smsdvb_client_t *client = |
198 | container_of(fe, struct smsdvb_client_t, frontend); | ||
195 | int rc = smsdvb_send_statistics_request(client); | 199 | int rc = smsdvb_send_statistics_request(client); |
196 | 200 | ||
197 | if (!rc) | 201 | if (!rc) |
@@ -202,7 +206,8 @@ static int smsdvb_read_signal_strength(struct dvb_frontend *fe, u16 *strength) | |||
202 | 206 | ||
203 | static int smsdvb_read_snr(struct dvb_frontend *fe, u16 *snr) | 207 | static int smsdvb_read_snr(struct dvb_frontend *fe, u16 *snr) |
204 | { | 208 | { |
205 | smsdvb_client_t *client = container_of(fe, smsdvb_client_t, frontend); | 209 | struct smsdvb_client_t *client = |
210 | container_of(fe, struct smsdvb_client_t, frontend); | ||
206 | int rc = smsdvb_send_statistics_request(client); | 211 | int rc = smsdvb_send_statistics_request(client); |
207 | 212 | ||
208 | if (!rc) | 213 | if (!rc) |
@@ -225,11 +230,11 @@ static int smsdvb_get_tune_settings(struct dvb_frontend *fe, | |||
225 | static int smsdvb_set_frontend(struct dvb_frontend *fe, | 230 | static int smsdvb_set_frontend(struct dvb_frontend *fe, |
226 | struct dvb_frontend_parameters *fep) | 231 | struct dvb_frontend_parameters *fep) |
227 | { | 232 | { |
228 | smsdvb_client_t *client = container_of(fe, smsdvb_client_t, frontend); | 233 | struct smsdvb_client_t *client = |
234 | container_of(fe, struct smsdvb_client_t, frontend); | ||
229 | 235 | ||
230 | struct | 236 | struct { |
231 | { | 237 | struct SmsMsgHdr_ST Msg; |
232 | SmsMsgHdr_ST Msg; | ||
233 | u32 Data[3]; | 238 | u32 Data[3]; |
234 | } Msg; | 239 | } Msg; |
235 | 240 | ||
@@ -259,7 +264,8 @@ static int smsdvb_set_frontend(struct dvb_frontend *fe, | |||
259 | static int smsdvb_get_frontend(struct dvb_frontend *fe, | 264 | static int smsdvb_get_frontend(struct dvb_frontend *fe, |
260 | struct dvb_frontend_parameters *fep) | 265 | struct dvb_frontend_parameters *fep) |
261 | { | 266 | { |
262 | smsdvb_client_t *client = container_of(fe, smsdvb_client_t, frontend); | 267 | struct smsdvb_client_t *client = |
268 | container_of(fe, struct smsdvb_client_t, frontend); | ||
263 | 269 | ||
264 | printk(KERN_DEBUG "%s\n", __func__); | 270 | printk(KERN_DEBUG "%s\n", __func__); |
265 | 271 | ||
@@ -303,11 +309,11 @@ static struct dvb_frontend_ops smsdvb_fe_ops = { | |||
303 | .read_snr = smsdvb_read_snr, | 309 | .read_snr = smsdvb_read_snr, |
304 | }; | 310 | }; |
305 | 311 | ||
306 | int smsdvb_hotplug(smscore_device_t *coredev, | 312 | int smsdvb_hotplug(struct smscore_device_t *coredev, |
307 | struct device *device, int arrival) | 313 | struct device *device, int arrival) |
308 | { | 314 | { |
309 | smsclient_params_t params; | 315 | struct smsclient_params_t params; |
310 | smsdvb_client_t *client; | 316 | struct smsdvb_client_t *client; |
311 | int rc; | 317 | int rc; |
312 | 318 | ||
313 | /* device removal handled by onremove callback */ | 319 | /* device removal handled by onremove callback */ |
@@ -320,7 +326,7 @@ int smsdvb_hotplug(smscore_device_t *coredev, | |||
320 | return 0; | 326 | return 0; |
321 | } | 327 | } |
322 | 328 | ||
323 | client = kzalloc(sizeof(smsdvb_client_t), GFP_KERNEL); | 329 | client = kzalloc(sizeof(struct smsdvb_client_t), GFP_KERNEL); |
324 | if (!client) { | 330 | if (!client) { |
325 | printk(KERN_INFO "%s kmalloc() failed\n", __func__); | 331 | printk(KERN_INFO "%s kmalloc() failed\n", __func__); |
326 | return -ENOMEM; | 332 | return -ENOMEM; |
@@ -439,7 +445,7 @@ void smsdvb_unregister(void) | |||
439 | 445 | ||
440 | while (!list_empty(&g_smsdvb_clients)) | 446 | while (!list_empty(&g_smsdvb_clients)) |
441 | smsdvb_unregister_client( | 447 | smsdvb_unregister_client( |
442 | (smsdvb_client_t *) g_smsdvb_clients.next); | 448 | (struct smsdvb_client_t *) g_smsdvb_clients.next); |
443 | 449 | ||
444 | kmutex_unlock(&g_smsdvb_clientslock); | 450 | kmutex_unlock(&g_smsdvb_clientslock); |
445 | } | 451 | } |