WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 17/31] Coalesce pci.c functions in xenbus.c.

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 17/31] Coalesce pci.c functions in xenbus.c.
From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Date: Thu, 5 Nov 2009 16:33:25 -0500
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Delivery-date: Thu, 05 Nov 2009 13:55:05 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1257456819-782-17-git-send-email-konrad.wilk@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1257456819-782-1-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-2-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-3-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-4-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-5-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-6-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-7-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-8-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-9-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-10-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-11-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-12-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-13-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-14-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-15-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-16-git-send-email-konrad.wilk@xxxxxxxxxx> <1257456819-782-17-git-send-email-konrad.wilk@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
This is the first commit in the process to relocate the driver to
drivers/pci/xen-pcifront.c.

Moving pcifront_disconnect and pcifront_connect in xenbus.c.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
 drivers/xen/pcifront/Makefile   |    2 +-
 drivers/xen/pcifront/pci.c      |   46 ---------------------------------------
 drivers/xen/pcifront/pcifront.h |    2 -
 drivers/xen/pcifront/xenbus.c   |   36 ++++++++++++++++++++++++++++++
 4 files changed, 37 insertions(+), 49 deletions(-)
 delete mode 100644 drivers/xen/pcifront/pci.c

diff --git a/drivers/xen/pcifront/Makefile b/drivers/xen/pcifront/Makefile
index 621e988..1f8fa9d 100644
--- a/drivers/xen/pcifront/Makefile
+++ b/drivers/xen/pcifront/Makefile
@@ -1,6 +1,6 @@
 obj-y += pcifront.o
 
-pcifront-y := pci_op.o xenbus.o pci.o
+pcifront-y := pci_op.o xenbus.o
 
 ifeq ($(CONFIG_XEN_PCIDEV_FE_DEBUG),y)
 EXTRA_CFLAGS += -DDEBUG
diff --git a/drivers/xen/pcifront/pci.c b/drivers/xen/pcifront/pci.c
deleted file mode 100644
index 4239f00..0000000
--- a/drivers/xen/pcifront/pci.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * PCI Frontend Operations - ensure only one PCI frontend runs at a time
- *
- *   Author: Ryan Wilson <hap9@xxxxxxxxxxxxxx>
- */
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/pci.h>
-#include <linux/spinlock.h>
-#include "pcifront.h"
-
-DEFINE_SPINLOCK(pcifront_dev_lock);
-static struct pcifront_device *pcifront_dev = NULL;
-
-int pcifront_connect(struct pcifront_device *pdev)
-{
-       int err = 0;
-
-       spin_lock(&pcifront_dev_lock);
-
-       if (!pcifront_dev) {
-               dev_info(&pdev->xdev->dev, "Installing PCI frontend\n");
-               pcifront_dev = pdev;
-       }
-       else {
-               dev_err(&pdev->xdev->dev, "PCI frontend already installed!\n");
-               err = -EEXIST;
-       }
-
-       spin_unlock(&pcifront_dev_lock);
-
-       return err;
-}
-
-void pcifront_disconnect(struct pcifront_device *pdev)
-{
-       spin_lock(&pcifront_dev_lock);
-
-       if (pdev == pcifront_dev) {
-               dev_info(&pdev->xdev->dev,
-                        "Disconnecting PCI Frontend Buses\n");
-               pcifront_dev = NULL;
-       }
-
-       spin_unlock(&pcifront_dev_lock);
-}
diff --git a/drivers/xen/pcifront/pcifront.h b/drivers/xen/pcifront/pcifront.h
index 909726b..8e24fbe 100644
--- a/drivers/xen/pcifront/pcifront.h
+++ b/drivers/xen/pcifront/pcifront.h
@@ -41,8 +41,6 @@ struct pcifront_device {
 
 };
 
-int pcifront_connect(struct pcifront_device *pdev);
-void pcifront_disconnect(struct pcifront_device *pdev);
 
 int pcifront_scan_root(struct pcifront_device *pdev,
                       unsigned int domain, unsigned int bus);
diff --git a/drivers/xen/pcifront/xenbus.c b/drivers/xen/pcifront/xenbus.c
index 8d8c2ca..23d9f22 100644
--- a/drivers/xen/pcifront/xenbus.c
+++ b/drivers/xen/pcifront/xenbus.c
@@ -19,6 +19,42 @@
 #define INVALID_GRANT_REF (0)
 #define INVALID_EVTCHN    (-1)
 
+
+DEFINE_SPINLOCK(pcifront_dev_lock);
+static struct pcifront_device *pcifront_dev = NULL;
+
+int pcifront_connect(struct pcifront_device *pdev)
+{
+       int err = 0;
+
+       spin_lock(&pcifront_dev_lock);
+
+       if (!pcifront_dev) {
+               dev_info(&pdev->xdev->dev, "Installing PCI frontend\n");
+               pcifront_dev = pdev;
+       }
+       else {
+               dev_err(&pdev->xdev->dev, "PCI frontend already installed!\n");
+               err = -EEXIST;
+       }
+
+       spin_unlock(&pcifront_dev_lock);
+
+       return err;
+}
+
+void pcifront_disconnect(struct pcifront_device *pdev)
+{
+       spin_lock(&pcifront_dev_lock);
+
+       if (pdev == pcifront_dev) {
+               dev_info(&pdev->xdev->dev,
+                        "Disconnecting PCI Frontend Buses\n");
+               pcifront_dev = NULL;
+       }
+
+       spin_unlock(&pcifront_dev_lock);
+}
 static struct pcifront_device *alloc_pdev(struct xenbus_device *xdev)
 {
        struct pcifront_device *pdev;
-- 
1.6.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>