* [PATCH 1/3] ide: allow to wrap interrupt handler
@ 2009-02-03 10:46 Stanislaw Gruszka
2009-03-05 13:48 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 2+ messages in thread
From: Stanislaw Gruszka @ 2009-02-03 10:46 UTC (permalink / raw)
To: linux-ide, Andrew Victor; +Cc: linux-arm-kernel
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
---
drivers/ide/ide-io.c | 2 ++
drivers/ide/ide-probe.c | 6 +++++-
include/linux/ide.h | 1 +
3 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 9ee51ad..086bea2 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -1163,6 +1163,8 @@ out_early:
return irq_ret;
}
+EXPORT_SYMBOL_GPL(ide_intr);
+
/**
* ide_do_drive_cmd - issue IDE special command
* @drive: device to issue command
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index ce0818a..821563d 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -951,6 +951,7 @@ static int init_irq (ide_hwif_t *hwif)
{
struct ide_io_ports *io_ports = &hwif->io_ports;
int sa = 0;
+ irq_handler_t irq_handler;
mutex_lock(&ide_cfg_mtx);
spin_lock_init(&hwif->lock);
@@ -969,7 +970,10 @@ static int init_irq (ide_hwif_t *hwif)
if (io_ports->ctl_addr)
hwif->tp_ops->set_irq(hwif, 1);
- if (request_irq(hwif->irq, &ide_intr, sa, hwif->name, hwif))
+ irq_handler = hwif->host->irq_handler;
+ if (!irq_handler)
+ irq_handler = &ide_intr;
+ if (request_irq(hwif->irq, irq_handler, sa, hwif->name, hwif))
goto out_up;
if (!hwif->rqsize) {
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 194da5a..bfae29f 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -866,6 +866,7 @@ struct ide_host {
unsigned int n_ports;
struct device *dev[2];
unsigned int (*init_chipset)(struct pci_dev *);
+ irq_handler_t irq_handler;
unsigned long host_flags;
void *host_priv;
ide_hwif_t *cur_port; /* for hosts requiring serialization */
--
1.5.2.5
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH 1/3] ide: allow to wrap interrupt handler
2009-02-03 10:46 [PATCH 1/3] ide: allow to wrap interrupt handler Stanislaw Gruszka
@ 2009-03-05 13:48 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 2+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-03-05 13:48 UTC (permalink / raw)
To: Stanislaw Gruszka; +Cc: linux-ide, Andrew Victor, linux-arm-kernel
On Tuesday 03 February 2009, Stanislaw Gruszka wrote:
> Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
BTW Please remember to check patches with scripts/checkpatch.pl:
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
#22: FILE: drivers/ide/ide-io.c:1166:
+EXPORT_SYMBOL_GPL(ide_intr);
[2/3 also has a few "WARNING: line over 80 characters" ones...]
Thus the applied version looks a bit different:
From: Stanislaw Gruszka <stf_xl@wp.pl>
Subject: [PATCH 1/3] ide: allow to wrap interrupt handler
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Cc: Andrew Victor <linux@maxim.org.za>
[bart: minor checkpatch.pl / CodingStyle fixups]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-io.c | 1 +
drivers/ide/ide-probe.c | 7 ++++++-
include/linux/ide.h | 1 +
3 files changed, 8 insertions(+), 1 deletion(-)
Index: b/drivers/ide/ide-io.c
===================================================================
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -1162,6 +1162,7 @@ out_early:
return irq_ret;
}
+EXPORT_SYMBOL_GPL(ide_intr);
/**
* ide_do_drive_cmd - issue IDE special command
Index: b/drivers/ide/ide-probe.c
===================================================================
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -950,6 +950,7 @@ static int ide_port_setup_devices(ide_hw
static int init_irq (ide_hwif_t *hwif)
{
struct ide_io_ports *io_ports = &hwif->io_ports;
+ irq_handler_t irq_handler;
int sa = 0;
mutex_lock(&ide_cfg_mtx);
@@ -959,6 +960,10 @@ static int init_irq (ide_hwif_t *hwif)
hwif->timer.function = &ide_timer_expiry;
hwif->timer.data = (unsigned long)hwif;
+ irq_handler = hwif->host->irq_handler;
+ if (irq_handler == NULL)
+ irq_handler = ide_intr;
+
#if defined(__mc68000__)
sa = IRQF_SHARED;
#endif /* __mc68000__ */
@@ -969,7 +974,7 @@ static int init_irq (ide_hwif_t *hwif)
if (io_ports->ctl_addr)
hwif->tp_ops->set_irq(hwif, 1);
- if (request_irq(hwif->irq, &ide_intr, sa, hwif->name, hwif))
+ if (request_irq(hwif->irq, irq_handler, sa, hwif->name, hwif))
goto out_up;
if (!hwif->rqsize) {
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -866,6 +866,7 @@ struct ide_host {
unsigned int n_ports;
struct device *dev[2];
unsigned int (*init_chipset)(struct pci_dev *);
+ irq_handler_t irq_handler;
unsigned long host_flags;
void *host_priv;
ide_hwif_t *cur_port; /* for hosts requiring serialization */
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-03-05 14:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-03 10:46 [PATCH 1/3] ide: allow to wrap interrupt handler Stanislaw Gruszka
2009-03-05 13:48 ` Bartlomiej Zolnierkiewicz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).