From: Vikram Pandita Date: Tue, 10 Nov 2009 03:24:32 +0000 (-0600) Subject: usbtest: make module param pattern writeable X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7f4e985448e82fe4a1cc0ae4fcecaf7e0301c07b;p=linux-beck.git usbtest: make module param pattern writeable Allow module_param to be writeable. This allows us to change the parameter if usbtest is built-in in the kernel. Signed-off-by: Vikram Pandita Signed-off-by: Anand Gadiyar Cc: David Brownell Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index a9f06d76960f..3dab0c0b196f 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drivers/usb/misc/usbtest.c @@ -213,8 +213,9 @@ static struct urb *simple_alloc_urb ( } static unsigned pattern = 0; -module_param (pattern, uint, S_IRUGO); -MODULE_PARM_DESC(pattern, "i/o pattern (0 == zeroes)"); +static unsigned mod_pattern; +module_param_named(pattern, mod_pattern, uint, S_IRUGO | S_IWUSR); +MODULE_PARM_DESC(mod_pattern, "i/o pattern (0 == zeroes)"); static inline void simple_fill_buf (struct urb *urb) { @@ -1567,6 +1568,8 @@ usbtest_ioctl (struct usb_interface *intf, unsigned int code, void *buf) // FIXME USBDEVFS_CONNECTINFO doesn't say how fast the device is. + pattern = mod_pattern; + if (code != USBTEST_REQUEST) return -EOPNOTSUPP;