Skip to content

Commit 7f4e985

Browse files
Vikram Panditagregkh
authored andcommitted
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 <vikram.pandita@ti.com> Signed-off-by: Anand Gadiyar <gadiyar@ti.com> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent ed7487c commit 7f4e985

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎drivers/usb/misc/usbtest.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,9 @@ static struct urb *simple_alloc_urb (
213213
}
214214

215215
static unsigned pattern = 0;
216-
module_param (pattern, uint, S_IRUGO);
217-
MODULE_PARM_DESC(pattern, "i/o pattern (0 == zeroes)");
216+
static unsigned mod_pattern;
217+
module_param_named(pattern, mod_pattern, uint, S_IRUGO | S_IWUSR);
218+
MODULE_PARM_DESC(mod_pattern, "i/o pattern (0 == zeroes)");
218219

219220
static inline void simple_fill_buf (struct urb *urb)
220221
{
@@ -1567,6 +1568,8 @@ usbtest_ioctl (struct usb_interface *intf, unsigned int code, void *buf)
15671568

15681569
// FIXME USBDEVFS_CONNECTINFO doesn't say how fast the device is.
15691570

1571+
pattern = mod_pattern;
1572+
15701573
if (code != USBTEST_REQUEST)
15711574
return -EOPNOTSUPP;
15721575

0 commit comments

Comments
 (0)