aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/composite.c
diff options
context:
space:
mode:
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>2012-05-10 04:07:59 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-10 15:22:43 -0400
commit4fffd6e5a24c4df3341d404446e3672bef8cffb7 (patch)
treec853ab3a6d670f1638855769023ed1603d484b8e /drivers/usb/gadget/composite.c
parent02e8161e341b4e54a4a36233f98b79763bfa3f48 (diff)
usb: gadget: composite: make module parameters accessible at runtime
Enable module parameters to be modified at runtime, especially if the module is compiled-in. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget/composite.c')
-rw-r--r--drivers/usb/gadget/composite.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index a8b8ab80bc77..df2749052e2c 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -40,27 +40,27 @@ static int (*composite_gadget_bind)(struct usb_composite_dev *cdev);
40 */ 40 */
41 41
42static ushort idVendor; 42static ushort idVendor;
43module_param(idVendor, ushort, 0); 43module_param(idVendor, ushort, 0644);
44MODULE_PARM_DESC(idVendor, "USB Vendor ID"); 44MODULE_PARM_DESC(idVendor, "USB Vendor ID");
45 45
46static ushort idProduct; 46static ushort idProduct;
47module_param(idProduct, ushort, 0); 47module_param(idProduct, ushort, 0644);
48MODULE_PARM_DESC(idProduct, "USB Product ID"); 48MODULE_PARM_DESC(idProduct, "USB Product ID");
49 49
50static ushort bcdDevice; 50static ushort bcdDevice;
51module_param(bcdDevice, ushort, 0); 51module_param(bcdDevice, ushort, 0644);
52MODULE_PARM_DESC(bcdDevice, "USB Device version (BCD)"); 52MODULE_PARM_DESC(bcdDevice, "USB Device version (BCD)");
53 53
54static char *iManufacturer; 54static char *iManufacturer;
55module_param(iManufacturer, charp, 0); 55module_param(iManufacturer, charp, 0644);
56MODULE_PARM_DESC(iManufacturer, "USB Manufacturer string"); 56MODULE_PARM_DESC(iManufacturer, "USB Manufacturer string");
57 57
58static char *iProduct; 58static char *iProduct;
59module_param(iProduct, charp, 0); 59module_param(iProduct, charp, 0644);
60MODULE_PARM_DESC(iProduct, "USB Product string"); 60MODULE_PARM_DESC(iProduct, "USB Product string");
61 61
62static char *iSerialNumber; 62static char *iSerialNumber;
63module_param(iSerialNumber, charp, 0); 63module_param(iSerialNumber, charp, 0644);
64MODULE_PARM_DESC(iSerialNumber, "SerialNumber string"); 64MODULE_PARM_DESC(iSerialNumber, "SerialNumber string");
65 65
66static char composite_manufacturer[50]; 66static char composite_manufacturer[50];
@@ -1473,10 +1473,16 @@ static int composite_bind(struct usb_gadget *gadget)
1473 /* standardized runtime overrides for device ID data */ 1473 /* standardized runtime overrides for device ID data */
1474 if (idVendor) 1474 if (idVendor)
1475 cdev->desc.idVendor = cpu_to_le16(idVendor); 1475 cdev->desc.idVendor = cpu_to_le16(idVendor);
1476 else
1477 idVendor = le16_to_cpu(cdev->desc.idVendor);
1476 if (idProduct) 1478 if (idProduct)
1477 cdev->desc.idProduct = cpu_to_le16(idProduct); 1479 cdev->desc.idProduct = cpu_to_le16(idProduct);
1480 else
1481 idProduct = le16_to_cpu(cdev->desc.idProduct);
1478 if (bcdDevice) 1482 if (bcdDevice)
1479 cdev->desc.bcdDevice = cpu_to_le16(bcdDevice); 1483 cdev->desc.bcdDevice = cpu_to_le16(bcdDevice);
1484 else
1485 bcdDevice = le16_to_cpu(cdev->desc.bcdDevice);
1480 1486
1481 /* string overrides */ 1487 /* string overrides */
1482 if (iManufacturer || !cdev->desc.iManufacturer) { 1488 if (iManufacturer || !cdev->desc.iManufacturer) {