aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Dubov <oakad@yahoo.com>2006-12-10 09:55:31 -0500
committerPierre Ossman <drzeus@drzeus.cx>2007-02-04 14:54:08 -0500
commit217334d14d28e6a671e6dd2c7a35c9070b0721ea (patch)
treed6366708a8c80e4beb698b81c61db25bd50a30dd
parent50743f4cb1d655c7fbe25af58a9d0db6bf76d687 (diff)
Add dummy_signal_irq function to save check in ISR
Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
-rw-r--r--drivers/misc/tifm_7xx1.c11
-rw-r--r--drivers/misc/tifm_core.c8
2 files changed, 13 insertions, 6 deletions
diff --git a/drivers/misc/tifm_7xx1.c b/drivers/misc/tifm_7xx1.c
index 375b56742f2b..7fbf5d58bfc5 100644
--- a/drivers/misc/tifm_7xx1.c
+++ b/drivers/misc/tifm_7xx1.c
@@ -71,6 +71,7 @@ static void tifm_7xx1_remove_media(struct work_struct *work)
71static irqreturn_t tifm_7xx1_isr(int irq, void *dev_id) 71static irqreturn_t tifm_7xx1_isr(int irq, void *dev_id)
72{ 72{
73 struct tifm_adapter *fm = dev_id; 73 struct tifm_adapter *fm = dev_id;
74 struct tifm_dev *sock;
74 unsigned int irq_status; 75 unsigned int irq_status;
75 unsigned int sock_irq_status, cnt; 76 unsigned int sock_irq_status, cnt;
76 77
@@ -85,15 +86,13 @@ static irqreturn_t tifm_7xx1_isr(int irq, void *dev_id)
85 writel(TIFM_IRQ_ENABLE, fm->addr + FM_CLEAR_INTERRUPT_ENABLE); 86 writel(TIFM_IRQ_ENABLE, fm->addr + FM_CLEAR_INTERRUPT_ENABLE);
86 87
87 for (cnt = 0; cnt < fm->max_sockets; cnt++) { 88 for (cnt = 0; cnt < fm->max_sockets; cnt++) {
89 sock = fm->sockets[cnt];
88 sock_irq_status = (irq_status >> cnt) & 90 sock_irq_status = (irq_status >> cnt) &
89 (TIFM_IRQ_FIFOMASK | TIFM_IRQ_CARDMASK); 91 (TIFM_IRQ_FIFOMASK | TIFM_IRQ_CARDMASK);
90 92
91 if (fm->sockets[cnt]) { 93 if (sock) {
92 if (sock_irq_status && 94 if (sock_irq_status)
93 fm->sockets[cnt]->signal_irq) 95 sock->signal_irq(sock, sock_irq_status);
94 fm->sockets[cnt]->
95 signal_irq(fm->sockets[cnt],
96 sock_irq_status);
97 96
98 if (irq_status & (1 << cnt)) 97 if (irq_status & (1 << cnt))
99 fm->remove_mask |= 1 << cnt; 98 fm->remove_mask |= 1 << cnt;
diff --git a/drivers/misc/tifm_core.c b/drivers/misc/tifm_core.c
index 21eb0ab7c329..3eaf2c985b7d 100644
--- a/drivers/misc/tifm_core.c
+++ b/drivers/misc/tifm_core.c
@@ -145,6 +145,12 @@ void tifm_free_device(struct device *dev)
145} 145}
146EXPORT_SYMBOL(tifm_free_device); 146EXPORT_SYMBOL(tifm_free_device);
147 147
148static void tifm_dummy_signal_irq(struct tifm_dev *sock,
149 unsigned int sock_irq_status)
150{
151 return;
152}
153
148struct tifm_dev *tifm_alloc_device(struct tifm_adapter *fm) 154struct tifm_dev *tifm_alloc_device(struct tifm_adapter *fm)
149{ 155{
150 struct tifm_dev *dev = kzalloc(sizeof(struct tifm_dev), GFP_KERNEL); 156 struct tifm_dev *dev = kzalloc(sizeof(struct tifm_dev), GFP_KERNEL);
@@ -155,6 +161,7 @@ struct tifm_dev *tifm_alloc_device(struct tifm_adapter *fm)
155 dev->dev.parent = fm->dev; 161 dev->dev.parent = fm->dev;
156 dev->dev.bus = &tifm_bus_type; 162 dev->dev.bus = &tifm_bus_type;
157 dev->dev.release = tifm_free_device; 163 dev->dev.release = tifm_free_device;
164 dev->signal_irq = tifm_dummy_signal_irq;
158 } 165 }
159 return dev; 166 return dev;
160} 167}
@@ -212,6 +219,7 @@ static int tifm_device_remove(struct device *dev)
212 struct tifm_driver *drv = fm_dev->drv; 219 struct tifm_driver *drv = fm_dev->drv;
213 220
214 if (drv) { 221 if (drv) {
222 fm_dev->signal_irq = tifm_dummy_signal_irq;
215 if (drv->remove) 223 if (drv->remove)
216 drv->remove(fm_dev); 224 drv->remove(fm_dev);
217 fm_dev->drv = NULL; 225 fm_dev->drv = NULL;