diff options
Diffstat (limited to 'linux/drivers/media/dvb/b2c2')
-rw-r--r-- | linux/drivers/media/dvb/b2c2/skystar2.c | 30 |
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); } |