Skip to content

Commit

Permalink
Merge tag 'fixes-for-v3.11-rc3' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/kernel/git/balbi/usb into usb-linus

Felipe writes:

usb: fixes for v3.11-rc3

Here are some fixes for v3.11-rc3. Mostly related to
the recent conversion to configfs done on the gadget
drivers, but we also have a fix for MUSB resources
on platforms which need 3 resources instead of 2, and
a fix for the sysfs_notify() call on udc-core.c which
was notifying an unexistent file.
  • Loading branch information
Greg Kroah-Hartman committed Jul 29, 2013
2 parents 683a0e4 + 1894870 commit 235d57e
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 16 deletions.
14 changes: 10 additions & 4 deletions drivers/usb/gadget/ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,14 +449,20 @@ static int __init eth_bind(struct usb_composite_dev *cdev)

static int __exit eth_unbind(struct usb_composite_dev *cdev)
{
if (has_rndis())
if (has_rndis()) {
usb_put_function(f_rndis);
usb_put_function_instance(fi_rndis);
if (use_eem)
}
if (use_eem) {
usb_put_function(f_eem);
usb_put_function_instance(fi_eem);
else if (can_support_ecm(cdev->gadget))
} else if (can_support_ecm(cdev->gadget)) {
usb_put_function(f_ecm);
usb_put_function_instance(fi_ecm);
else
} else {
usb_put_function(f_geth);
usb_put_function_instance(fi_geth);
}
return 0;
}

Expand Down
2 changes: 0 additions & 2 deletions drivers/usb/gadget/f_phonet.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,6 @@ static int pn_bind(struct usb_configuration *c, struct usb_function *f)
struct usb_ep *ep;
int status, i;

#ifndef USBF_PHONET_INCLUDED
struct f_phonet_opts *phonet_opts;

phonet_opts = container_of(f->fi, struct f_phonet_opts, func_inst);
Expand All @@ -507,7 +506,6 @@ static int pn_bind(struct usb_configuration *c, struct usb_function *f)
return status;
phonet_opts->bound = true;
}
#endif

/* Reserve interface IDs */
status = usb_interface_id(c, f);
Expand Down
10 changes: 3 additions & 7 deletions drivers/usb/gadget/multi.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,8 @@ static __init int rndis_do_config(struct usb_configuration *c)
return ret;

f_acm_rndis = usb_get_function(fi_acm);
if (IS_ERR(f_acm_rndis)) {
ret = PTR_ERR(f_acm_rndis);
goto err_func_acm;
}
if (IS_ERR(f_acm_rndis))
return PTR_ERR(f_acm_rndis);

ret = usb_add_function(c, f_acm_rndis);
if (ret)
Expand All @@ -178,7 +176,6 @@ static __init int rndis_do_config(struct usb_configuration *c)
usb_remove_function(c, f_acm_rndis);
err_conf:
usb_put_function(f_acm_rndis);
err_func_acm:
return ret;
}

Expand Down Expand Up @@ -226,7 +223,7 @@ static __init int cdc_do_config(struct usb_configuration *c)
/* implicit port_num is zero */
f_acm_multi = usb_get_function(fi_acm);
if (IS_ERR(f_acm_multi))
goto err_func_acm;
return PTR_ERR(f_acm_multi);

ret = usb_add_function(c, f_acm_multi);
if (ret)
Expand All @@ -241,7 +238,6 @@ static __init int cdc_do_config(struct usb_configuration *c)
usb_remove_function(c, f_acm_multi);
err_conf:
usb_put_function(f_acm_multi);
err_func_acm:
return ret;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/udc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void usb_gadget_set_state(struct usb_gadget *gadget,
enum usb_device_state state)
{
gadget->state = state;
sysfs_notify(&gadget->dev.kobj, NULL, "status");
sysfs_notify(&gadget->dev.kobj, NULL, "state");
}
EXPORT_SYMBOL_GPL(usb_gadget_set_state);

Expand Down
7 changes: 6 additions & 1 deletion drivers/usb/musb/omap2430.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ static u64 omap2430_dmamask = DMA_BIT_MASK(32);

static int omap2430_probe(struct platform_device *pdev)
{
struct resource musb_resources[2];
struct resource musb_resources[3];
struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
struct omap_musb_board_data *data;
struct platform_device *musb;
Expand Down Expand Up @@ -581,6 +581,11 @@ static int omap2430_probe(struct platform_device *pdev)
musb_resources[1].end = pdev->resource[1].end;
musb_resources[1].flags = pdev->resource[1].flags;

musb_resources[2].name = pdev->resource[2].name;
musb_resources[2].start = pdev->resource[2].start;
musb_resources[2].end = pdev->resource[2].end;
musb_resources[2].flags = pdev->resource[2].flags;

ret = platform_device_add_resources(musb, musb_resources,
ARRAY_SIZE(musb_resources));
if (ret) {
Expand Down
7 changes: 6 additions & 1 deletion drivers/usb/musb/tusb6010.c
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@ static u64 tusb_dmamask = DMA_BIT_MASK(32);

static int tusb_probe(struct platform_device *pdev)
{
struct resource musb_resources[2];
struct resource musb_resources[3];
struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
struct platform_device *musb;
struct tusb6010_glue *glue;
Expand Down Expand Up @@ -1199,6 +1199,11 @@ static int tusb_probe(struct platform_device *pdev)
musb_resources[1].end = pdev->resource[1].end;
musb_resources[1].flags = pdev->resource[1].flags;

musb_resources[2].name = pdev->resource[2].name;
musb_resources[2].start = pdev->resource[2].start;
musb_resources[2].end = pdev->resource[2].end;
musb_resources[2].flags = pdev->resource[2].flags;

ret = platform_device_add_resources(musb, musb_resources,
ARRAY_SIZE(musb_resources));
if (ret) {
Expand Down

0 comments on commit 235d57e

Please sign in to comment.