diff options
author | Manu Abraham <abraham.manu@gmail.com> | 2006-08-08 14:48:08 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-09-26 10:53:37 -0400 |
commit | bbdd11fa957913d6648cabbca59be1da479180ed (patch) | |
tree | 48d00e950c54a6cb1d04c3eba4e742a0c829ad9e /drivers/media/dvb/bt8xx | |
parent | e4a49d76ca4e2c0b2b4c89d59d43486d781ffe95 (diff) |
V4L/DVB (4432): Fix Circular dependencies
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/bt8xx')
-rw-r--r-- | drivers/media/dvb/bt8xx/dst.c | 14 | ||||
-rw-r--r-- | drivers/media/dvb/bt8xx/dst_ca.c | 10 | ||||
-rw-r--r-- | drivers/media/dvb/bt8xx/dst_common.h | 3 | ||||
-rw-r--r-- | drivers/media/dvb/bt8xx/dvb-bt8xx.c | 6 |
4 files changed, 24 insertions, 9 deletions
diff --git a/drivers/media/dvb/bt8xx/dst.c b/drivers/media/dvb/bt8xx/dst.c index 52b6fb2455f9..9f72b7000c08 100644 --- a/drivers/media/dvb/bt8xx/dst.c +++ b/drivers/media/dvb/bt8xx/dst.c | |||
@@ -1715,6 +1715,15 @@ static int dst_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_paramet | |||
1715 | static void dst_release(struct dvb_frontend *fe) | 1715 | static void dst_release(struct dvb_frontend *fe) |
1716 | { | 1716 | { |
1717 | struct dst_state *state = fe->demodulator_priv; | 1717 | struct dst_state *state = fe->demodulator_priv; |
1718 | if (state->dst_ca) { | ||
1719 | dvb_unregister_device(state->dst_ca); | ||
1720 | #ifdef CONFIG_DVB_CORE_ATTACH | ||
1721 | symbol_put(dst_ca_attach); | ||
1722 | #endif | ||
1723 | } | ||
1724 | #ifdef CONFIG_DVB_CORE_ATTACH | ||
1725 | symbol_put(dst_attach); | ||
1726 | #endif | ||
1718 | kfree(state); | 1727 | kfree(state); |
1719 | } | 1728 | } |
1720 | 1729 | ||
@@ -1752,11 +1761,6 @@ struct dst_state *dst_attach(struct dst_state *state, struct dvb_adapter *dvb_ad | |||
1752 | } | 1761 | } |
1753 | state->frontend.demodulator_priv = state; | 1762 | state->frontend.demodulator_priv = state; |
1754 | 1763 | ||
1755 | /* Attach other DST peripherals if any */ | ||
1756 | /* Conditional Access device */ | ||
1757 | if (state->dst_hw_cap & DST_TYPE_HAS_CA) | ||
1758 | dst_ca_attach(state, dvb_adapter); | ||
1759 | |||
1760 | return state; /* Manu (DST is a card not a frontend) */ | 1764 | return state; /* Manu (DST is a card not a frontend) */ |
1761 | } | 1765 | } |
1762 | 1766 | ||
diff --git a/drivers/media/dvb/bt8xx/dst_ca.c b/drivers/media/dvb/bt8xx/dst_ca.c index df0f68fbf24b..240ad084fa78 100644 --- a/drivers/media/dvb/bt8xx/dst_ca.c +++ b/drivers/media/dvb/bt8xx/dst_ca.c | |||
@@ -699,11 +699,17 @@ static struct dvb_device dvbdev_ca = { | |||
699 | .fops = &dst_ca_fops | 699 | .fops = &dst_ca_fops |
700 | }; | 700 | }; |
701 | 701 | ||
702 | void dst_ca_attach(struct dst_state *dst, struct dvb_adapter *dvb_adapter) | 702 | struct dvb_device *dst_ca_attach(struct dst_state *dst, struct dvb_adapter *dvb_adapter) |
703 | { | 703 | { |
704 | struct dvb_device *dvbdev; | 704 | struct dvb_device *dvbdev; |
705 | |||
705 | dprintk(verbose, DST_CA_ERROR, 1, "registering DST-CA device"); | 706 | dprintk(verbose, DST_CA_ERROR, 1, "registering DST-CA device"); |
706 | dvb_register_device(dvb_adapter, &dvbdev, &dvbdev_ca, dst, DVB_DEVICE_CA); | 707 | if (dvb_register_device(dvb_adapter, &dvbdev, &dvbdev_ca, dst, DVB_DEVICE_CA) == 0) { |
708 | dst->dst_ca = dvbdev; | ||
709 | return dst->dst_ca; | ||
710 | } | ||
711 | |||
712 | return NULL; | ||
707 | } | 713 | } |
708 | 714 | ||
709 | EXPORT_SYMBOL(dst_ca_attach); | 715 | EXPORT_SYMBOL(dst_ca_attach); |
diff --git a/drivers/media/dvb/bt8xx/dst_common.h b/drivers/media/dvb/bt8xx/dst_common.h index 66bc082824ad..3bf084f2e522 100644 --- a/drivers/media/dvb/bt8xx/dst_common.h +++ b/drivers/media/dvb/bt8xx/dst_common.h | |||
@@ -140,6 +140,7 @@ struct dst_state { | |||
140 | char *tuner_name; | 140 | char *tuner_name; |
141 | struct mutex dst_mutex; | 141 | struct mutex dst_mutex; |
142 | u8 fw_name[8]; | 142 | u8 fw_name[8]; |
143 | struct dvb_device *dst_ca; | ||
143 | }; | 144 | }; |
144 | 145 | ||
145 | struct tuner_types { | 146 | struct tuner_types { |
@@ -178,7 +179,7 @@ int write_dst(struct dst_state *state, u8 * data, u8 len); | |||
178 | int read_dst(struct dst_state *state, u8 * ret, u8 len); | 179 | int read_dst(struct dst_state *state, u8 * ret, u8 len); |
179 | u8 dst_check_sum(u8 * buf, u32 len); | 180 | u8 dst_check_sum(u8 * buf, u32 len); |
180 | struct dst_state* dst_attach(struct dst_state* state, struct dvb_adapter *dvb_adapter); | 181 | struct dst_state* dst_attach(struct dst_state* state, struct dvb_adapter *dvb_adapter); |
181 | void dst_ca_attach(struct dst_state *state, struct dvb_adapter *dvb_adapter); | 182 | struct dvb_device *dst_ca_attach(struct dst_state *state, struct dvb_adapter *dvb_adapter); |
182 | int dst_gpio_outb(struct dst_state* state, u32 mask, u32 enbb, u32 outhigh, int delay); | 183 | int dst_gpio_outb(struct dst_state* state, u32 mask, u32 enbb, u32 outhigh, int delay); |
183 | 184 | ||
184 | int dst_command(struct dst_state* state, u8 * data, u8 len); | 185 | int dst_command(struct dst_state* state, u8 * data, u8 len); |
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c index a19991f7af47..fb6c4cc8477d 100644 --- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c +++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c | |||
@@ -669,13 +669,17 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) | |||
669 | state->config = &dst_config; | 669 | state->config = &dst_config; |
670 | state->i2c = card->i2c_adapter; | 670 | state->i2c = card->i2c_adapter; |
671 | state->bt = card->bt; | 671 | state->bt = card->bt; |
672 | 672 | state->dst_ca = NULL; | |
673 | /* DST is not a frontend, attaching the ASIC */ | 673 | /* DST is not a frontend, attaching the ASIC */ |
674 | if (dvb_attach(dst_attach, state, &card->dvb_adapter) == NULL) { | 674 | if (dvb_attach(dst_attach, state, &card->dvb_adapter) == NULL) { |
675 | printk("%s: Could not find a Twinhan DST.\n", __FUNCTION__); | 675 | printk("%s: Could not find a Twinhan DST.\n", __FUNCTION__); |
676 | break; | 676 | break; |
677 | } | 677 | } |
678 | /* Attach other DST peripherals if any */ | ||
679 | /* Conditional Access device */ | ||
678 | card->fe = &state->frontend; | 680 | card->fe = &state->frontend; |
681 | if (state->dst_hw_cap & DST_TYPE_HAS_CA) | ||
682 | dvb_attach(dst_ca_attach, state, &card->dvb_adapter); | ||
679 | break; | 683 | break; |
680 | 684 | ||
681 | case BTTV_BOARD_PINNACLESAT: | 685 | case BTTV_BOARD_PINNACLESAT: |