diff options
author | Bjørn Mork <bjorn@mork.no> | 2010-11-14 12:24:36 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-12-29 05:16:48 -0500 |
commit | a22407faba57c3624beea1a9fad7cbdcf5a19a1a (patch) | |
tree | f6e2af4ef614bb254858b5db60da3b70bcb25816 /drivers | |
parent | 9c81496a88b04206d0607b23b298b6529da1fcb0 (diff) |
[media] Mantis: use dvb_attach to avoid double dereferencing on module removal
Convert the driver to use the dvb_attach macro to avoid the hard dependency
on the frontend drivers. The hard dependecy will result in loading a
number of unused frontends, and unwanted automatic dereferencing.
This fixes a bug where unloading the mantis driver will derefence any
attached frontend twice, which will cause an oops if the same frontend is
used by another driver.
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/dvb/mantis/hopper_vp3028.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/mantis_vp1033.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/mantis_vp1034.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/mantis_vp1041.c | 6 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/mantis_vp2033.c | 4 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/mantis_vp2040.c | 4 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/mantis_vp3030.c | 4 |
7 files changed, 12 insertions, 12 deletions
diff --git a/drivers/media/dvb/mantis/hopper_vp3028.c b/drivers/media/dvb/mantis/hopper_vp3028.c index 96674c78e86b..567ed24f2de3 100644 --- a/drivers/media/dvb/mantis/hopper_vp3028.c +++ b/drivers/media/dvb/mantis/hopper_vp3028.c | |||
@@ -57,7 +57,7 @@ static int vp3028_frontend_init(struct mantis_pci *mantis, struct dvb_frontend * | |||
57 | if (err == 0) { | 57 | if (err == 0) { |
58 | msleep(250); | 58 | msleep(250); |
59 | dprintk(MANTIS_ERROR, 1, "Probing for 10353 (DVB-T)"); | 59 | dprintk(MANTIS_ERROR, 1, "Probing for 10353 (DVB-T)"); |
60 | fe = zl10353_attach(&hopper_vp3028_config, adapter); | 60 | fe = dvb_attach(zl10353_attach, &hopper_vp3028_config, adapter); |
61 | 61 | ||
62 | if (!fe) | 62 | if (!fe) |
63 | return -1; | 63 | return -1; |
diff --git a/drivers/media/dvb/mantis/mantis_vp1033.c b/drivers/media/dvb/mantis/mantis_vp1033.c index 4a723bda0031..deec927c7f7a 100644 --- a/drivers/media/dvb/mantis/mantis_vp1033.c +++ b/drivers/media/dvb/mantis/mantis_vp1033.c | |||
@@ -173,7 +173,7 @@ static int vp1033_frontend_init(struct mantis_pci *mantis, struct dvb_frontend * | |||
173 | msleep(250); | 173 | msleep(250); |
174 | 174 | ||
175 | dprintk(MANTIS_ERROR, 1, "Probing for STV0299 (DVB-S)"); | 175 | dprintk(MANTIS_ERROR, 1, "Probing for STV0299 (DVB-S)"); |
176 | fe = stv0299_attach(&lgtdqcs001f_config, adapter); | 176 | fe = dvb_attach(stv0299_attach, &lgtdqcs001f_config, adapter); |
177 | 177 | ||
178 | if (fe) { | 178 | if (fe) { |
179 | fe->ops.tuner_ops.set_params = lgtdqcs001f_tuner_set; | 179 | fe->ops.tuner_ops.set_params = lgtdqcs001f_tuner_set; |
diff --git a/drivers/media/dvb/mantis/mantis_vp1034.c b/drivers/media/dvb/mantis/mantis_vp1034.c index 8e6ae558ee57..bf62338a1745 100644 --- a/drivers/media/dvb/mantis/mantis_vp1034.c +++ b/drivers/media/dvb/mantis/mantis_vp1034.c | |||
@@ -82,7 +82,7 @@ static int vp1034_frontend_init(struct mantis_pci *mantis, struct dvb_frontend * | |||
82 | msleep(250); | 82 | msleep(250); |
83 | 83 | ||
84 | dprintk(MANTIS_ERROR, 1, "Probing for MB86A16 (DVB-S/DSS)"); | 84 | dprintk(MANTIS_ERROR, 1, "Probing for MB86A16 (DVB-S/DSS)"); |
85 | fe = mb86a16_attach(&vp1034_mb86a16_config, adapter); | 85 | fe = dvb_attach(mb86a16_attach, &vp1034_mb86a16_config, adapter); |
86 | if (fe) { | 86 | if (fe) { |
87 | dprintk(MANTIS_ERROR, 1, | 87 | dprintk(MANTIS_ERROR, 1, |
88 | "found MB86A16 DVB-S/DSS frontend @0x%02x", | 88 | "found MB86A16 DVB-S/DSS frontend @0x%02x", |
diff --git a/drivers/media/dvb/mantis/mantis_vp1041.c b/drivers/media/dvb/mantis/mantis_vp1041.c index d1aa2bc0c155..38a436ca2fdf 100644 --- a/drivers/media/dvb/mantis/mantis_vp1041.c +++ b/drivers/media/dvb/mantis/mantis_vp1041.c | |||
@@ -316,14 +316,14 @@ static int vp1041_frontend_init(struct mantis_pci *mantis, struct dvb_frontend * | |||
316 | if (err == 0) { | 316 | if (err == 0) { |
317 | mantis_frontend_soft_reset(mantis); | 317 | mantis_frontend_soft_reset(mantis); |
318 | msleep(250); | 318 | msleep(250); |
319 | mantis->fe = stb0899_attach(&vp1041_stb0899_config, adapter); | 319 | mantis->fe = dvb_attach(stb0899_attach, &vp1041_stb0899_config, adapter); |
320 | if (mantis->fe) { | 320 | if (mantis->fe) { |
321 | dprintk(MANTIS_ERROR, 1, | 321 | dprintk(MANTIS_ERROR, 1, |
322 | "found STB0899 DVB-S/DVB-S2 frontend @0x%02x", | 322 | "found STB0899 DVB-S/DVB-S2 frontend @0x%02x", |
323 | vp1041_stb0899_config.demod_address); | 323 | vp1041_stb0899_config.demod_address); |
324 | 324 | ||
325 | if (stb6100_attach(mantis->fe, &vp1041_stb6100_config, adapter)) { | 325 | if (dvb_attach(stb6100_attach, mantis->fe, &vp1041_stb6100_config, adapter)) { |
326 | if (!lnbp21_attach(mantis->fe, adapter, 0, 0)) | 326 | if (!dvb_attach(lnbp21_attach, mantis->fe, adapter, 0, 0)) |
327 | dprintk(MANTIS_ERROR, 1, "No LNBP21 found!"); | 327 | dprintk(MANTIS_ERROR, 1, "No LNBP21 found!"); |
328 | } | 328 | } |
329 | } else { | 329 | } else { |
diff --git a/drivers/media/dvb/mantis/mantis_vp2033.c b/drivers/media/dvb/mantis/mantis_vp2033.c index 10ce81790a8c..06da0ddf05a7 100644 --- a/drivers/media/dvb/mantis/mantis_vp2033.c +++ b/drivers/media/dvb/mantis/mantis_vp2033.c | |||
@@ -132,7 +132,7 @@ static int vp2033_frontend_init(struct mantis_pci *mantis, struct dvb_frontend * | |||
132 | msleep(250); | 132 | msleep(250); |
133 | 133 | ||
134 | dprintk(MANTIS_ERROR, 1, "Probing for CU1216 (DVB-C)"); | 134 | dprintk(MANTIS_ERROR, 1, "Probing for CU1216 (DVB-C)"); |
135 | fe = tda10021_attach(&vp2033_tda1002x_cu1216_config, | 135 | fe = dvb_attach(tda10021_attach, &vp2033_tda1002x_cu1216_config, |
136 | adapter, | 136 | adapter, |
137 | read_pwm(mantis)); | 137 | read_pwm(mantis)); |
138 | 138 | ||
@@ -141,7 +141,7 @@ static int vp2033_frontend_init(struct mantis_pci *mantis, struct dvb_frontend * | |||
141 | "found Philips CU1216 DVB-C frontend (TDA10021) @ 0x%02x", | 141 | "found Philips CU1216 DVB-C frontend (TDA10021) @ 0x%02x", |
142 | vp2033_tda1002x_cu1216_config.demod_address); | 142 | vp2033_tda1002x_cu1216_config.demod_address); |
143 | } else { | 143 | } else { |
144 | fe = tda10023_attach(&vp2033_tda10023_cu1216_config, | 144 | fe = dvb_attach(tda10023_attach, &vp2033_tda10023_cu1216_config, |
145 | adapter, | 145 | adapter, |
146 | read_pwm(mantis)); | 146 | read_pwm(mantis)); |
147 | 147 | ||
diff --git a/drivers/media/dvb/mantis/mantis_vp2040.c b/drivers/media/dvb/mantis/mantis_vp2040.c index a7ca233e800b..f72b137b7652 100644 --- a/drivers/media/dvb/mantis/mantis_vp2040.c +++ b/drivers/media/dvb/mantis/mantis_vp2040.c | |||
@@ -132,7 +132,7 @@ static int vp2040_frontend_init(struct mantis_pci *mantis, struct dvb_frontend * | |||
132 | msleep(250); | 132 | msleep(250); |
133 | 133 | ||
134 | dprintk(MANTIS_ERROR, 1, "Probing for CU1216 (DVB-C)"); | 134 | dprintk(MANTIS_ERROR, 1, "Probing for CU1216 (DVB-C)"); |
135 | fe = tda10021_attach(&vp2040_tda1002x_cu1216_config, | 135 | fe = dvb_attach(tda10021_attach, &vp2040_tda1002x_cu1216_config, |
136 | adapter, | 136 | adapter, |
137 | read_pwm(mantis)); | 137 | read_pwm(mantis)); |
138 | 138 | ||
@@ -141,7 +141,7 @@ static int vp2040_frontend_init(struct mantis_pci *mantis, struct dvb_frontend * | |||
141 | "found Philips CU1216 DVB-C frontend (TDA10021) @ 0x%02x", | 141 | "found Philips CU1216 DVB-C frontend (TDA10021) @ 0x%02x", |
142 | vp2040_tda1002x_cu1216_config.demod_address); | 142 | vp2040_tda1002x_cu1216_config.demod_address); |
143 | } else { | 143 | } else { |
144 | fe = tda10023_attach(&vp2040_tda10023_cu1216_config, | 144 | fe = dvb_attach(tda10023_attach, &vp2040_tda10023_cu1216_config, |
145 | adapter, | 145 | adapter, |
146 | read_pwm(mantis)); | 146 | read_pwm(mantis)); |
147 | 147 | ||
diff --git a/drivers/media/dvb/mantis/mantis_vp3030.c b/drivers/media/dvb/mantis/mantis_vp3030.c index 1f4334214953..be4d87c04149 100644 --- a/drivers/media/dvb/mantis/mantis_vp3030.c +++ b/drivers/media/dvb/mantis/mantis_vp3030.c | |||
@@ -68,12 +68,12 @@ static int vp3030_frontend_init(struct mantis_pci *mantis, struct dvb_frontend * | |||
68 | if (err == 0) { | 68 | if (err == 0) { |
69 | msleep(250); | 69 | msleep(250); |
70 | dprintk(MANTIS_ERROR, 1, "Probing for 10353 (DVB-T)"); | 70 | dprintk(MANTIS_ERROR, 1, "Probing for 10353 (DVB-T)"); |
71 | fe = zl10353_attach(&mantis_vp3030_config, adapter); | 71 | fe = dvb_attach(zl10353_attach, &mantis_vp3030_config, adapter); |
72 | 72 | ||
73 | if (!fe) | 73 | if (!fe) |
74 | return -1; | 74 | return -1; |
75 | 75 | ||
76 | tda665x_attach(fe, &env57h12d5_config, adapter); | 76 | dvb_attach(tda665x_attach, fe, &env57h12d5_config, adapter); |
77 | } else { | 77 | } else { |
78 | dprintk(MANTIS_ERROR, 1, "Frontend on <%s> POWER ON failed! <%d>", | 78 | dprintk(MANTIS_ERROR, 1, "Frontend on <%s> POWER ON failed! <%d>", |
79 | adapter->name, | 79 | adapter->name, |