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>
diff --git a/drivers/misc/tifm_7xx1.c b/drivers/misc/tifm_7xx1.c
index 375b567..7fbf5d5 100644
--- a/drivers/misc/tifm_7xx1.c
+++ b/drivers/misc/tifm_7xx1.c
@@ -71,6 +71,7 @@
 static irqreturn_t tifm_7xx1_isr(int irq, void *dev_id)
 {
 	struct tifm_adapter *fm = dev_id;
+	struct tifm_dev *sock;
 	unsigned int irq_status;
 	unsigned int sock_irq_status, cnt;
 
@@ -85,15 +86,13 @@
 		writel(TIFM_IRQ_ENABLE, fm->addr + FM_CLEAR_INTERRUPT_ENABLE);
 
 		for (cnt = 0; cnt <  fm->max_sockets; cnt++) {
+			sock = fm->sockets[cnt];
 			sock_irq_status = (irq_status >> cnt) &
 					(TIFM_IRQ_FIFOMASK | TIFM_IRQ_CARDMASK);
 
-			if (fm->sockets[cnt]) {
-				if (sock_irq_status &&
-						fm->sockets[cnt]->signal_irq)
-					fm->sockets[cnt]->
-						signal_irq(fm->sockets[cnt],
-							sock_irq_status);
+			if (sock) {
+				if (sock_irq_status)
+					sock->signal_irq(sock, sock_irq_status);
 
 				if (irq_status & (1 << cnt))
 					fm->remove_mask |= 1 << cnt;
diff --git a/drivers/misc/tifm_core.c b/drivers/misc/tifm_core.c
index 21eb0ab..3eaf2c9 100644
--- a/drivers/misc/tifm_core.c
+++ b/drivers/misc/tifm_core.c
@@ -145,6 +145,12 @@
 }
 EXPORT_SYMBOL(tifm_free_device);
 
+static void tifm_dummy_signal_irq(struct tifm_dev *sock,
+				  unsigned int sock_irq_status)
+{
+	return;
+}
+
 struct tifm_dev *tifm_alloc_device(struct tifm_adapter *fm)
 {
 	struct tifm_dev *dev = kzalloc(sizeof(struct tifm_dev), GFP_KERNEL);
@@ -155,6 +161,7 @@
 		dev->dev.parent = fm->dev;
 		dev->dev.bus = &tifm_bus_type;
 		dev->dev.release = tifm_free_device;
+		dev->signal_irq = tifm_dummy_signal_irq;
 	}
 	return dev;
 }
@@ -212,6 +219,7 @@
 	struct tifm_driver *drv = fm_dev->drv;
 
 	if (drv) {
+		fm_dev->signal_irq = tifm_dummy_signal_irq;
 		if (drv->remove)
 			drv->remove(fm_dev);
 		fm_dev->drv = NULL;