From 8a695524173c45ecc7957ef01a9580f526295835 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Tue, 9 May 2017 21:47:02 +0200 Subject: usb: gadget: f_accessory: remove unused acc_bind_config function The Android Accessory function driver has a function without any callers, resulting in a harmless build warning: drivers/usb/gadget/function/f_accessory.c:1182:12: warning: 'acc_bind_config' defined but not used [-Wunused-function] Removing the function and associated code gets rid of the warning and has no other effect. Fixes: d588b95d59fd ("usb: gadget: accessory: Add Android Accessory function") Cc: Anson Jacob Cc: Badhri Jagan Sridharan Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/function/f_accessory.c | 60 +++++-------------------------- 1 file changed, 9 insertions(+), 51 deletions(-) diff --git a/drivers/usb/gadget/function/f_accessory.c b/drivers/usb/gadget/function/f_accessory.c index ec47b20e8fd1..8187d6ba0f7e 100644 --- a/drivers/usb/gadget/function/f_accessory.c +++ b/drivers/usb/gadget/function/f_accessory.c @@ -917,8 +917,7 @@ err: EXPORT_SYMBOL_GPL(acc_ctrlrequest); static int -__acc_function_bind(struct usb_configuration *c, - struct usb_function *f, bool configfs) +acc_function_bind_configfs(struct usb_configuration *c, struct usb_function *f) { struct usb_composite_dev *cdev = c->cdev; struct acc_dev *dev = func_to_dev(f); @@ -927,16 +926,15 @@ __acc_function_bind(struct usb_configuration *c, DBG(cdev, "acc_function_bind dev: %p\n", dev); - if (configfs) { - if (acc_string_defs[INTERFACE_STRING_INDEX].id == 0) { - ret = usb_string_id(c->cdev); - if (ret < 0) - return ret; - acc_string_defs[INTERFACE_STRING_INDEX].id = ret; - acc_interface_desc.iInterface = ret; - } - dev->cdev = c->cdev; + if (acc_string_defs[INTERFACE_STRING_INDEX].id == 0) { + ret = usb_string_id(c->cdev); + if (ret < 0) + return ret; + acc_string_defs[INTERFACE_STRING_INDEX].id = ret; + acc_interface_desc.iInterface = ret; } + dev->cdev = c->cdev; + ret = hid_register_driver(&acc_hid_driver); if (ret) return ret; @@ -969,17 +967,6 @@ __acc_function_bind(struct usb_configuration *c, return 0; } -static int -acc_function_bind(struct usb_configuration *c, struct usb_function *f) { - return __acc_function_bind(c, f, false); -} - -static int -acc_function_bind_configfs(struct usb_configuration *c, - struct usb_function *f) { - return __acc_function_bind(c, f, true); -} - static void kill_all_hid_devices(struct acc_dev *dev) { @@ -1179,35 +1166,6 @@ static void acc_function_disable(struct usb_function *f) VDBG(cdev, "%s disabled\n", dev->function.name); } -static int __maybe_unused acc_bind_config(struct usb_configuration *c) -{ - struct acc_dev *dev = _acc_dev; - int ret; - - printk(KERN_INFO "acc_bind_config\n"); - - /* allocate a string ID for our interface */ - if (acc_string_defs[INTERFACE_STRING_INDEX].id == 0) { - ret = usb_string_id(c->cdev); - if (ret < 0) - return ret; - acc_string_defs[INTERFACE_STRING_INDEX].id = ret; - acc_interface_desc.iInterface = ret; - } - - dev->cdev = c->cdev; - dev->function.name = "accessory"; - dev->function.strings = acc_strings, - dev->function.fs_descriptors = fs_acc_descs; - dev->function.hs_descriptors = hs_acc_descs; - dev->function.bind = acc_function_bind; - dev->function.unbind = acc_function_unbind; - dev->function.set_alt = acc_function_set_alt; - dev->function.disable = acc_function_disable; - - return usb_add_function(c, &dev->function); -} - static int acc_setup(void) { struct acc_dev *dev; -- cgit v1.2.3