mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Emilio G. Cota" <cota@braap.org>
To: Greg KH <greg@kroah.com>
Cc: Martyn Welch <martyn.welch@ge.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Juan David Gonzalez Cobas <david.cobas@gmail.com>
Subject: [PATCH 29/30] staging/vme: remove unused vme_* functions and related code
Date: Fri, 22 Oct 2010 02:36:51 -0400	[thread overview]
Message-ID: <1287729412-24356-30-git-send-email-cota@braap.org> (raw)
In-Reply-To: <1287729412-24356-1-git-send-email-cota@braap.org>

From: Emilio G. Cota <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/vme.c |  260 ---------------------------------------------
 drivers/staging/vme/vme.h |   24 ----
 2 files changed, 0 insertions(+), 284 deletions(-)

diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c
index 88697aa..c50f764 100644
--- a/drivers/staging/vme/vme.c
+++ b/drivers/staging/vme/vme.c
@@ -344,17 +344,6 @@ err_image:
 }
 EXPORT_SYMBOL(vme_slave_request_ng);
 
-struct vme_resource
-*vme_slave_request(struct device *dev, vme_address_t address, vme_cycle_t cycle)
-{
-	struct vme_bridge *bridge = dev_to_bridge(dev);
-
-	if (bridge)
-		return vme_slave_request_ng(bridge, address, cycle);
-	return NULL;
-}
-EXPORT_SYMBOL(vme_slave_request);
-
 int vme_slave_set(struct vme_resource *resource, int enabled,
 	unsigned long long vme_base, unsigned long long size,
 	dma_addr_t buf_base, vme_address_t aspace, vme_cycle_t cycle)
@@ -508,18 +497,6 @@ err_image:
 }
 EXPORT_SYMBOL(vme_master_request_ng);
 
-struct vme_resource
-*vme_master_request(struct device *dev, vme_address_t address,
-		    vme_cycle_t cycle, vme_width_t dwidth)
-{
-	struct vme_bridge *bridge = dev_to_bridge(dev);
-
-	if (bridge)
-		return vme_master_request_ng(bridge, address, cycle, dwidth);
-	return NULL;
-}
-EXPORT_SYMBOL(vme_master_request);
-
 int vme_master_set(struct vme_resource *resource, int enabled,
 	unsigned long long vme_base, unsigned long long size,
 	vme_address_t aspace, vme_cycle_t cycle, vme_width_t dwidth)
@@ -769,16 +746,6 @@ err_ctrlr:
 }
 EXPORT_SYMBOL(vme_dma_request_ng);
 
-struct vme_resource *vme_dma_request(struct device *dev, vme_dma_route_t route)
-{
-	struct vme_bridge *bridge = dev_to_bridge(dev);
-
-	if (bridge)
-		return vme_dma_request_ng(bridge, route);
-	return NULL;
-}
-EXPORT_SYMBOL(vme_dma_request);
-
 /*
  * Start new list
  */
@@ -1095,17 +1062,6 @@ int vme_irq_request_ng(struct vme_bridge *bridge, int level, int statid,
 }
 EXPORT_SYMBOL(vme_irq_request_ng);
 
-int vme_irq_request(struct device *dev, int level, int statid,
-		    void (*callback)(int, int, void *), void *priv_data)
-{
-	struct vme_bridge *bridge = dev_to_bridge(dev);
-
-	if (bridge)
-		return vme_irq_request_ng(bridge, level, statid, callback, priv_data);
-	return -EINVAL;
-}
-EXPORT_SYMBOL(vme_irq_request);
-
 void vme_irq_free_ng(struct vme_bridge *bridge, int level, int statid)
 {
 	if ((level < 1) || (level > 7)) {
@@ -1133,16 +1089,6 @@ void vme_irq_free_ng(struct vme_bridge *bridge, int level, int statid)
 }
 EXPORT_SYMBOL(vme_irq_free_ng);
 
-void vme_irq_free(struct device *dev, int level, int statid)
-{
-	struct vme_bridge *bridge = dev_to_bridge(dev);
-
-	if (bridge)
-		return vme_irq_free_ng(bridge, level, statid);
-	return;
-}
-EXPORT_SYMBOL(vme_irq_free);
-
 int vme_irq_generate_ng(struct vme_bridge *bridge, int level, int statid)
 {
 	if ((level < 1) || (level > 7)) {
@@ -1159,16 +1105,6 @@ int vme_irq_generate_ng(struct vme_bridge *bridge, int level, int statid)
 }
 EXPORT_SYMBOL(vme_irq_generate_ng);
 
-int vme_irq_generate(struct device *dev, int level, int statid)
-{
-	struct vme_bridge *bridge = dev_to_bridge(dev);
-
-	if (bridge)
-		return vme_irq_generate_ng(bridge, level, statid);
-	return -EINVAL;
-}
-EXPORT_SYMBOL(vme_irq_generate);
-
 /*
  * Request the location monitor, return resource or NULL
  */
@@ -1225,16 +1161,6 @@ err_lm:
 }
 EXPORT_SYMBOL(vme_lm_request_ng);
 
-struct vme_resource *vme_lm_request(struct device *dev)
-{
-	struct vme_bridge *bridge = dev_to_bridge(dev);
-
-	if (bridge)
-		return vme_lm_request_ng(bridge);
-	return NULL;
-}
-EXPORT_SYMBOL(vme_lm_request);
-
 int vme_lm_count(struct vme_resource *resource)
 {
 	struct vme_lm_resource *lm;
@@ -1433,72 +1359,6 @@ static void vme_unregister_bus(struct vme_bridge *bridge)
 	mutex_unlock(&vme_buses_lock);
 }
 
-/* Note: device_release(dev) throws a warning if dev->release isn't filled in */
-static void vme_dev_release(struct device *dev)
-{
-}
-
-int vme_register_bridge(struct vme_bridge *bridge)
-{
-	struct device *dev;
-	int retval;
-	int i;
-
-	retval = vme_register_bus(bridge);
-	if (retval)
-		return retval;
-
-	/* This creates 32 vme "slot" devices. This equates to a slot for each
-	 * ID available in a system conforming to the ANSI/VITA 1-1994
-	 * specification.
-	 */
-	for (i = 0; i < VME_SLOTS_MAX; i++) {
-		dev = &bridge->dev[i];
-		memset(dev, 0, sizeof(struct device));
-
-		dev->parent = bridge->parent;
-		dev->bus = &vme_bus_type;
-		dev->release = vme_dev_release;
-		/*
-		 * We save a pointer to the bridge in platform_data so that we
-		 * can get to it later. We keep driver_data for use by the
-		 * driver that binds against the slot
-		 */
-		dev->platform_data = bridge;
-		dev_set_name(dev, "vme-%x.%x", bridge->num, i + 1);
-
-		retval = device_register(dev);
-		if (retval)
-			goto err_reg;
-	}
-
-	return retval;
-
-	i = VME_SLOTS_MAX;
-err_reg:
-	while (i > -1) {
-		dev = &bridge->dev[i];
-		device_unregister(dev);
-	}
-	vme_unregister_bus(bridge);
-	return retval;
-}
-EXPORT_SYMBOL(vme_register_bridge);
-
-void vme_unregister_bridge(struct vme_bridge *bridge)
-{
-	int i;
-	struct device *dev;
-
-
-	for (i = 0; i < VME_SLOTS_MAX; i++) {
-		dev = &bridge->dev[i];
-		device_unregister(dev);
-	}
-	vme_unregister_bus(bridge);
-}
-EXPORT_SYMBOL(vme_unregister_bridge);
-
 /**
  * vme_register_bridge_ng - register a VME bridge in the VME core
  * @bridge:	VME bridge to register
@@ -1524,21 +1384,6 @@ EXPORT_SYMBOL(vme_unregister_bridge_ng);
 
 /* - Driver Registration --------------------------------------------------- */
 
-int vme_register_driver(struct vme_driver *drv)
-{
-	drv->driver.name = drv->name;
-	drv->driver.bus = &vme_bus_type;
-
-	return driver_register(&drv->driver);
-}
-EXPORT_SYMBOL(vme_register_driver);
-
-void vme_unregister_driver(struct vme_driver *drv)
-{
-	driver_unregister(&drv->driver);
-}
-EXPORT_SYMBOL(vme_unregister_driver);
-
 static void vme_dev_release_ng(struct device *dev)
 {
 	kfree(to_vme_dev(dev));
@@ -1666,111 +1511,6 @@ EXPORT_SYMBOL(vme_register_driver_ng);
 
 /* - Bus Registration ------------------------------------------------------ */
 
-static int vme_calc_slot(struct device *dev)
-{
-	struct vme_bridge *bridge;
-	int num;
-
-	bridge = dev_to_bridge(dev);
-
-	/* Determine slot number */
-	num = 0;
-	while (num < VME_SLOTS_MAX) {
-		if (&bridge->dev[num] == dev)
-			break;
-
-		num++;
-	}
-	if (num == VME_SLOTS_MAX) {
-		dev_err(dev, "Failed to identify slot\n");
-		num = 0;
-		goto err_dev;
-	}
-	num++;
-
-err_dev:
-	return num;
-}
-
-static struct vme_driver *dev_to_vme_driver(struct device *dev)
-{
-	if (dev->driver == NULL)
-		printk(KERN_ERR "Bugger dev->driver is NULL\n");
-
-	return container_of(dev->driver, struct vme_driver, driver);
-}
-
-static int vme_bus_match(struct device *dev, struct device_driver *drv)
-{
-	struct vme_bridge *bridge;
-	struct vme_driver *driver;
-	int i, num;
-
-	bridge = dev_to_bridge(dev);
-	driver = container_of(drv, struct vme_driver, driver);
-
-	num = vme_calc_slot(dev);
-	if (!num)
-		goto err_dev;
-
-	if (driver->bind_table == NULL) {
-		dev_err(dev, "Bind table NULL\n");
-		goto err_table;
-	}
-
-	i = 0;
-	while ((driver->bind_table[i].bus != 0) ||
-		(driver->bind_table[i].slot != 0)) {
-
-		if (bridge->num == driver->bind_table[i].bus) {
-			if (num == driver->bind_table[i].slot)
-				return 1;
-
-			if (driver->bind_table[i].slot == VME_SLOT_ALL)
-				return 1;
-
-			if ((driver->bind_table[i].slot == VME_SLOT_CURRENT) &&
-				(num == vme_slot_get(dev)))
-				return 1;
-		}
-		i++;
-	}
-
-err_dev:
-err_table:
-	return 0;
-}
-
-static int vme_bus_probe(struct device *dev)
-{
-	struct vme_bridge *bridge;
-	struct vme_driver *driver;
-	int retval = -ENODEV;
-
-	driver = dev_to_vme_driver(dev);
-	bridge = dev_to_bridge(dev);
-
-	if (driver->probe != NULL)
-		retval = driver->probe(dev, bridge->num, vme_calc_slot(dev));
-
-	return retval;
-}
-
-static int vme_bus_remove(struct device *dev)
-{
-	struct vme_bridge *bridge;
-	struct vme_driver *driver;
-	int retval = -ENODEV;
-
-	driver = dev_to_vme_driver(dev);
-	bridge = dev_to_bridge(dev);
-
-	if (driver->remove != NULL)
-		retval = driver->remove(dev, bridge->num, vme_calc_slot(dev));
-
-	return retval;
-}
-
 static int vme_bus_match_ng(struct device *dev, struct device_driver *drv)
 {
 	struct vme_driver_ng *vme_driver = to_vme_driver_ng(drv);
diff --git a/drivers/staging/vme/vme.h b/drivers/staging/vme/vme.h
index a5dd284..0d9cfb6 100644
--- a/drivers/staging/vme/vme.h
+++ b/drivers/staging/vme/vme.h
@@ -97,16 +97,6 @@ struct vme_device_id {
 	int slot;
 };
 
-struct vme_driver {
-	struct list_head node;
-	char *name;
-	const struct vme_device_id *bind_table;
-	int (*probe)  (struct device *, int, int);
-	int (*remove) (struct device *, int, int);
-	void (*shutdown) (void);
-	struct device_driver    driver;
-};
-
 /**
  * struct vme_driver_ng - represent a VME driver
  * @name: driver name
@@ -304,8 +294,6 @@ void vme_free_consistent(struct vme_resource *, size_t,  void *,
 
 size_t vme_get_size(struct vme_resource *);
 
-struct vme_resource *vme_slave_request(struct device *, vme_address_t,
-	vme_cycle_t);
 struct vme_resource *vme_slave_request_ng(struct vme_bridge *bridge,
 					  vme_address_t address,
 					  vme_cycle_t cycle);
@@ -315,8 +303,6 @@ int vme_slave_get(struct vme_resource *, int *, unsigned long long *,
 	unsigned long long *, dma_addr_t *, vme_address_t *, vme_cycle_t *);
 void vme_slave_free(struct vme_resource *);
 
-struct vme_resource *vme_master_request(struct device *, vme_address_t,
-	vme_cycle_t, vme_width_t);
 struct vme_resource *vme_master_request_ng(struct vme_bridge *bridge,
 					   vme_address_t address,
 					   vme_cycle_t cycle,
@@ -331,7 +317,6 @@ unsigned int vme_master_rmw(struct vme_resource *, unsigned int, unsigned int,
 	unsigned int, loff_t);
 void vme_master_free(struct vme_resource *);
 
-struct vme_resource *vme_dma_request(struct device *, vme_dma_route_t);
 struct vme_resource *vme_dma_request_ng(struct vme_bridge *bridge, vme_dma_route_t route);
 struct vme_dma_list *vme_new_dma_list(struct vme_resource *);
 struct vme_dma_attr *vme_dma_pattern_attribute(u32, vme_pattern_t);
@@ -345,16 +330,11 @@ int vme_dma_list_exec(struct vme_dma_list *);
 int vme_dma_list_free(struct vme_dma_list *);
 int vme_dma_free(struct vme_resource *);
 
-int vme_irq_request(struct device *, int, int,
-	void (*callback)(int, int, void *), void *);
 int vme_irq_request_ng(struct vme_bridge *bridge, int level, int statid,
 		       void (*callback)(int, int, void *), void *priv_data);
-void vme_irq_free(struct device *, int, int);
 void vme_irq_free_ng(struct vme_bridge *bridge, int level, int statid);
-int vme_irq_generate(struct device *, int, int);
 int vme_irq_generate_ng(struct vme_bridge *bridge, int level, int statid);
 
-struct vme_resource * vme_lm_request(struct device *);
 struct vme_resource *vme_lm_request_ng(struct vme_bridge *bridge);
 int vme_lm_count(struct vme_resource *);
 int vme_lm_set(struct vme_resource *, unsigned long long, vme_address_t,
@@ -367,9 +347,7 @@ void vme_lm_free(struct vme_resource *);
 
 int vme_slot_get(struct device *);
 
-int vme_register_driver(struct vme_driver *);
 int vme_register_driver_ng(struct vme_driver_ng *vme_driver, unsigned int n_devs);
-void vme_unregister_driver(struct vme_driver *);
 void vme_unregister_driver_ng(struct vme_driver_ng *vme_driver);
 
 struct vme_bridge *vme_get_bridge(unsigned int bus_id);
@@ -377,9 +355,7 @@ void vme_put_bridge(struct vme_bridge *bridge);
 
 /* functions for VME bridges */
 void vme_irq_handler(struct vme_bridge *, int, int);
-int vme_register_bridge(struct vme_bridge *);
 int vme_register_bridge_ng(struct vme_bridge *bridge);
-void vme_unregister_bridge(struct vme_bridge *);
 void vme_unregister_bridge_ng(struct vme_bridge *bridge);
 
 
-- 
1.7.1


  parent reply	other threads:[~2010-10-22  7:15 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-22  6:36 [-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
2010-10-22  6:36 ` [PATCH 01/30] staging/vme: style: convert '&(foo)' to '&foo' Emilio G. Cota
2010-10-22  6:36 ` [PATCH 02/30] staging/vme_user: return the appropriate error code when module_init fails Emilio G. Cota
2010-10-22  6:36 ` [PATCH 03/30] staging/vme_user: remove unreachable line Emilio G. Cota
2010-10-22  6:36 ` [PATCH 04/30] staging/vme: allow non-dynamic allocation of bus numbers Emilio G. Cota
2010-10-22  6:36 ` [PATCH 05/30] staging/vme: fix bogus clearing of the bus number in vme_free_bus_num Emilio G. Cota
2010-10-22  6:36 ` [PATCH 06/30] staging/vme/tsi148: use list_for_each_safe when deleting resources in .remove Emilio G. Cota
2010-10-22  6:36 ` [PATCH 07/30] staging/vme/tsi148: remove double freeing of the IRQ " Emilio G. Cota
2010-10-22  6:36 ` [PATCH 08/30] staging/vme/tsi148: fix warning in free_irq Emilio G. Cota
2010-10-22  6:36 ` [PATCH 09/30] staging/vme: fill in struct device's .release, even if it's a NOOP Emilio G. Cota
2010-10-22  6:36 ` [PATCH 10/30] staging/vme/tsi148: remove unreachable line Emilio G. Cota
2010-10-22  6:36 ` [PATCH 11/30] staging/vme/tsi148: declare static functions as such Emilio G. Cota
2010-10-22  6:36 ` [PATCH 12/30] staging/vme/ca91cx42: " Emilio G. Cota
2010-10-22  6:36 ` [PATCH 13/30] staging/vme_user: declare private variables as static Emilio G. Cota
2010-10-22  6:36 ` [PATCH 14/30] staging/vme_user: use an unsigned int for counting the number of kparams Emilio G. Cota
2010-10-22  6:36 ` [PATCH 15/30] staging/vme_user: remove __iomem marking from kern_buf and derivates Emilio G. Cota
2010-10-22  6:36 ` [PATCH 16/30] staging/vme_user: mark user-space buffers with __user Emilio G. Cota
2010-10-22  6:36 ` [PATCH 17/30] staging/vme: mark struct vme_master_resource's base address pointer as __iomem Emilio G. Cota
2010-10-22  6:36 ` [PATCH 18/30] staging/vme/tsi148: mark the registers' " Emilio G. Cota
2010-10-22  6:36 ` [PATCH 19/30] staging/vme/ca91cx42: " Emilio G. Cota
2010-10-22  6:36 ` [PATCH 20/30] staging/vme: trivial: rename vme_bus_num_mtx to vme_buses_lock Emilio G. Cota
2010-10-22  6:36 ` [PATCH 21/30] staging/vme: keep a list of registered buses (bridges) Emilio G. Cota
2010-10-22  6:36 ` [PATCH 22/30] staging/vme/vme_user: use __dev{init,exit} for .probe and .remove Emilio G. Cota
2010-10-22  6:36 ` [PATCH 23/30] staging/vme_user: fix usage of the slave resources after they've been freed Emilio G. Cota
2010-10-22  6:36 ` [PATCH 24/30] staging/vme_user: remove unnecessary call to vme_slave_set Emilio G. Cota
2010-10-22  6:36 ` [PATCH 25/30] staging/vme_user: add missing calls to vme_master_free calls in .remove Emilio G. Cota
2010-10-22  6:36 ` [PATCH 26/30] staging/vme: move all contents of vme_bridge.h to vme.h Emilio G. Cota
2010-10-22  6:36 ` [PATCH 27/30] staging/vme: rework the bus model Emilio G. Cota
2010-10-22 23:27   ` Emilio G. Cota
2010-10-25 11:24     ` Martyn Welch
2010-10-26  1:02       ` Emilio G. Cota
2010-10-27  9:16         ` Martyn Welch
2010-10-27 15:40           ` Emilio G. Cota
2010-10-22  6:36 ` [PATCH 28/30] staging/vme: convert vme_* users to vme_*_ng Emilio G. Cota
2010-10-22  6:36 ` Emilio G. Cota [this message]
2010-10-22  6:36 ` [PATCH 30/30] staging/vme: remove _ng suffixes Emilio G. Cota
2010-10-22  9:26 ` [-next] staging/vme: various fixes + new driver model for VME Martyn Welch
2010-10-22 23:03   ` Emilio G. Cota
2010-10-22 10:08 ` Martyn Welch
2010-10-22 23:04   ` Emilio G. Cota
2010-10-22 13:56 ` Greg KH
2010-10-22 22:56   ` Emilio G. Cota
2010-10-26  1:10 [re-send][-next] " Emilio G. Cota
2010-10-26  1:11 ` [PATCH 29/30] staging/vme: remove unused vme_* functions and related code Emilio G. Cota

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1287729412-24356-30-git-send-email-cota@braap.org \
    --to=cota@braap.org \
    --cc=david.cobas@gmail.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martyn.welch@ge.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®