Commit 4fffd6e5 authored by Andrzej Pietrasiewicz's avatar Andrzej Pietrasiewicz Committed by Greg Kroah-Hartman

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: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 02e8161e
...@@ -40,27 +40,27 @@ static int (*composite_gadget_bind)(struct usb_composite_dev *cdev); ...@@ -40,27 +40,27 @@ static int (*composite_gadget_bind)(struct usb_composite_dev *cdev);
*/ */
static ushort idVendor; static ushort idVendor;
module_param(idVendor, ushort, 0); module_param(idVendor, ushort, 0644);
MODULE_PARM_DESC(idVendor, "USB Vendor ID"); MODULE_PARM_DESC(idVendor, "USB Vendor ID");
static ushort idProduct; static ushort idProduct;
module_param(idProduct, ushort, 0); module_param(idProduct, ushort, 0644);
MODULE_PARM_DESC(idProduct, "USB Product ID"); MODULE_PARM_DESC(idProduct, "USB Product ID");
static ushort bcdDevice; static ushort bcdDevice;
module_param(bcdDevice, ushort, 0); module_param(bcdDevice, ushort, 0644);
MODULE_PARM_DESC(bcdDevice, "USB Device version (BCD)"); MODULE_PARM_DESC(bcdDevice, "USB Device version (BCD)");
static char *iManufacturer; static char *iManufacturer;
module_param(iManufacturer, charp, 0); module_param(iManufacturer, charp, 0644);
MODULE_PARM_DESC(iManufacturer, "USB Manufacturer string"); MODULE_PARM_DESC(iManufacturer, "USB Manufacturer string");
static char *iProduct; static char *iProduct;
module_param(iProduct, charp, 0); module_param(iProduct, charp, 0644);
MODULE_PARM_DESC(iProduct, "USB Product string"); MODULE_PARM_DESC(iProduct, "USB Product string");
static char *iSerialNumber; static char *iSerialNumber;
module_param(iSerialNumber, charp, 0); module_param(iSerialNumber, charp, 0644);
MODULE_PARM_DESC(iSerialNumber, "SerialNumber string"); MODULE_PARM_DESC(iSerialNumber, "SerialNumber string");
static char composite_manufacturer[50]; static char composite_manufacturer[50];
...@@ -1473,10 +1473,16 @@ static int composite_bind(struct usb_gadget *gadget) ...@@ -1473,10 +1473,16 @@ static int composite_bind(struct usb_gadget *gadget)
/* standardized runtime overrides for device ID data */ /* standardized runtime overrides for device ID data */
if (idVendor) if (idVendor)
cdev->desc.idVendor = cpu_to_le16(idVendor); cdev->desc.idVendor = cpu_to_le16(idVendor);
else
idVendor = le16_to_cpu(cdev->desc.idVendor);
if (idProduct) if (idProduct)
cdev->desc.idProduct = cpu_to_le16(idProduct); cdev->desc.idProduct = cpu_to_le16(idProduct);
else
idProduct = le16_to_cpu(cdev->desc.idProduct);
if (bcdDevice) if (bcdDevice)
cdev->desc.bcdDevice = cpu_to_le16(bcdDevice); cdev->desc.bcdDevice = cpu_to_le16(bcdDevice);
else
bcdDevice = le16_to_cpu(cdev->desc.bcdDevice);
/* string overrides */ /* string overrides */
if (iManufacturer || !cdev->desc.iManufacturer) { if (iManufacturer || !cdev->desc.iManufacturer) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment