ANDROID: usb: gadget: cleanup: fix unused variable and function warnings
Remove unused variables and functions to fix following
build warnings:
CC drivers/usb/gadget/configfs.o
drivers/usb/gadget/configfs.c: In function ‘gadgets_make’:
drivers/usb/gadget/configfs.c:1710:6: warning: unused variable ‘err’ [-Wunused-variable]
int err;
^
drivers/usb/gadget/configfs.c:1709:27: warning: unused variable ‘attr’ [-Wunused-variable]
struct device_attribute *attr;
^
drivers/usb/gadget/configfs.c:1708:28: warning: unused variable ‘attrs’ [-Wunused-variable]
struct device_attribute **attrs;
^
drivers/usb/gadget/configfs.c: In function ‘gadgets_drop’:
drivers/usb/gadget/configfs.c:1774:27: warning: unused variable ‘attr’ [-Wunused-variable]
struct device_attribute *attr;
^
drivers/usb/gadget/configfs.c:1773:28: warning: unused variable ‘attrs’ [-Wunused-variable]
struct device_attribute **attrs;
^
<snip>...
CC drivers/usb/gadget/function/f_mtp.o
drivers/usb/gadget/function/f_mtp.c:1219:12: warning: ‘mtp_bind_config’ defined but not used [-Wunused-function]
static int mtp_bind_config(struct usb_configuration *c, bool ptp_config)
^
drivers/usb/gadget/function/f_mtp.c:1300:12: warning: ‘mtp_setup’ defined but not used [-Wunused-function]
static int mtp_setup(void)
^
<snip>...
CC drivers/usb/gadget/function/f_accessory.o
drivers/usb/gadget/function/f_accessory.c:969:1: warning: ‘acc_function_bind’ defined but not used [-Wunused-function]
acc_function_bind(struct usb_configuration *c, struct usb_function *f) {
^
drivers/usb/gadget/function/f_accessory.c:1172:12: warning: ‘acc_bind_config’ defined but not used [-Wunused-function]
static int acc_bind_config(struct usb_configuration *c)
^
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
This commit is contained in:
committed by
Dmitry Shmidt
parent
95106e3d20
commit
e45c769fa7
@ -1648,9 +1648,6 @@ static struct config_group *gadgets_make(
|
||||
const char *name)
|
||||
{
|
||||
struct gadget_info *gi;
|
||||
struct device_attribute **attrs;
|
||||
struct device_attribute *attr;
|
||||
int err;
|
||||
|
||||
gi = kzalloc(sizeof(*gi), GFP_KERNEL);
|
||||
if (!gi)
|
||||
@ -1709,9 +1706,6 @@ err:
|
||||
|
||||
static void gadgets_drop(struct config_group *group, struct config_item *item)
|
||||
{
|
||||
struct device_attribute **attrs;
|
||||
struct device_attribute *attr;
|
||||
|
||||
config_item_put(item);
|
||||
android_device_destroy();
|
||||
}
|
||||
|
||||
@ -943,11 +943,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) {
|
||||
@ -1147,35 +1142,6 @@ static void acc_function_disable(struct usb_function *f)
|
||||
VDBG(cdev, "%s disabled\n", dev->function.name);
|
||||
}
|
||||
|
||||
static int 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;
|
||||
|
||||
@ -1216,40 +1216,6 @@ static void mtp_function_disable(struct usb_function *f)
|
||||
VDBG(cdev, "%s disabled\n", dev->function.name);
|
||||
}
|
||||
|
||||
static int mtp_bind_config(struct usb_configuration *c, bool ptp_config)
|
||||
{
|
||||
struct mtp_dev *dev = _mtp_dev;
|
||||
int ret = 0;
|
||||
|
||||
printk(KERN_INFO "mtp_bind_config\n");
|
||||
|
||||
/* allocate a string ID for our interface */
|
||||
if (mtp_string_defs[INTERFACE_STRING_INDEX].id == 0) {
|
||||
ret = usb_string_id(c->cdev);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
mtp_string_defs[INTERFACE_STRING_INDEX].id = ret;
|
||||
mtp_interface_desc.iInterface = ret;
|
||||
}
|
||||
|
||||
dev->cdev = c->cdev;
|
||||
dev->function.name = DRIVER_NAME;
|
||||
dev->function.strings = mtp_strings;
|
||||
if (ptp_config) {
|
||||
dev->function.fs_descriptors = fs_ptp_descs;
|
||||
dev->function.hs_descriptors = hs_ptp_descs;
|
||||
} else {
|
||||
dev->function.fs_descriptors = fs_mtp_descs;
|
||||
dev->function.hs_descriptors = hs_mtp_descs;
|
||||
}
|
||||
dev->function.bind = mtp_function_bind;
|
||||
dev->function.unbind = mtp_function_unbind;
|
||||
dev->function.set_alt = mtp_function_set_alt;
|
||||
dev->function.disable = mtp_function_disable;
|
||||
|
||||
return usb_add_function(c, &dev->function);
|
||||
}
|
||||
|
||||
static int __mtp_setup(struct mtp_instance *fi_mtp)
|
||||
{
|
||||
struct mtp_dev *dev;
|
||||
@ -1297,11 +1263,6 @@ err1:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int mtp_setup(void)
|
||||
{
|
||||
return __mtp_setup(NULL);
|
||||
}
|
||||
|
||||
static int mtp_setup_configfs(struct mtp_instance *fi_mtp)
|
||||
{
|
||||
return __mtp_setup(fi_mtp);
|
||||
|
||||
Reference in New Issue
Block a user