aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/mantis/mantis_evm.c
diff options
context:
space:
mode:
authorManu Abraham <abraham.manu@gmail.com>2009-12-04 03:09:04 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-01-17 08:55:34 -0500
commit12855cac87218d0c92ffdebb7270cec040cf5a6a (patch)
tree81a6b9599c17e3f87dcbe3fa4a2296b5593a00fb /drivers/media/dvb/mantis/mantis_evm.c
parent3062b1571a1d3520c4d3160ebbfca8002b1d6963 (diff)
V4L/DVB (13740): [Mantis] Schedule the work instead of handling the task directly
Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/mantis/mantis_evm.c')
-rw-r--r--drivers/media/dvb/mantis/mantis_evm.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/media/dvb/mantis/mantis_evm.c b/drivers/media/dvb/mantis/mantis_evm.c
index c35ddd868f89..745148399981 100644
--- a/drivers/media/dvb/mantis/mantis_evm.c
+++ b/drivers/media/dvb/mantis/mantis_evm.c
@@ -22,9 +22,9 @@
22#include "mantis_link.h" 22#include "mantis_link.h"
23#include "mantis_hif.h" 23#include "mantis_hif.h"
24 24
25void mantis_hifevm_tasklet(unsigned long data) 25static void mantis_hifevm_work(struct work_struct *work)
26{ 26{
27 struct mantis_ca *ca = (struct mantis_ca *) data; 27 struct mantis_ca *ca = container_of(work, struct mantis_ca, hif_evm_work);
28 struct mantis_pci *mantis = ca->ca_priv; 28 struct mantis_pci *mantis = ca->ca_priv;
29 29
30 u32 gpif_stat, gpif_mask; 30 u32 gpif_stat, gpif_mask;
@@ -38,15 +38,13 @@ void mantis_hifevm_tasklet(unsigned long data)
38 if (gpif_stat & MANTIS_CARD_PLUGIN) { 38 if (gpif_stat & MANTIS_CARD_PLUGIN) {
39 dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): CAM Plugin", mantis->num); 39 dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): CAM Plugin", mantis->num);
40 mmwrite(0xdada0000, MANTIS_CARD_RESET); 40 mmwrite(0xdada0000, MANTIS_CARD_RESET);
41 // Plugin call here 41 mantis_event_cam_plugin(ca);
42 gpif_stat = 0; // crude !
43 } 42 }
44 } else { 43 } else {
45 if (gpif_stat & MANTIS_CARD_PLUGOUT) { 44 if (gpif_stat & MANTIS_CARD_PLUGOUT) {
46 dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): CAM Unplug", mantis->num); 45 dprintk(verbose, MANTIS_DEBUG, 1, "Event Mgr: Adapter(%d) Slot(0): CAM Unplug", mantis->num);
47 mmwrite(0xdada0000, MANTIS_CARD_RESET); 46 mmwrite(0xdada0000, MANTIS_CARD_RESET);
48 // Unplug call here 47 mantis_event_cam_unplug(ca);
49 gpif_stat = 0; // crude !
50 } 48 }
51 } 49 }
52 50
@@ -91,9 +89,9 @@ int mantis_evmgr_init(struct mantis_ca *ca)
91 struct mantis_pci *mantis = ca->ca_priv; 89 struct mantis_pci *mantis = ca->ca_priv;
92 90
93 dprintk(verbose, MANTIS_DEBUG, 1, "Initializing Mantis Host I/F Event manager"); 91 dprintk(verbose, MANTIS_DEBUG, 1, "Initializing Mantis Host I/F Event manager");
94 tasklet_init(&ca->hif_evm_tasklet, mantis_hifevm_tasklet, (unsigned long) ca); 92 INIT_WORK(&ca->hif_evm_work, mantis_hifevm_work);
95
96 mantis_pcmcia_init(ca); 93 mantis_pcmcia_init(ca);
94 schedule_work(&ca->hif_evm_work);
97 95
98 return 0; 96 return 0;
99} 97}
@@ -103,7 +101,6 @@ void mantis_evmgr_exit(struct mantis_ca *ca)
103 struct mantis_pci *mantis = ca->ca_priv; 101 struct mantis_pci *mantis = ca->ca_priv;
104 102
105 dprintk(verbose, MANTIS_DEBUG, 1, "Mantis Host I/F Event manager exiting"); 103 dprintk(verbose, MANTIS_DEBUG, 1, "Mantis Host I/F Event manager exiting");
106 tasklet_kill(&ca->hif_evm_tasklet); 104 flush_scheduled_work();
107
108 mantis_pcmcia_exit(ca); 105 mantis_pcmcia_exit(ca);
109} 106}