Commit 05c3eebd authored by Jassi Brar's avatar Jassi Brar Committed by Greg Kroah-Hartman

USB: Gadget: Reorder driver name assignment

Reorder the driver->name assignment so the 'iProduct' could be initialized
as well if both 'name' and 'iProduct' come as NULL by default.

Also, remove the misplaced 'extern' keyword.
Signed-off-by: default avatarJassi Brar <jassi.brar@samsung.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent ff085de7
...@@ -1258,16 +1258,16 @@ static struct usb_gadget_driver composite_driver = { ...@@ -1258,16 +1258,16 @@ static struct usb_gadget_driver composite_driver = {
* while it was binding. That would usually be done in order to wait for * while it was binding. That would usually be done in order to wait for
* some userspace participation. * some userspace participation.
*/ */
extern int usb_composite_probe(struct usb_composite_driver *driver, int usb_composite_probe(struct usb_composite_driver *driver,
int (*bind)(struct usb_composite_dev *cdev)) int (*bind)(struct usb_composite_dev *cdev))
{ {
if (!driver || !driver->dev || !bind || composite) if (!driver || !driver->dev || !bind || composite)
return -EINVAL; return -EINVAL;
if (!driver->iProduct)
driver->iProduct = driver->name;
if (!driver->name) if (!driver->name)
driver->name = "composite"; driver->name = "composite";
if (!driver->iProduct)
driver->iProduct = driver->name;
composite_driver.function = (char *) driver->name; composite_driver.function = (char *) driver->name;
composite_driver.driver.name = driver->name; composite_driver.driver.name = driver->name;
composite = driver; composite = driver;
......
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