[PATCH 3/3] vme_user: Remove superfluous bus module parameter

Aaron Sierra asierra at xes-inc.com
Thu Oct 31 23:47:59 UTC 2013


This patch removes the bus parameter since its primary function in
practice is to prevent the driver from registering itself with the VME
subsystem entirely unless some (any) value is passed via the parameter.

The bus module parameter seems to be provided as the basis for
supporting multiple VME buses. However, the remainder of the driver is
written to support a single VME bus.

Furthermore, this driver is registered using vme_register_driver from
the VME subsystem, which associates this driver with every bus in the
system regardless of values passed via the bus parameter.

Signed-off-by: Aaron Sierra <asierra at xes-inc.com>
---
 drivers/staging/vme/devices/vme_user.c |   23 -----------------------
 1 file changed, 23 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index e69f0cd..afe518f3 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -44,9 +44,6 @@
 static DEFINE_MUTEX(vme_user_mutex);
 static const char driver_name[] = "vme_user";
 
-static int bus[VME_USER_BUS_MAX];
-static unsigned int bus_num;
-
 /* Currently Documentation/devices.txt defines the following for VME:
  *
  * 221 char	VME bus
@@ -630,21 +627,6 @@ static int __init vme_user_init(void)
 
 	pr_info("VME User Space Access Driver\n");
 
-	if (bus_num == 0) {
-		pr_err("No cards, skipping registration\n");
-		retval = -ENODEV;
-		goto err_nocard;
-	}
-
-	/* Let's start by supporting one bus, we can support more than one
-	 * in future revisions if that ever becomes necessary.
-	 */
-	if (bus_num > VME_USER_BUS_MAX) {
-		pr_err("Driver only able to handle %d buses\n",
-		       VME_USER_BUS_MAX);
-		bus_num = VME_USER_BUS_MAX;
-	}
-
 	/*
 	 * Here we just register the maximum number of devices we can and
 	 * leave vme_user_match() to allow only 1 to go through to probe().
@@ -658,7 +640,6 @@ static int __init vme_user_init(void)
 	return retval;
 
 err_reg:
-err_nocard:
 	return retval;
 }
 
@@ -885,10 +866,6 @@ static void __exit vme_user_exit(void)
 	vme_unregister_driver(&vme_user_driver);
 }
 
-
-MODULE_PARM_DESC(bus, "Enumeration of VMEbus to which the driver is connected");
-module_param_array(bus, int, &bus_num, 0);
-
 MODULE_DESCRIPTION("VME User Space Access Driver");
 MODULE_AUTHOR("Martyn Welch <martyn.welch at ge.com");
 MODULE_LICENSE("GPL");
-- 
1.7.9.5



More information about the devel mailing list