diff options
author | Antti Palosaari <crope@iki.fi> | 2012-05-18 21:02:55 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-20 15:24:53 +0200 |
commit | c188637dc5a25aec6a21279524405c8fe96f2f4b (patch) | |
tree | 2097a31d4598283633185b8b4b4857fca4254894 /drivers | |
parent | [media] rtl2830: implement .get_frontend() (diff) | |
download | linux-c188637dc5a25aec6a21279524405c8fe96f2f4b.tar.xz linux-c188637dc5a25aec6a21279524405c8fe96f2f4b.zip |
[media] rtl2830: prevent hw access when sleeping
to prevent I/O errors...
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/dvb/frontends/rtl2830.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/rtl2830.c b/drivers/media/dvb/frontends/rtl2830.c index 507ef4bb047a..93612ebac519 100644 --- a/drivers/media/dvb/frontends/rtl2830.c +++ b/drivers/media/dvb/frontends/rtl2830.c @@ -381,6 +381,9 @@ static int rtl2830_get_frontend(struct dvb_frontend *fe) int ret; u8 buf[3]; + if (priv->sleeping) + return 0; + ret = rtl2830_rd_regs(priv, 0x33c, buf, 2); if (ret) goto err; @@ -525,6 +528,9 @@ static int rtl2830_read_snr(struct dvb_frontend *fe, u16 *snr) { 92888734, 92888734, 95487525, 99770748 }, }; + if (priv->sleeping) + return 0; + /* reports SNR in resolution of 0.1 dB */ ret = rtl2830_rd_reg(priv, 0x33c, &tmp); @@ -563,6 +569,9 @@ static int rtl2830_read_ber(struct dvb_frontend *fe, u32 *ber) int ret; u8 buf[2]; + if (priv->sleeping) + return 0; + ret = rtl2830_rd_regs(priv, 0x34e, buf, 2); if (ret) goto err; @@ -588,6 +597,9 @@ static int rtl2830_read_signal_strength(struct dvb_frontend *fe, u16 *strength) u8 buf[2]; u16 if_agc_raw, if_agc; + if (priv->sleeping) + return 0; + ret = rtl2830_rd_regs(priv, 0x359, buf, 2); if (ret) goto err; |