mirror of https://github.com/OpenIPC/firmware.git
100 lines
2.3 KiB
Diff
100 lines
2.3 KiB
Diff
--- linux-4.9.37/drivers/usb/gadget/legacy/multi.c 2017-07-12 16:42:41.000000000 +0300
|
|
+++ linux-4.9.y/drivers/usb/gadget/legacy/multi.c 2021-06-07 13:01:34.000000000 +0300
|
|
@@ -162,21 +162,8 @@
|
|
if (ret)
|
|
goto err_conf;
|
|
|
|
- f_msg_rndis = usb_get_function(fi_msg);
|
|
- if (IS_ERR(f_msg_rndis)) {
|
|
- ret = PTR_ERR(f_msg_rndis);
|
|
- goto err_fsg;
|
|
- }
|
|
-
|
|
- ret = usb_add_function(c, f_msg_rndis);
|
|
- if (ret)
|
|
- goto err_run;
|
|
-
|
|
return 0;
|
|
-err_run:
|
|
- usb_put_function(f_msg_rndis);
|
|
-err_fsg:
|
|
- usb_remove_function(c, f_acm_rndis);
|
|
+
|
|
err_conf:
|
|
usb_put_function(f_acm_rndis);
|
|
err_func_acm:
|
|
@@ -245,16 +232,6 @@
|
|
if (ret)
|
|
goto err_conf;
|
|
|
|
- f_msg_multi = usb_get_function(fi_msg);
|
|
- if (IS_ERR(f_msg_multi)) {
|
|
- ret = PTR_ERR(f_msg_multi);
|
|
- goto err_fsg;
|
|
- }
|
|
-
|
|
- ret = usb_add_function(c, f_msg_multi);
|
|
- if (ret)
|
|
- goto err_run;
|
|
-
|
|
return 0;
|
|
err_run:
|
|
usb_put_function(f_msg_multi);
|
|
@@ -304,8 +281,7 @@
|
|
#ifdef USB_ETH_RNDIS
|
|
struct f_rndis_opts *rndis_opts;
|
|
#endif
|
|
- struct fsg_opts *fsg_opts;
|
|
- struct fsg_config config;
|
|
+
|
|
int status;
|
|
|
|
if (!can_support_ecm(cdev->gadget)) {
|
|
@@ -367,32 +343,6 @@
|
|
goto fail0;
|
|
}
|
|
|
|
- /* set up mass storage function */
|
|
- fi_msg = usb_get_function_instance("mass_storage");
|
|
- if (IS_ERR(fi_msg)) {
|
|
- status = PTR_ERR(fi_msg);
|
|
- goto fail1;
|
|
- }
|
|
- fsg_config_from_params(&config, &fsg_mod_data, fsg_num_buffers);
|
|
- fsg_opts = fsg_opts_from_func_inst(fi_msg);
|
|
-
|
|
- fsg_opts->no_configfs = true;
|
|
- status = fsg_common_set_num_buffers(fsg_opts->common, fsg_num_buffers);
|
|
- if (status)
|
|
- goto fail2;
|
|
-
|
|
- status = fsg_common_set_cdev(fsg_opts->common, cdev, config.can_stall);
|
|
- if (status)
|
|
- goto fail_set_cdev;
|
|
-
|
|
- fsg_common_set_sysfs(fsg_opts->common, true);
|
|
- status = fsg_common_create_luns(fsg_opts->common, &config);
|
|
- if (status)
|
|
- goto fail_set_cdev;
|
|
-
|
|
- fsg_common_set_inquiry_string(fsg_opts->common, config.vendor_name,
|
|
- config.product_name);
|
|
-
|
|
/* allocate string IDs */
|
|
status = usb_string_ids_tab(cdev, strings_dev);
|
|
if (unlikely(status < 0))
|
|
@@ -430,13 +380,6 @@
|
|
kfree(otg_desc[0]);
|
|
otg_desc[0] = NULL;
|
|
fail_string_ids:
|
|
- fsg_common_remove_luns(fsg_opts->common);
|
|
-fail_set_cdev:
|
|
- fsg_common_free_buffers(fsg_opts->common);
|
|
-fail2:
|
|
- usb_put_function_instance(fi_msg);
|
|
-fail1:
|
|
- usb_put_function_instance(fi_acm);
|
|
fail0:
|
|
#ifdef USB_ETH_RNDIS
|
|
usb_put_function_instance(fi_rndis);
|