staging: vme_user: accept bus_num of zero

Aaron Sierra asierra at xes-inc.com
Fri Sep 2 20:59:45 UTC 2016


The driver's bus_num parameter is used to select a VME bus during probe.
This parameter is used both as a boolean to indicate that probing should
occur as well as which bus should be probed. However, the first bus in
the system is bus zero, so this method prevents the first bus from being
accepted during probe.

This patch changes the default value of bus_num to -1, so that any
number in the range of 0 to VME_USER_BUS_MAX will be accepted during
probe.

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

diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index b95883b..fc660bd 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -45,7 +45,7 @@
 static const char driver_name[] = "vme_user";
 
 static int bus[VME_USER_BUS_MAX];
-static unsigned int bus_num;
+static int bus_num = -1;
 
 /* Currently Documentation/devices.txt defines the following for VME:
  *
@@ -735,12 +735,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.
 	 */
@@ -763,7 +757,6 @@ static int __init vme_user_init(void)
 	return retval;
 
 err_reg:
-err_nocard:
 	return retval;
 }
 
-- 
1.9.1



More information about the devel mailing list