aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-frontends
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2012-10-11 14:07:19 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-10-11 14:07:19 -0400
commitbf3b202b41999f88f091632f13842b7234bd58b7 (patch)
treee2861fcca522cc299e6106fa6c78d85a4a6eedeb /drivers/media/dvb-frontends
parent782cd9ee985b1523f1ddad57657a24d7855d9e4d (diff)
parent1fdead8ad31d3aa833bc37739273fcde89ace93c (diff)
Merge branch 'staging/for_v3.7' into v4l_for_linus
Applied on the top of changeset 782cd9e, as some of those patches depend on some fixes that went via -arm tree. * staging/for_v3.7: (109 commits) [media] m5mols: Add missing #include <linux/sizes.h> [media] stk1160: Add support for S-Video input Revert "[media] omap3isp: Replace cpu_is_omap3630() with ISP revision check" [media] dvb: LNA implementation changes [media] v4l2-ioctl: fix W=1 warnings [media] v4l2-ioctl: add blocks check for VIDIOC_SUBDEV_G/S_EDID [media] omap3isp: Fix compilation error in ispreg.h [media] rc-msi-digivox-ii: Add full scan keycodes [media] cx25821: testing the wrong variable [media] tda18271-common: hold the I2C adapter during write transfers [media] ds3000: add module parameter to force firmware upload [media] drivers/media: Remove unnecessary semicolon [media] winbond: remove space from driver name [media] iguanair: cannot send data from the stack [media] omap3isp: Replace cpu_is_omap3630() with ISP revision check [media] dvb-usb: print small buffers via %*ph [media] uvc: Add return code check at vb2_queue_init() [media] em28xx: Replace memcpy with struct assignment [media] bt8xx: Add video4linux control V4L2_CID_COLOR_KILLER [media] mem2mem_testdev: Use devm_kzalloc() in probe ...
Diffstat (limited to 'drivers/media/dvb-frontends')
-rw-r--r--drivers/media/dvb-frontends/a8293.c2
-rw-r--r--drivers/media/dvb-frontends/af9013.c6
-rw-r--r--drivers/media/dvb-frontends/af9033.c16
-rw-r--r--drivers/media/dvb-frontends/bcm3510.c2
-rw-r--r--drivers/media/dvb-frontends/cx24110.c6
-rw-r--r--drivers/media/dvb-frontends/cxd2820r_core.c3
-rw-r--r--drivers/media/dvb-frontends/drxd_hard.c2
-rw-r--r--drivers/media/dvb-frontends/ds3000.c12
-rw-r--r--drivers/media/dvb-frontends/dvb_dummy_fe.c21
-rw-r--r--drivers/media/dvb-frontends/isl6405.c2
-rw-r--r--drivers/media/dvb-frontends/isl6421.c2
-rw-r--r--drivers/media/dvb-frontends/itd1000.c2
-rw-r--r--drivers/media/dvb-frontends/lg2160.c8
-rw-r--r--drivers/media/dvb-frontends/lnbp21.c4
-rw-r--r--drivers/media/dvb-frontends/lnbp22.c2
-rw-r--r--drivers/media/dvb-frontends/s5h1432.c8
-rw-r--r--drivers/media/dvb-frontends/s921.c9
-rw-r--r--drivers/media/dvb-frontends/si21xx.c4
-rw-r--r--drivers/media/dvb-frontends/sp8870.c6
-rw-r--r--drivers/media/dvb-frontends/sp887x.c6
-rw-r--r--drivers/media/dvb-frontends/stb6100.c8
-rw-r--r--drivers/media/dvb-frontends/stv0299.c6
-rw-r--r--drivers/media/dvb-frontends/stv0900_core.c4
-rw-r--r--drivers/media/dvb-frontends/tda665x.c8
-rw-r--r--drivers/media/dvb-frontends/tda8083.c4
25 files changed, 66 insertions, 87 deletions
diff --git a/drivers/media/dvb-frontends/a8293.c b/drivers/media/dvb-frontends/a8293.c
index cff44a389b40..74fbb5d58bed 100644
--- a/drivers/media/dvb-frontends/a8293.c
+++ b/drivers/media/dvb-frontends/a8293.c
@@ -90,7 +90,7 @@ static int a8293_set_voltage(struct dvb_frontend *fe,
90 default: 90 default:
91 ret = -EINVAL; 91 ret = -EINVAL;
92 goto err; 92 goto err;
93 }; 93 }
94 94
95 ret = a8293_wr(priv, &priv->reg[0], 1); 95 ret = a8293_wr(priv, &priv->reg[0], 1);
96 if (ret) 96 if (ret)
diff --git a/drivers/media/dvb-frontends/af9013.c b/drivers/media/dvb-frontends/af9013.c
index e9f04a36577b..a204f2828820 100644
--- a/drivers/media/dvb-frontends/af9013.c
+++ b/drivers/media/dvb-frontends/af9013.c
@@ -241,7 +241,7 @@ static int af9013_set_gpio(struct af9013_state *state, u8 gpio, u8 gpioval)
241 KBUILD_MODNAME, gpio); 241 KBUILD_MODNAME, gpio);
242 ret = -EINVAL; 242 ret = -EINVAL;
243 goto err; 243 goto err;
244 }; 244 }
245 245
246 switch (gpio) { 246 switch (gpio) {
247 case 0: 247 case 0:
@@ -253,7 +253,7 @@ static int af9013_set_gpio(struct af9013_state *state, u8 gpio, u8 gpioval)
253 default: 253 default:
254 pos = 4; 254 pos = 4;
255 break; 255 break;
256 }; 256 }
257 257
258 ret = af9013_wr_reg_bits(state, addr, pos, 4, gpioval); 258 ret = af9013_wr_reg_bits(state, addr, pos, 4, gpioval);
259 if (ret) 259 if (ret)
@@ -726,7 +726,7 @@ static int af9013_set_frontend(struct dvb_frontend *fe)
726 default: 726 default:
727 dev_dbg(&state->i2c->dev, "%s: invalid hierarchy\n", __func__); 727 dev_dbg(&state->i2c->dev, "%s: invalid hierarchy\n", __func__);
728 auto_mode = 1; 728 auto_mode = 1;
729 }; 729 }
730 730
731 switch (c->modulation) { 731 switch (c->modulation) {
732 case QAM_AUTO: 732 case QAM_AUTO:
diff --git a/drivers/media/dvb-frontends/af9033.c b/drivers/media/dvb-frontends/af9033.c
index 8162d939c4b2..464ad878490b 100644
--- a/drivers/media/dvb-frontends/af9033.c
+++ b/drivers/media/dvb-frontends/af9033.c
@@ -408,7 +408,7 @@ static int af9033_set_frontend(struct dvb_frontend *fe)
408{ 408{
409 struct af9033_state *state = fe->demodulator_priv; 409 struct af9033_state *state = fe->demodulator_priv;
410 struct dtv_frontend_properties *c = &fe->dtv_property_cache; 410 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
411 int ret, i, spec_inv; 411 int ret, i, spec_inv, sampling_freq;
412 u8 tmp, buf[3], bandwidth_reg_val; 412 u8 tmp, buf[3], bandwidth_reg_val;
413 u32 if_frequency, freq_cw, adc_freq; 413 u32 if_frequency, freq_cw, adc_freq;
414 414
@@ -465,18 +465,20 @@ static int af9033_set_frontend(struct dvb_frontend *fe)
465 else 465 else
466 if_frequency = 0; 466 if_frequency = 0;
467 467
468 while (if_frequency > (adc_freq / 2)) 468 sampling_freq = if_frequency;
469 if_frequency -= adc_freq;
470 469
471 if (if_frequency >= 0) 470 while (sampling_freq > (adc_freq / 2))
471 sampling_freq -= adc_freq;
472
473 if (sampling_freq >= 0)
472 spec_inv *= -1; 474 spec_inv *= -1;
473 else 475 else
474 if_frequency *= -1; 476 sampling_freq *= -1;
475 477
476 freq_cw = af9033_div(state, if_frequency, adc_freq, 23ul); 478 freq_cw = af9033_div(state, sampling_freq, adc_freq, 23ul);
477 479
478 if (spec_inv == -1) 480 if (spec_inv == -1)
479 freq_cw *= -1; 481 freq_cw = 0x800000 - freq_cw;
480 482
481 /* get adc multiplies */ 483 /* get adc multiplies */
482 ret = af9033_rd_reg(state, 0x800045, &tmp); 484 ret = af9033_rd_reg(state, 0x800045, &tmp);
diff --git a/drivers/media/dvb-frontends/bcm3510.c b/drivers/media/dvb-frontends/bcm3510.c
index 033cd7ad3ca2..1b77909c0c71 100644
--- a/drivers/media/dvb-frontends/bcm3510.c
+++ b/drivers/media/dvb-frontends/bcm3510.c
@@ -527,7 +527,7 @@ static int bcm3510_set_frontend(struct dvb_frontend *fe)
527 cmd.ACQUIRE1.IF_FREQ = 0x0; 527 cmd.ACQUIRE1.IF_FREQ = 0x0;
528 default: 528 default:
529 return -EINVAL; 529 return -EINVAL;
530 }; 530 }
531 cmd.ACQUIRE0.OFFSET = 0; 531 cmd.ACQUIRE0.OFFSET = 0;
532 cmd.ACQUIRE0.NTSCSWEEP = 1; 532 cmd.ACQUIRE0.NTSCSWEEP = 1;
533 cmd.ACQUIRE0.FA = 1; 533 cmd.ACQUIRE0.FA = 1;
diff --git a/drivers/media/dvb-frontends/cx24110.c b/drivers/media/dvb-frontends/cx24110.c
index 3180f5b2a6a6..0cd6927e654c 100644
--- a/drivers/media/dvb-frontends/cx24110.c
+++ b/drivers/media/dvb-frontends/cx24110.c
@@ -218,7 +218,7 @@ static int cx24110_set_fec (struct cx24110_state* state, fe_code_rate_t fec)
218 } else 218 } else
219 return -EOPNOTSUPP; 219 return -EOPNOTSUPP;
220/* fixme (low): which is the correct return code? */ 220/* fixme (low): which is the correct return code? */
221 }; 221 }
222 return 0; 222 return 0;
223} 223}
224 224
@@ -275,7 +275,7 @@ static int cx24110_set_symbolrate (struct cx24110_state* state, u32 srate)
275 cx24110_writereg(state,0x07,tmp|0x3); 275 cx24110_writereg(state,0x07,tmp|0x3);
276 cx24110_writereg(state,0x06,0x78); 276 cx24110_writereg(state,0x06,0x78);
277 fclk=90999000UL; 277 fclk=90999000UL;
278 }; 278 }
279 dprintk("cx24110 debug: fclk %d Hz\n",fclk); 279 dprintk("cx24110 debug: fclk %d Hz\n",fclk);
280 /* we need to divide two integers with approx. 27 bits in 32 bit 280 /* we need to divide two integers with approx. 27 bits in 32 bit
281 arithmetic giving a 25 bit result */ 281 arithmetic giving a 25 bit result */
@@ -362,7 +362,7 @@ static int cx24110_initfe(struct dvb_frontend* fe)
362 362
363 for(i = 0; i < ARRAY_SIZE(cx24110_regdata); i++) { 363 for(i = 0; i < ARRAY_SIZE(cx24110_regdata); i++) {
364 cx24110_writereg(state, cx24110_regdata[i].reg, cx24110_regdata[i].data); 364 cx24110_writereg(state, cx24110_regdata[i].reg, cx24110_regdata[i].data);
365 }; 365 }
366 366
367 return 0; 367 return 0;
368} 368}
diff --git a/drivers/media/dvb-frontends/cxd2820r_core.c b/drivers/media/dvb-frontends/cxd2820r_core.c
index 42648643693e..9b658c1cf39a 100644
--- a/drivers/media/dvb-frontends/cxd2820r_core.c
+++ b/drivers/media/dvb-frontends/cxd2820r_core.c
@@ -688,7 +688,7 @@ struct dvb_frontend *cxd2820r_attach(const struct cxd2820r_config *cfg,
688{ 688{
689 struct cxd2820r_priv *priv; 689 struct cxd2820r_priv *priv;
690 int ret; 690 int ret;
691 u8 tmp, gpio[GPIO_COUNT]; 691 u8 tmp;
692 692
693 priv = kzalloc(sizeof(struct cxd2820r_priv), GFP_KERNEL); 693 priv = kzalloc(sizeof(struct cxd2820r_priv), GFP_KERNEL);
694 if (!priv) { 694 if (!priv) {
@@ -735,6 +735,7 @@ struct dvb_frontend *cxd2820r_attach(const struct cxd2820r_config *cfg,
735 * Use static GPIO configuration if GPIOLIB is undefined. 735 * Use static GPIO configuration if GPIOLIB is undefined.
736 * This is fallback condition. 736 * This is fallback condition.
737 */ 737 */
738 u8 gpio[GPIO_COUNT];
738 gpio[0] = (*gpio_chip_base >> 0) & 0x07; 739 gpio[0] = (*gpio_chip_base >> 0) & 0x07;
739 gpio[1] = (*gpio_chip_base >> 3) & 0x07; 740 gpio[1] = (*gpio_chip_base >> 3) & 0x07;
740 gpio[2] = 0; 741 gpio[2] = 0;
diff --git a/drivers/media/dvb-frontends/drxd_hard.c b/drivers/media/dvb-frontends/drxd_hard.c
index f380eb43e9d5..6d9853750d2b 100644
--- a/drivers/media/dvb-frontends/drxd_hard.c
+++ b/drivers/media/dvb-frontends/drxd_hard.c
@@ -991,7 +991,7 @@ static int HI_Command(struct drxd_state *state, u16 cmd, u16 * pResult)
991 if (nrRetries > DRXD_MAX_RETRIES) { 991 if (nrRetries > DRXD_MAX_RETRIES) {
992 status = -1; 992 status = -1;
993 break; 993 break;
994 }; 994 }
995 status = Read16(state, HI_RA_RAM_SRV_CMD__A, &waitCmd, 0); 995 status = Read16(state, HI_RA_RAM_SRV_CMD__A, &waitCmd, 0);
996 } while (waitCmd != 0); 996 } while (waitCmd != 0);
997 997
diff --git a/drivers/media/dvb-frontends/ds3000.c b/drivers/media/dvb-frontends/ds3000.c
index 4c8ac2657c4a..5b639087ce45 100644
--- a/drivers/media/dvb-frontends/ds3000.c
+++ b/drivers/media/dvb-frontends/ds3000.c
@@ -30,6 +30,7 @@
30#include "ds3000.h" 30#include "ds3000.h"
31 31
32static int debug; 32static int debug;
33static int force_fw_upload;
33 34
34#define dprintk(args...) \ 35#define dprintk(args...) \
35 do { \ 36 do { \
@@ -392,11 +393,13 @@ static int ds3000_firmware_ondemand(struct dvb_frontend *fe)
392 393
393 dprintk("%s()\n", __func__); 394 dprintk("%s()\n", __func__);
394 395
395 if (ds3000_readreg(state, 0xb2) <= 0) 396 ret = ds3000_readreg(state, 0xb2);
397 if (ret < 0)
396 return ret; 398 return ret;
397 399
398 if (state->skip_fw_load) 400 if (state->skip_fw_load || !force_fw_upload)
399 return 0; 401 return 0; /* Firmware already uploaded, skipping */
402
400 /* Load firmware */ 403 /* Load firmware */
401 /* request the firmware, this will block until someone uploads it */ 404 /* request the firmware, this will block until someone uploads it */
402 printk(KERN_INFO "%s: Waiting for firmware upload (%s)...\n", __func__, 405 printk(KERN_INFO "%s: Waiting for firmware upload (%s)...\n", __func__,
@@ -1306,6 +1309,9 @@ static struct dvb_frontend_ops ds3000_ops = {
1306module_param(debug, int, 0644); 1309module_param(debug, int, 0644);
1307MODULE_PARM_DESC(debug, "Activates frontend debugging (default:0)"); 1310MODULE_PARM_DESC(debug, "Activates frontend debugging (default:0)");
1308 1311
1312module_param(force_fw_upload, int, 0644);
1313MODULE_PARM_DESC(force_fw_upload, "Force firmware upload (default:0)");
1314
1309MODULE_DESCRIPTION("DVB Frontend module for Montage Technology " 1315MODULE_DESCRIPTION("DVB Frontend module for Montage Technology "
1310 "DS3000/TS2020 hardware"); 1316 "DS3000/TS2020 hardware");
1311MODULE_AUTHOR("Konstantin Dimitrov"); 1317MODULE_AUTHOR("Konstantin Dimitrov");
diff --git a/drivers/media/dvb-frontends/dvb_dummy_fe.c b/drivers/media/dvb-frontends/dvb_dummy_fe.c
index dcfc902c8678..d5acc304786b 100644
--- a/drivers/media/dvb-frontends/dvb_dummy_fe.c
+++ b/drivers/media/dvb-frontends/dvb_dummy_fe.c
@@ -121,16 +121,13 @@ struct dvb_frontend* dvb_dummy_fe_ofdm_attach(void)
121 121
122 /* allocate memory for the internal state */ 122 /* allocate memory for the internal state */
123 state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL); 123 state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL);
124 if (state == NULL) goto error; 124 if (!state)
125 return NULL;
125 126
126 /* create dvb_frontend */ 127 /* create dvb_frontend */
127 memcpy(&state->frontend.ops, &dvb_dummy_fe_ofdm_ops, sizeof(struct dvb_frontend_ops)); 128 memcpy(&state->frontend.ops, &dvb_dummy_fe_ofdm_ops, sizeof(struct dvb_frontend_ops));
128 state->frontend.demodulator_priv = state; 129 state->frontend.demodulator_priv = state;
129 return &state->frontend; 130 return &state->frontend;
130
131error:
132 kfree(state);
133 return NULL;
134} 131}
135 132
136static struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops; 133static struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops;
@@ -141,16 +138,13 @@ struct dvb_frontend *dvb_dummy_fe_qpsk_attach(void)
141 138
142 /* allocate memory for the internal state */ 139 /* allocate memory for the internal state */
143 state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL); 140 state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL);
144 if (state == NULL) goto error; 141 if (!state)
142 return NULL;
145 143
146 /* create dvb_frontend */ 144 /* create dvb_frontend */
147 memcpy(&state->frontend.ops, &dvb_dummy_fe_qpsk_ops, sizeof(struct dvb_frontend_ops)); 145 memcpy(&state->frontend.ops, &dvb_dummy_fe_qpsk_ops, sizeof(struct dvb_frontend_ops));
148 state->frontend.demodulator_priv = state; 146 state->frontend.demodulator_priv = state;
149 return &state->frontend; 147 return &state->frontend;
150
151error:
152 kfree(state);
153 return NULL;
154} 148}
155 149
156static struct dvb_frontend_ops dvb_dummy_fe_qam_ops; 150static struct dvb_frontend_ops dvb_dummy_fe_qam_ops;
@@ -161,16 +155,13 @@ struct dvb_frontend *dvb_dummy_fe_qam_attach(void)
161 155
162 /* allocate memory for the internal state */ 156 /* allocate memory for the internal state */
163 state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL); 157 state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL);
164 if (state == NULL) goto error; 158 if (!state)
159 return NULL;
165 160
166 /* create dvb_frontend */ 161 /* create dvb_frontend */
167 memcpy(&state->frontend.ops, &dvb_dummy_fe_qam_ops, sizeof(struct dvb_frontend_ops)); 162 memcpy(&state->frontend.ops, &dvb_dummy_fe_qam_ops, sizeof(struct dvb_frontend_ops));
168 state->frontend.demodulator_priv = state; 163 state->frontend.demodulator_priv = state;
169 return &state->frontend; 164 return &state->frontend;
170
171error:
172 kfree(state);
173 return NULL;
174} 165}
175 166
176static struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops = { 167static struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops = {
diff --git a/drivers/media/dvb-frontends/isl6405.c b/drivers/media/dvb-frontends/isl6405.c
index 33d33f4d8867..0c642a5bf823 100644
--- a/drivers/media/dvb-frontends/isl6405.c
+++ b/drivers/media/dvb-frontends/isl6405.c
@@ -77,7 +77,7 @@ static int isl6405_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage
77 break; 77 break;
78 default: 78 default:
79 return -EINVAL; 79 return -EINVAL;
80 }; 80 }
81 } 81 }
82 isl6405->config |= isl6405->override_or; 82 isl6405->config |= isl6405->override_or;
83 isl6405->config &= isl6405->override_and; 83 isl6405->config &= isl6405->override_and;
diff --git a/drivers/media/dvb-frontends/isl6421.c b/drivers/media/dvb-frontends/isl6421.c
index 684c8ec166cb..0cb3f0f74c9c 100644
--- a/drivers/media/dvb-frontends/isl6421.c
+++ b/drivers/media/dvb-frontends/isl6421.c
@@ -63,7 +63,7 @@ static int isl6421_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage
63 break; 63 break;
64 default: 64 default:
65 return -EINVAL; 65 return -EINVAL;
66 }; 66 }
67 67
68 isl6421->config |= isl6421->override_or; 68 isl6421->config |= isl6421->override_or;
69 isl6421->config &= isl6421->override_and; 69 isl6421->config &= isl6421->override_and;
diff --git a/drivers/media/dvb-frontends/itd1000.c b/drivers/media/dvb-frontends/itd1000.c
index 316457584fe7..c1c3400b2173 100644
--- a/drivers/media/dvb-frontends/itd1000.c
+++ b/drivers/media/dvb-frontends/itd1000.c
@@ -231,7 +231,7 @@ static void itd1000_set_lo(struct itd1000_state *state, u32 freq_khz)
231 state->frequency = ((plln * 1000) + (pllf * 1000)/1048576) * 2*FREF; 231 state->frequency = ((plln * 1000) + (pllf * 1000)/1048576) * 2*FREF;
232 itd_dbg("frequency: %dkHz (wanted) %dkHz (set), PLLF = %d, PLLN = %d\n", freq_khz, state->frequency, pllf, plln); 232 itd_dbg("frequency: %dkHz (wanted) %dkHz (set), PLLF = %d, PLLN = %d\n", freq_khz, state->frequency, pllf, plln);
233 233
234 itd1000_write_reg(state, PLLNH, 0x80); /* PLLNH */; 234 itd1000_write_reg(state, PLLNH, 0x80); /* PLLNH */
235 itd1000_write_reg(state, PLLNL, plln & 0xff); 235 itd1000_write_reg(state, PLLNL, plln & 0xff);
236 itd1000_write_reg(state, PLLFH, (itd1000_read_reg(state, PLLFH) & 0xf0) | ((pllf >> 16) & 0x0f)); 236 itd1000_write_reg(state, PLLFH, (itd1000_read_reg(state, PLLFH) & 0xf0) | ((pllf >> 16) & 0x0f));
237 itd1000_write_reg(state, PLLFM, (pllf >> 8) & 0xff); 237 itd1000_write_reg(state, PLLFM, (pllf >> 8) & 0xff);
diff --git a/drivers/media/dvb-frontends/lg2160.c b/drivers/media/dvb-frontends/lg2160.c
index cc11260e99df..5fd14f840ab0 100644
--- a/drivers/media/dvb-frontends/lg2160.c
+++ b/drivers/media/dvb-frontends/lg2160.c
@@ -1421,8 +1421,8 @@ struct dvb_frontend *lg2160_attach(const struct lg2160_config *config,
1421 config ? config->i2c_addr : 0); 1421 config ? config->i2c_addr : 0);
1422 1422
1423 state = kzalloc(sizeof(struct lg216x_state), GFP_KERNEL); 1423 state = kzalloc(sizeof(struct lg216x_state), GFP_KERNEL);
1424 if (state == NULL) 1424 if (!state)
1425 goto fail; 1425 return NULL;
1426 1426
1427 state->cfg = config; 1427 state->cfg = config;
1428 state->i2c_adap = i2c_adap; 1428 state->i2c_adap = i2c_adap;
@@ -1449,10 +1449,6 @@ struct dvb_frontend *lg2160_attach(const struct lg2160_config *config,
1449 state->frontend.dtv_property_cache.atscmh_parade_id = 1; 1449 state->frontend.dtv_property_cache.atscmh_parade_id = 1;
1450 1450
1451 return &state->frontend; 1451 return &state->frontend;
1452fail:
1453 lg_warn("unable to detect LG216x hardware\n");
1454 kfree(state);
1455 return NULL;
1456} 1452}
1457EXPORT_SYMBOL(lg2160_attach); 1453EXPORT_SYMBOL(lg2160_attach);
1458 1454
diff --git a/drivers/media/dvb-frontends/lnbp21.c b/drivers/media/dvb-frontends/lnbp21.c
index 13437259eeac..f3ba7b5faa2e 100644
--- a/drivers/media/dvb-frontends/lnbp21.c
+++ b/drivers/media/dvb-frontends/lnbp21.c
@@ -65,7 +65,7 @@ static int lnbp21_set_voltage(struct dvb_frontend *fe,
65 break; 65 break;
66 default: 66 default:
67 return -EINVAL; 67 return -EINVAL;
68 }; 68 }
69 69
70 lnbp21->config |= lnbp21->override_or; 70 lnbp21->config |= lnbp21->override_or;
71 lnbp21->config &= lnbp21->override_and; 71 lnbp21->config &= lnbp21->override_and;
@@ -108,7 +108,7 @@ static int lnbp21_set_tone(struct dvb_frontend *fe,
108 break; 108 break;
109 default: 109 default:
110 return -EINVAL; 110 return -EINVAL;
111 }; 111 }
112 112
113 lnbp21->config |= lnbp21->override_or; 113 lnbp21->config |= lnbp21->override_or;
114 lnbp21->config &= lnbp21->override_and; 114 lnbp21->config &= lnbp21->override_and;
diff --git a/drivers/media/dvb-frontends/lnbp22.c b/drivers/media/dvb-frontends/lnbp22.c
index 84ad0390a4a1..c463da7f6dcc 100644
--- a/drivers/media/dvb-frontends/lnbp22.c
+++ b/drivers/media/dvb-frontends/lnbp22.c
@@ -73,7 +73,7 @@ static int lnbp22_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
73 break; 73 break;
74 default: 74 default:
75 return -EINVAL; 75 return -EINVAL;
76 }; 76 }
77 77
78 dprintk(1, "%s: 0x%02x)\n", __func__, lnbp22->config[3]); 78 dprintk(1, "%s: 0x%02x)\n", __func__, lnbp22->config[3]);
79 return (i2c_transfer(lnbp22->i2c, &msg, 1) == 1) ? 0 : -EIO; 79 return (i2c_transfer(lnbp22->i2c, &msg, 1) == 1) ? 0 : -EIO;
diff --git a/drivers/media/dvb-frontends/s5h1432.c b/drivers/media/dvb-frontends/s5h1432.c
index 8352ce1c9556..6ec16a243741 100644
--- a/drivers/media/dvb-frontends/s5h1432.c
+++ b/drivers/media/dvb-frontends/s5h1432.c
@@ -351,8 +351,8 @@ struct dvb_frontend *s5h1432_attach(const struct s5h1432_config *config,
351 printk(KERN_INFO " Enter s5h1432_attach(). attach success!\n"); 351 printk(KERN_INFO " Enter s5h1432_attach(). attach success!\n");
352 /* allocate memory for the internal state */ 352 /* allocate memory for the internal state */
353 state = kmalloc(sizeof(struct s5h1432_state), GFP_KERNEL); 353 state = kmalloc(sizeof(struct s5h1432_state), GFP_KERNEL);
354 if (state == NULL) 354 if (!state)
355 goto error; 355 return NULL;
356 356
357 /* setup the state */ 357 /* setup the state */
358 state->config = config; 358 state->config = config;
@@ -367,10 +367,6 @@ struct dvb_frontend *s5h1432_attach(const struct s5h1432_config *config,
367 state->frontend.demodulator_priv = state; 367 state->frontend.demodulator_priv = state;
368 368
369 return &state->frontend; 369 return &state->frontend;
370
371error:
372 kfree(state);
373 return NULL;
374} 370}
375EXPORT_SYMBOL(s5h1432_attach); 371EXPORT_SYMBOL(s5h1432_attach);
376 372
diff --git a/drivers/media/dvb-frontends/s921.c b/drivers/media/dvb-frontends/s921.c
index cd2288c07147..a271ac3eaec0 100644
--- a/drivers/media/dvb-frontends/s921.c
+++ b/drivers/media/dvb-frontends/s921.c
@@ -487,9 +487,9 @@ struct dvb_frontend *s921_attach(const struct s921_config *config,
487 kzalloc(sizeof(struct s921_state), GFP_KERNEL); 487 kzalloc(sizeof(struct s921_state), GFP_KERNEL);
488 488
489 dprintk("\n"); 489 dprintk("\n");
490 if (state == NULL) { 490 if (!state) {
491 rc("Unable to kzalloc\n"); 491 rc("Unable to kzalloc\n");
492 goto rcor; 492 return NULL;
493 } 493 }
494 494
495 /* setup the state */ 495 /* setup the state */
@@ -502,11 +502,6 @@ struct dvb_frontend *s921_attach(const struct s921_config *config,
502 state->frontend.demodulator_priv = state; 502 state->frontend.demodulator_priv = state;
503 503
504 return &state->frontend; 504 return &state->frontend;
505
506rcor:
507 kfree(state);
508
509 return NULL;
510} 505}
511EXPORT_SYMBOL(s921_attach); 506EXPORT_SYMBOL(s921_attach);
512 507
diff --git a/drivers/media/dvb-frontends/si21xx.c b/drivers/media/dvb-frontends/si21xx.c
index a68a64800df7..73b47cc6a13b 100644
--- a/drivers/media/dvb-frontends/si21xx.c
+++ b/drivers/media/dvb-frontends/si21xx.c
@@ -343,7 +343,7 @@ static int si21xx_wait_diseqc_idle(struct si21xx_state *state, int timeout)
343 return -ETIMEDOUT; 343 return -ETIMEDOUT;
344 } 344 }
345 msleep(10); 345 msleep(10);
346 }; 346 }
347 347
348 return 0; 348 return 0;
349} 349}
@@ -472,7 +472,7 @@ static int si21xx_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t volt)
472 break; 472 break;
473 default: 473 default:
474 return -EINVAL; 474 return -EINVAL;
475 }; 475 }
476} 476}
477 477
478static int si21xx_init(struct dvb_frontend *fe) 478static int si21xx_init(struct dvb_frontend *fe)
diff --git a/drivers/media/dvb-frontends/sp8870.c b/drivers/media/dvb-frontends/sp8870.c
index e37274c8f14e..2aa8ef76eba2 100644
--- a/drivers/media/dvb-frontends/sp8870.c
+++ b/drivers/media/dvb-frontends/sp8870.c
@@ -188,7 +188,7 @@ static int configure_reg0xc05 (struct dtv_frontend_properties *p, u16 *reg0xc05)
188 break; 188 break;
189 default: 189 default:
190 return -EINVAL; 190 return -EINVAL;
191 }; 191 }
192 192
193 switch (p->hierarchy) { 193 switch (p->hierarchy) {
194 case HIERARCHY_NONE: 194 case HIERARCHY_NONE:
@@ -207,7 +207,7 @@ static int configure_reg0xc05 (struct dtv_frontend_properties *p, u16 *reg0xc05)
207 break; 207 break;
208 default: 208 default:
209 return -EINVAL; 209 return -EINVAL;
210 }; 210 }
211 211
212 switch (p->code_rate_HP) { 212 switch (p->code_rate_HP) {
213 case FEC_1_2: 213 case FEC_1_2:
@@ -229,7 +229,7 @@ static int configure_reg0xc05 (struct dtv_frontend_properties *p, u16 *reg0xc05)
229 break; 229 break;
230 default: 230 default:
231 return -EINVAL; 231 return -EINVAL;
232 }; 232 }
233 233
234 if (known_parameters) 234 if (known_parameters)
235 *reg0xc05 |= (2 << 1); /* use specified parameters */ 235 *reg0xc05 |= (2 << 1); /* use specified parameters */
diff --git a/drivers/media/dvb-frontends/sp887x.c b/drivers/media/dvb-frontends/sp887x.c
index f4096ccb226e..1bb81b5ae6e0 100644
--- a/drivers/media/dvb-frontends/sp887x.c
+++ b/drivers/media/dvb-frontends/sp887x.c
@@ -229,7 +229,7 @@ static int configure_reg0xc05(struct dtv_frontend_properties *p, u16 *reg0xc05)
229 break; 229 break;
230 default: 230 default:
231 return -EINVAL; 231 return -EINVAL;
232 }; 232 }
233 233
234 switch (p->hierarchy) { 234 switch (p->hierarchy) {
235 case HIERARCHY_NONE: 235 case HIERARCHY_NONE:
@@ -248,7 +248,7 @@ static int configure_reg0xc05(struct dtv_frontend_properties *p, u16 *reg0xc05)
248 break; 248 break;
249 default: 249 default:
250 return -EINVAL; 250 return -EINVAL;
251 }; 251 }
252 252
253 switch (p->code_rate_HP) { 253 switch (p->code_rate_HP) {
254 case FEC_1_2: 254 case FEC_1_2:
@@ -270,7 +270,7 @@ static int configure_reg0xc05(struct dtv_frontend_properties *p, u16 *reg0xc05)
270 break; 270 break;
271 default: 271 default:
272 return -EINVAL; 272 return -EINVAL;
273 }; 273 }
274 274
275 if (known_parameters) 275 if (known_parameters)
276 *reg0xc05 |= (2 << 1); /* use specified parameters */ 276 *reg0xc05 |= (2 << 1); /* use specified parameters */
diff --git a/drivers/media/dvb-frontends/stb6100.c b/drivers/media/dvb-frontends/stb6100.c
index 2e93e65d2cdb..45f9523f968f 100644
--- a/drivers/media/dvb-frontends/stb6100.c
+++ b/drivers/media/dvb-frontends/stb6100.c
@@ -575,8 +575,8 @@ struct dvb_frontend *stb6100_attach(struct dvb_frontend *fe,
575 struct stb6100_state *state = NULL; 575 struct stb6100_state *state = NULL;
576 576
577 state = kzalloc(sizeof (struct stb6100_state), GFP_KERNEL); 577 state = kzalloc(sizeof (struct stb6100_state), GFP_KERNEL);
578 if (state == NULL) 578 if (!state)
579 goto error; 579 return NULL;
580 580
581 state->config = config; 581 state->config = config;
582 state->i2c = i2c; 582 state->i2c = i2c;
@@ -587,10 +587,6 @@ struct dvb_frontend *stb6100_attach(struct dvb_frontend *fe,
587 587
588 printk("%s: Attaching STB6100 \n", __func__); 588 printk("%s: Attaching STB6100 \n", __func__);
589 return fe; 589 return fe;
590
591error:
592 kfree(state);
593 return NULL;
594} 590}
595 591
596static int stb6100_release(struct dvb_frontend *fe) 592static int stb6100_release(struct dvb_frontend *fe)
diff --git a/drivers/media/dvb-frontends/stv0299.c b/drivers/media/dvb-frontends/stv0299.c
index 057b5f8effc0..92a6075cd82f 100644
--- a/drivers/media/dvb-frontends/stv0299.c
+++ b/drivers/media/dvb-frontends/stv0299.c
@@ -199,7 +199,7 @@ static int stv0299_wait_diseqc_fifo (struct stv0299_state* state, int timeout)
199 return -ETIMEDOUT; 199 return -ETIMEDOUT;
200 } 200 }
201 msleep(10); 201 msleep(10);
202 }; 202 }
203 203
204 return 0; 204 return 0;
205} 205}
@@ -216,7 +216,7 @@ static int stv0299_wait_diseqc_idle (struct stv0299_state* state, int timeout)
216 return -ETIMEDOUT; 216 return -ETIMEDOUT;
217 } 217 }
218 msleep(10); 218 msleep(10);
219 }; 219 }
220 220
221 return 0; 221 return 0;
222} 222}
@@ -387,7 +387,7 @@ static int stv0299_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltag
387 break; 387 break;
388 default: 388 default:
389 return -EINVAL; 389 return -EINVAL;
390 }; 390 }
391 391
392 if (state->config->op0_off) 392 if (state->config->op0_off)
393 reg0x0c &= ~0x10; 393 reg0x0c &= ~0x10;
diff --git a/drivers/media/dvb-frontends/stv0900_core.c b/drivers/media/dvb-frontends/stv0900_core.c
index 7f1badaf0d03..262dfa503c2a 100644
--- a/drivers/media/dvb-frontends/stv0900_core.c
+++ b/drivers/media/dvb-frontends/stv0900_core.c
@@ -1552,8 +1552,8 @@ static int stv0900_status(struct stv0900_internal *intp,
1552 bitrate = (stv0900_get_mclk_freq(intp, intp->quartz)/1000000) 1552 bitrate = (stv0900_get_mclk_freq(intp, intp->quartz)/1000000)
1553 * (tsbitrate1_val << 8 | tsbitrate0_val); 1553 * (tsbitrate1_val << 8 | tsbitrate0_val);
1554 bitrate /= 16384; 1554 bitrate /= 16384;
1555 dprintk("TS bitrate = %d Mbit/sec \n", bitrate); 1555 dprintk("TS bitrate = %d Mbit/sec\n", bitrate);
1556 }; 1556 }
1557 1557
1558 return locked; 1558 return locked;
1559} 1559}
diff --git a/drivers/media/dvb-frontends/tda665x.c b/drivers/media/dvb-frontends/tda665x.c
index 2c1c759a4f42..63cc12378d9a 100644
--- a/drivers/media/dvb-frontends/tda665x.c
+++ b/drivers/media/dvb-frontends/tda665x.c
@@ -228,8 +228,8 @@ struct dvb_frontend *tda665x_attach(struct dvb_frontend *fe,
228 struct dvb_tuner_info *info; 228 struct dvb_tuner_info *info;
229 229
230 state = kzalloc(sizeof(struct tda665x_state), GFP_KERNEL); 230 state = kzalloc(sizeof(struct tda665x_state), GFP_KERNEL);
231 if (state == NULL) 231 if (!state)
232 goto exit; 232 return NULL;
233 233
234 state->config = config; 234 state->config = config;
235 state->i2c = i2c; 235 state->i2c = i2c;
@@ -246,10 +246,6 @@ struct dvb_frontend *tda665x_attach(struct dvb_frontend *fe,
246 printk(KERN_DEBUG "%s: Attaching TDA665x (%s) tuner\n", __func__, info->name); 246 printk(KERN_DEBUG "%s: Attaching TDA665x (%s) tuner\n", __func__, info->name);
247 247
248 return fe; 248 return fe;
249
250exit:
251 kfree(state);
252 return NULL;
253} 249}
254EXPORT_SYMBOL(tda665x_attach); 250EXPORT_SYMBOL(tda665x_attach);
255 251
diff --git a/drivers/media/dvb-frontends/tda8083.c b/drivers/media/dvb-frontends/tda8083.c
index 15912c96926a..9d08350fe4b0 100644
--- a/drivers/media/dvb-frontends/tda8083.c
+++ b/drivers/media/dvb-frontends/tda8083.c
@@ -175,7 +175,7 @@ static void tda8083_wait_diseqc_fifo (struct tda8083_state* state, int timeout)
175 !(tda8083_readreg(state, 0x02) & 0x80)) 175 !(tda8083_readreg(state, 0x02) & 0x80))
176 { 176 {
177 msleep(50); 177 msleep(50);
178 }; 178 }
179} 179}
180 180
181static int tda8083_set_tone (struct tda8083_state* state, fe_sec_tone_mode_t tone) 181static int tda8083_set_tone (struct tda8083_state* state, fe_sec_tone_mode_t tone)
@@ -215,7 +215,7 @@ static int tda8083_send_diseqc_burst (struct tda8083_state* state, fe_sec_mini_c
215 break; 215 break;
216 default: 216 default:
217 return -EINVAL; 217 return -EINVAL;
218 }; 218 }
219 219
220 tda8083_wait_diseqc_fifo (state, 100); 220 tda8083_wait_diseqc_fifo (state, 100);
221 221