aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/dvb/ngene/ngene-core.c7
-rw-r--r--drivers/media/dvb/ngene/ngene.h1
2 files changed, 6 insertions, 2 deletions
diff --git a/drivers/media/dvb/ngene/ngene-core.c b/drivers/media/dvb/ngene/ngene-core.c
index c8c997059c40..34eaedf65eea 100644
--- a/drivers/media/dvb/ngene/ngene-core.c
+++ b/drivers/media/dvb/ngene/ngene-core.c
@@ -1750,7 +1750,7 @@ static int init_channel(struct ngene_channel *chan)
1750 if (io & (NGENE_IO_TSIN | NGENE_IO_TSOUT)) { 1750 if (io & (NGENE_IO_TSIN | NGENE_IO_TSOUT)) {
1751 if (nr >= STREAM_AUDIOIN1) 1751 if (nr >= STREAM_AUDIOIN1)
1752 chan->DataFormatFlags = DF_SWAP32; 1752 chan->DataFormatFlags = DF_SWAP32;
1753 if (nr == 0 || !one_adapter) { 1753 if (nr == 0 || !one_adapter || dev->first_adapter == NULL) {
1754 adapter = &dev->adapter[nr]; 1754 adapter = &dev->adapter[nr];
1755 ret = dvb_register_adapter(adapter, "nGene", 1755 ret = dvb_register_adapter(adapter, "nGene",
1756 THIS_MODULE, 1756 THIS_MODULE,
@@ -1758,8 +1758,10 @@ static int init_channel(struct ngene_channel *chan)
1758 adapter_nr); 1758 adapter_nr);
1759 if (ret < 0) 1759 if (ret < 0)
1760 return ret; 1760 return ret;
1761 if (dev->first_adapter == NULL)
1762 dev->first_adapter = adapter;
1761 } else { 1763 } else {
1762 adapter = &dev->adapter[0]; 1764 adapter = dev->first_adapter;
1763 } 1765 }
1764 1766
1765 ret = my_dvb_dmx_ts_card_init(dvbdemux, "SW demux", 1767 ret = my_dvb_dmx_ts_card_init(dvbdemux, "SW demux",
@@ -1796,6 +1798,7 @@ static int init_channels(struct ngene *dev)
1796 int i, j; 1798 int i, j;
1797 1799
1798 for (i = 0; i < MAX_STREAM; i++) { 1800 for (i = 0; i < MAX_STREAM; i++) {
1801 dev->channel[i].number = i;
1799 if (init_channel(&dev->channel[i]) < 0) { 1802 if (init_channel(&dev->channel[i]) < 0) {
1800 for (j = i - 1; j >= 0; j--) 1803 for (j = i - 1; j >= 0; j--)
1801 release_channel(&dev->channel[j]); 1804 release_channel(&dev->channel[j]);
diff --git a/drivers/media/dvb/ngene/ngene.h b/drivers/media/dvb/ngene/ngene.h
index a7eb29846310..ca3af5c6238f 100644
--- a/drivers/media/dvb/ngene/ngene.h
+++ b/drivers/media/dvb/ngene/ngene.h
@@ -752,6 +752,7 @@ struct ngene {
752 spinlock_t cmd_lock; 752 spinlock_t cmd_lock;
753 753
754 struct dvb_adapter adapter[MAX_STREAM]; 754 struct dvb_adapter adapter[MAX_STREAM];
755 struct dvb_adapter *first_adapter; /* "one_adapter" modprobe opt */
755 struct ngene_channel channel[MAX_STREAM]; 756 struct ngene_channel channel[MAX_STREAM];
756 757
757 struct ngene_info *card_info; 758 struct ngene_info *card_info;