summaryrefslogtreecommitdiff
path: root/drivers/vme/vme.c
diff options
context:
space:
mode:
authorAaron Sierra <asierra@xes-inc.com>2016-04-24 15:11:38 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-05-01 14:00:00 -0700
commit326071b3c985683f8a18417bed3ea2ab930a7ba1 (patch)
tree6e6bf20fcc95af0132d25317c324da1509566e29 /drivers/vme/vme.c
parent2ce7aed6a4da8ffa35f0232573a6901c0369720d (diff)
downloadlwn-326071b3c985683f8a18417bed3ea2ab930a7ba1.tar.gz
lwn-326071b3c985683f8a18417bed3ea2ab930a7ba1.zip
vme: add vme_init_bridge for common bridge init
Consolidate vme_bridge structure setup that every bridge was required to do itself. This came about because .irq_mtx is only used within the VME core, but was required to be setup externally. This returns the structure passed in to support shorthand like this: bridge = vme_init_bridge(&priv->bridge); Signed-off-by: Aaron Sierra <asierra@xes-inc.com> Acked-by: Martyn Welch <martyn@welchs.me.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/vme/vme.c')
-rw-r--r--drivers/vme/vme.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/vme/vme.c b/drivers/vme/vme.c
index 537b209fd6e5..37ac0a58e59a 100644
--- a/drivers/vme/vme.c
+++ b/drivers/vme/vme.c
@@ -1429,6 +1429,20 @@ static void vme_dev_release(struct device *dev)
kfree(dev_to_vme_dev(dev));
}
+/* Common bridge initialization */
+struct vme_bridge *vme_init_bridge(struct vme_bridge *bridge)
+{
+ INIT_LIST_HEAD(&bridge->vme_error_handlers);
+ INIT_LIST_HEAD(&bridge->master_resources);
+ INIT_LIST_HEAD(&bridge->slave_resources);
+ INIT_LIST_HEAD(&bridge->dma_resources);
+ INIT_LIST_HEAD(&bridge->lm_resources);
+ mutex_init(&bridge->irq_mtx);
+
+ return bridge;
+}
+EXPORT_SYMBOL(vme_init_bridge);
+
int vme_register_bridge(struct vme_bridge *bridge)
{
int i;