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

Martyn Welch martyn.welch at ge.com
Thu Nov 7 09:08:13 UTC 2013


On 31/10/13 23:47, Aaron Sierra wrote:
> 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.
> 

The VME framework is designed to work in systems that have multiple VME
bridges (I have been assured in the past these do exist). The functionality to
support this is clearly still broken in this driver, however I'm not convinced
the right thing to do is to remove all traces of it.

Martyn

> 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");
> 


-- 
Martyn Welch (Lead Software Engineer)  | Registered in England and Wales
GE Intelligent Platforms               | (3828642) at 100 Barbirolli Square
T +44(0)1327322748                     | Manchester, M2 3AB
E martyn.welch at ge.com                  | VAT:GB 927559189


More information about the devel mailing list