aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2012-09-06 14:11:15 -0400
committerFelipe Balbi <balbi@ti.com>2012-09-10 09:06:34 -0400
commit72258493ec4f77a772d05a8df5ee663e1e24154b (patch)
treebf9f06bb6c6d9776330dec4ff937664ceffcbc6d /drivers
parent40bfef0535e8a10486c9d81fd2f55e3b9dc71db6 (diff)
usb: gadget: make composite module options readonly only
This is a partly revert of 4fffd6e5 ("usb: gadget: composite: make module parameters accessible at runtime"). It is not possible to change the VID or other property for a gadget right now. This change has been made for Anrdoid gadget which has this functionality in its copy of the file. This function is executed currently only once and most caller in tree are __init. Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/composite.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 16b353fa160a..8d81a5ccfa03 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -34,27 +34,27 @@
34 */ 34 */
35 35
36static ushort idVendor; 36static ushort idVendor;
37module_param(idVendor, ushort, 0644); 37module_param(idVendor, ushort, S_IRUGO);
38MODULE_PARM_DESC(idVendor, "USB Vendor ID"); 38MODULE_PARM_DESC(idVendor, "USB Vendor ID");
39 39
40static ushort idProduct; 40static ushort idProduct;
41module_param(idProduct, ushort, 0644); 41module_param(idProduct, ushort, S_IRUGO);
42MODULE_PARM_DESC(idProduct, "USB Product ID"); 42MODULE_PARM_DESC(idProduct, "USB Product ID");
43 43
44static ushort bcdDevice; 44static ushort bcdDevice;
45module_param(bcdDevice, ushort, 0644); 45module_param(bcdDevice, ushort, S_IRUGO);
46MODULE_PARM_DESC(bcdDevice, "USB Device version (BCD)"); 46MODULE_PARM_DESC(bcdDevice, "USB Device version (BCD)");
47 47
48static char *iManufacturer; 48static char *iManufacturer;
49module_param(iManufacturer, charp, 0644); 49module_param(iManufacturer, charp, S_IRUGO);
50MODULE_PARM_DESC(iManufacturer, "USB Manufacturer string"); 50MODULE_PARM_DESC(iManufacturer, "USB Manufacturer string");
51 51
52static char *iProduct; 52static char *iProduct;
53module_param(iProduct, charp, 0644); 53module_param(iProduct, charp, S_IRUGO);
54MODULE_PARM_DESC(iProduct, "USB Product string"); 54MODULE_PARM_DESC(iProduct, "USB Product string");
55 55
56static char *iSerialNumber; 56static char *iSerialNumber;
57module_param(iSerialNumber, charp, 0644); 57module_param(iSerialNumber, charp, S_IRUGO);
58MODULE_PARM_DESC(iSerialNumber, "SerialNumber string"); 58MODULE_PARM_DESC(iSerialNumber, "SerialNumber string");
59 59
60static char composite_manufacturer[50]; 60static char composite_manufacturer[50];
@@ -1478,16 +1478,12 @@ static int composite_bind(struct usb_gadget *gadget,
1478 /* standardized runtime overrides for device ID data */ 1478 /* standardized runtime overrides for device ID data */
1479 if (idVendor) 1479 if (idVendor)
1480 cdev->desc.idVendor = cpu_to_le16(idVendor); 1480 cdev->desc.idVendor = cpu_to_le16(idVendor);
1481 else 1481
1482 idVendor = le16_to_cpu(cdev->desc.idVendor);
1483 if (idProduct) 1482 if (idProduct)
1484 cdev->desc.idProduct = cpu_to_le16(idProduct); 1483 cdev->desc.idProduct = cpu_to_le16(idProduct);
1485 else 1484
1486 idProduct = le16_to_cpu(cdev->desc.idProduct);
1487 if (bcdDevice) 1485 if (bcdDevice)
1488 cdev->desc.bcdDevice = cpu_to_le16(bcdDevice); 1486 cdev->desc.bcdDevice = cpu_to_le16(bcdDevice);
1489 else
1490 bcdDevice = le16_to_cpu(cdev->desc.bcdDevice);
1491 1487
1492 /* string overrides */ 1488 /* string overrides */
1493 if (iManufacturer || !cdev->desc.iManufacturer) { 1489 if (iManufacturer || !cdev->desc.iManufacturer) {