summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/composite.c
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2012-09-06 20:11:15 +0200
committerFelipe Balbi <balbi@ti.com>2012-09-10 16:06:34 +0300
commit72258493ec4f77a772d05a8df5ee663e1e24154b (patch)
treebf9f06bb6c6d9776330dec4ff937664ceffcbc6d /drivers/usb/gadget/composite.c
parent40bfef0535e8a10486c9d81fd2f55e3b9dc71db6 (diff)
downloadop-kernel-dev-72258493ec4f77a772d05a8df5ee663e1e24154b.zip
op-kernel-dev-72258493ec4f77a772d05a8df5ee663e1e24154b.tar.gz
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/usb/gadget/composite.c')
-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 16b353f..8d81a5c 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -34,27 +34,27 @@
*/
static ushort idVendor;
-module_param(idVendor, ushort, 0644);
+module_param(idVendor, ushort, S_IRUGO);
MODULE_PARM_DESC(idVendor, "USB Vendor ID");
static ushort idProduct;
-module_param(idProduct, ushort, 0644);
+module_param(idProduct, ushort, S_IRUGO);
MODULE_PARM_DESC(idProduct, "USB Product ID");
static ushort bcdDevice;
-module_param(bcdDevice, ushort, 0644);
+module_param(bcdDevice, ushort, S_IRUGO);
MODULE_PARM_DESC(bcdDevice, "USB Device version (BCD)");
static char *iManufacturer;
-module_param(iManufacturer, charp, 0644);
+module_param(iManufacturer, charp, S_IRUGO);
MODULE_PARM_DESC(iManufacturer, "USB Manufacturer string");
static char *iProduct;
-module_param(iProduct, charp, 0644);
+module_param(iProduct, charp, S_IRUGO);
MODULE_PARM_DESC(iProduct, "USB Product string");
static char *iSerialNumber;
-module_param(iSerialNumber, charp, 0644);
+module_param(iSerialNumber, charp, S_IRUGO);
MODULE_PARM_DESC(iSerialNumber, "SerialNumber string");
static char composite_manufacturer[50];
@@ -1478,16 +1478,12 @@ static int composite_bind(struct usb_gadget *gadget,
/* standardized runtime overrides for device ID data */
if (idVendor)
cdev->desc.idVendor = cpu_to_le16(idVendor);
- else
- idVendor = le16_to_cpu(cdev->desc.idVendor);
+
if (idProduct)
cdev->desc.idProduct = cpu_to_le16(idProduct);
- else
- idProduct = le16_to_cpu(cdev->desc.idProduct);
+
if (bcdDevice)
cdev->desc.bcdDevice = cpu_to_le16(bcdDevice);
- else
- bcdDevice = le16_to_cpu(cdev->desc.bcdDevice);
/* string overrides */
if (iManufacturer || !cdev->desc.iManufacturer) {
OpenPOWER on IntegriCloud