summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-core
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2012-08-09 19:00:51 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-09-27 14:23:10 -0300
commit48caa6f12902dfc08acfc54e417f845dc0477664 (patch)
tree2667606ae2c2633df3f4d3f7b7b1a3e6d3e68439 /drivers/media/dvb-core
parent3c16b2b330e33392ad5dbd98e64bab659259daa4 (diff)
downloadblackbird-op-linux-48caa6f12902dfc08acfc54e417f845dc0477664.tar.gz
blackbird-op-linux-48caa6f12902dfc08acfc54e417f845dc0477664.zip
[media] dvb_frontend: do not allow statistic IOCTLs when sleeping
Demodulator cannot perform statistic IOCTLs when it is not tuned. Return -EAGAIN in such case. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb-core')
-rw-r--r--drivers/media/dvb-core/dvb_frontend.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c
index 479a5e52cb0d..1f3b16db2036 100644
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c
@@ -2131,27 +2131,43 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
err = fe->ops.read_status(fe, status);
break;
}
+
case FE_READ_BER:
- if (fe->ops.read_ber)
- err = fe->ops.read_ber(fe, (__u32*) parg);
+ if (fe->ops.read_ber) {
+ if (fepriv->thread)
+ err = fe->ops.read_ber(fe, (__u32 *) parg);
+ else
+ err = -EAGAIN;
+ }
break;
case FE_READ_SIGNAL_STRENGTH:
- if (fe->ops.read_signal_strength)
- err = fe->ops.read_signal_strength(fe, (__u16*) parg);
+ if (fe->ops.read_signal_strength) {
+ if (fepriv->thread)
+ err = fe->ops.read_signal_strength(fe, (__u16 *) parg);
+ else
+ err = -EAGAIN;
+ }
break;
case FE_READ_SNR:
- if (fe->ops.read_snr)
- err = fe->ops.read_snr(fe, (__u16*) parg);
+ if (fe->ops.read_snr) {
+ if (fepriv->thread)
+ err = fe->ops.read_snr(fe, (__u16 *) parg);
+ else
+ err = -EAGAIN;
+ }
break;
case FE_READ_UNCORRECTED_BLOCKS:
- if (fe->ops.read_ucblocks)
- err = fe->ops.read_ucblocks(fe, (__u32*) parg);
+ if (fe->ops.read_ucblocks) {
+ if (fepriv->thread)
+ err = fe->ops.read_ucblocks(fe, (__u32 *) parg);
+ else
+ err = -EAGAIN;
+ }
break;
-
case FE_DISEQC_RESET_OVERLOAD:
if (fe->ops.diseqc_reset_overload) {
err = fe->ops.diseqc_reset_overload(fe);
OpenPOWER on IntegriCloud