summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorHolger Waechtler <devnull@localhost>2003-11-29 04:33:19 +0000
committerHolger Waechtler <devnull@localhost>2003-11-29 04:33:19 +0000
commitccf3562cf37c23c1ae6a31b3efe75e459933ce94 (patch)
tree74ee0ad977e2acdc6b605592861f282a944254f6 /linux
parent23caf64033c6fb17b95219f3fd008ab328e06a10 (diff)
downloadmediapointer-dvb-s2-ccf3562cf37c23c1ae6a31b3efe75e459933ce94.tar.gz
mediapointer-dvb-s2-ccf3562cf37c23c1ae6a31b3efe75e459933ce94.tar.bz2
apply adapter->capturing refcounting bug fixed by Wolfgang Thiel
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/dvb/b2c2/skystar2.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/linux/drivers/media/dvb/b2c2/skystar2.c b/linux/drivers/media/dvb/b2c2/skystar2.c
index 1bfff5a43..87d9e2115 100644
--- a/linux/drivers/media/dvb/b2c2/skystar2.c
+++ b/linux/drivers/media/dvb/b2c2/skystar2.c
@@ -91,7 +91,7 @@ struct adapter {
u32 dma_ctrl;
u32 dma_status;
- u32 capturing;
+ int capturing;
spinlock_t lock;
@@ -1736,8 +1736,7 @@ static void open_stream(struct adapter *adapter, u32 pid)
{
u32 dma_mask;
- if (adapter->capturing == 0)
- adapter->capturing = 1;
+ ++adapter->capturing;
filter_enable_mask_filter(adapter, 1);
@@ -1774,24 +1773,23 @@ static void open_stream(struct adapter *adapter, u32 pid)
static void close_stream(struct adapter *adapter, u32 pid)
{
- u32 dma_mask;
-
- if (adapter->capturing != 0)
- adapter->capturing = 0;
+ if (adapter->capturing > 0)
+ --adapter->capturing;
dprintk("%s: dma_status=%x\n", __FUNCTION__, adapter->dma_status);
- dma_mask = 0;
+ if (adapter->capturing == 0) {
+ u32 dma_mask = 0;
- if ((adapter->dma_status & 1) != 0)
- dma_mask = dma_mask | 0x00000001;
- if ((adapter->dma_status & 2) != 0)
- dma_mask = dma_mask | 0x00000002;
-
- if (dma_mask != 0) {
- dma_start_stop0x2102(adapter, dma_mask, 0);
+ if ((adapter->dma_status & 1) != 0)
+ dma_mask = dma_mask | 0x00000001;
+ if ((adapter->dma_status & 2) != 0)
+ dma_mask = dma_mask | 0x00000002;
+
+ if (dma_mask != 0) {
+ dma_start_stop0x2102(adapter, dma_mask, 0);
+ }
}
-
remove_pid(adapter, pid);
}