diff options
| author | Andrzej Pietrasiewicz <andrzej.p@samsung.com> | 2012-05-10 04:07:59 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-05-10 15:22:43 -0400 |
| commit | 4fffd6e5a24c4df3341d404446e3672bef8cffb7 (patch) | |
| tree | c853ab3a6d670f1638855769023ed1603d484b8e | |
| parent | 02e8161e341b4e54a4a36233f98b79763bfa3f48 (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>
| -rw-r--r-- | drivers/usb/gadget/composite.c | 18 |
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 | ||
| 42 | static ushort idVendor; | 42 | static ushort idVendor; |
| 43 | module_param(idVendor, ushort, 0); | 43 | module_param(idVendor, ushort, 0644); |
| 44 | MODULE_PARM_DESC(idVendor, "USB Vendor ID"); | 44 | MODULE_PARM_DESC(idVendor, "USB Vendor ID"); |
| 45 | 45 | ||
| 46 | static ushort idProduct; | 46 | static ushort idProduct; |
| 47 | module_param(idProduct, ushort, 0); | 47 | module_param(idProduct, ushort, 0644); |
| 48 | MODULE_PARM_DESC(idProduct, "USB Product ID"); | 48 | MODULE_PARM_DESC(idProduct, "USB Product ID"); |
| 49 | 49 | ||
| 50 | static ushort bcdDevice; | 50 | static ushort bcdDevice; |
| 51 | module_param(bcdDevice, ushort, 0); | 51 | module_param(bcdDevice, ushort, 0644); |
| 52 | MODULE_PARM_DESC(bcdDevice, "USB Device version (BCD)"); | 52 | MODULE_PARM_DESC(bcdDevice, "USB Device version (BCD)"); |
| 53 | 53 | ||
| 54 | static char *iManufacturer; | 54 | static char *iManufacturer; |
| 55 | module_param(iManufacturer, charp, 0); | 55 | module_param(iManufacturer, charp, 0644); |
| 56 | MODULE_PARM_DESC(iManufacturer, "USB Manufacturer string"); | 56 | MODULE_PARM_DESC(iManufacturer, "USB Manufacturer string"); |
| 57 | 57 | ||
| 58 | static char *iProduct; | 58 | static char *iProduct; |
| 59 | module_param(iProduct, charp, 0); | 59 | module_param(iProduct, charp, 0644); |
| 60 | MODULE_PARM_DESC(iProduct, "USB Product string"); | 60 | MODULE_PARM_DESC(iProduct, "USB Product string"); |
| 61 | 61 | ||
| 62 | static char *iSerialNumber; | 62 | static char *iSerialNumber; |
| 63 | module_param(iSerialNumber, charp, 0); | 63 | module_param(iSerialNumber, charp, 0644); |
| 64 | MODULE_PARM_DESC(iSerialNumber, "SerialNumber string"); | 64 | MODULE_PARM_DESC(iSerialNumber, "SerialNumber string"); |
| 65 | 65 | ||
| 66 | static char composite_manufacturer[50]; | 66 | static 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) { |
