summaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/ldc.c
diff options
context:
space:
mode:
authorDwight Engen <dwight.engen@oracle.com>2014-12-11 18:26:16 +0100
committerDavid S. Miller <davem@davemloft.net>2014-12-12 03:52:45 +0100
commit1678c2bd131313b58c7492487c00dca982be7f28 (patch)
treeaa674d9f464626aab98183d17a00ad84bbd5c43f /arch/sparc/kernel/ldc.c
parentvio: create routines for inc,dec vio dring indexes (diff)
downloadlinux-1678c2bd131313b58c7492487c00dca982be7f28.tar.xz
linux-1678c2bd131313b58c7492487c00dca982be7f28.zip
sparc/ldc: create separate ldc_unbind from ldc_free
Signed-off-by: Dwight Engen <dwight.engen@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/ldc.c')
-rw-r--r--arch/sparc/kernel/ldc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/sparc/kernel/ldc.c b/arch/sparc/kernel/ldc.c
index 4310332872d4..274a9f59d95c 100644
--- a/arch/sparc/kernel/ldc.c
+++ b/arch/sparc/kernel/ldc.c
@@ -1222,11 +1222,12 @@ out_err:
}
EXPORT_SYMBOL(ldc_alloc);
-void ldc_free(struct ldc_channel *lp)
+void ldc_unbind(struct ldc_channel *lp)
{
if (lp->flags & LDC_FLAG_REGISTERED_IRQS) {
free_irq(lp->cfg.rx_irq, lp);
free_irq(lp->cfg.tx_irq, lp);
+ lp->flags &= ~LDC_FLAG_REGISTERED_IRQS;
}
if (lp->flags & LDC_FLAG_REGISTERED_QUEUES) {
@@ -1240,10 +1241,15 @@ void ldc_free(struct ldc_channel *lp)
lp->flags &= ~LDC_FLAG_ALLOCED_QUEUES;
}
- hlist_del(&lp->list);
+ ldc_set_state(lp, LDC_STATE_INIT);
+}
+EXPORT_SYMBOL(ldc_unbind);
+void ldc_free(struct ldc_channel *lp)
+{
+ ldc_unbind(lp);
+ hlist_del(&lp->list);
kfree(lp->mssbuf);
-
ldc_iommu_release(lp);
kfree(lp);