summaryrefslogtreecommitdiffstats
path: root/drivers/staging/dgnc
diff options
context:
space:
mode:
authorDaeseok Youn <daeseok.youn@gmail.com>2016-09-26 09:45:14 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-09-27 13:12:26 +0200
commit5897914f0abb276dddd8fea257782c489acb290b (patch)
tree9d490f0688ea39bcf4de0142790d6ec888c0e58c /drivers/staging/dgnc
parent0d79f59dbee57df234d982c6b4eab8037cc1cbb7 (diff)
downloadtalos-obmc-linux-5897914f0abb276dddd8fea257782c489acb290b.tar.gz
talos-obmc-linux-5897914f0abb276dddd8fea257782c489acb290b.zip
staging: dgnc: introduce the dgnc_free_irq()
The dgnc_free_irq() will free the requested IRQ from the dgnc_request_irq(). Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/dgnc')
-rw-r--r--drivers/staging/dgnc/dgnc_driver.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index 70e68b56adb2..81ce5c4755c3 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -38,6 +38,7 @@ MODULE_SUPPORTED_DEVICE("dgnc");
*/
static int dgnc_start(void);
static int dgnc_request_irq(struct dgnc_board *brd);
+static void dgnc_free_irq(struct dgnc_board *brd);
static struct dgnc_board *dgnc_found_board(struct pci_dev *pdev, int id);
static void dgnc_cleanup_board(struct dgnc_board *brd);
static void dgnc_poll_handler(ulong dummy);
@@ -305,7 +306,7 @@ static int dgnc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
rc = dgnc_tty_init(brd);
if (rc < 0) {
pr_err(DRVSTR ": Can't init tty devices (%d)\n", rc);
- goto unregister_tty;
+ goto free_irq;
}
brd->state = BOARD_READY;
@@ -317,6 +318,8 @@ static int dgnc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
return 0;
+free_irq:
+ dgnc_free_irq(brd);
unregister_tty:
dgnc_tty_unregister(brd);
@@ -577,6 +580,12 @@ static int dgnc_request_irq(struct dgnc_board *brd)
return rc;
}
+static void dgnc_free_irq(struct dgnc_board *brd)
+{
+ if (brd->irq)
+ free_irq(brd->irq, brd);
+}
+
/*
* Remap PCI memory.
*/
OpenPOWER on IntegriCloud