usb: gadget: remove incorrect __init/__exit annotations
A recent change introduced a link error for the composite printer gadget driver: `printer_unbind' referenced in section `.ref.data' of drivers/built-in.o: defined in discarded section `.exit.text' of drivers/built-in.o Evidently the unbind function should not be marked __exit here, because it is called through a callback pointer that is not necessarily discarded, __composite_unbind() is indeed called from the error path of composite_bind(), which can never work for a built-in driver. Looking at the surrounding code, I found the same problem in all other composite gadget drivers in both the bind and unbind functions, as well as the udc platform driver 'remove' functions. Those will break if anyone uses the 'unbind' sysfs attribute to detach a device from a built-in driver. This patch removes the incorrect annotations from all the gadget drivers. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
committed by
Felipe Balbi
parent
197d0bdf8b
commit
c94e289f19
@ -149,7 +149,7 @@ static struct usb_function *f_acm_rndis;
|
||||
static struct usb_function *f_rndis;
|
||||
static struct usb_function *f_msg_rndis;
|
||||
|
||||
static __init int rndis_do_config(struct usb_configuration *c)
|
||||
static int rndis_do_config(struct usb_configuration *c)
|
||||
{
|
||||
struct fsg_opts *fsg_opts;
|
||||
int ret;
|
||||
@ -237,7 +237,7 @@ static struct usb_function *f_acm_multi;
|
||||
static struct usb_function *f_ecm;
|
||||
static struct usb_function *f_msg_multi;
|
||||
|
||||
static __init int cdc_do_config(struct usb_configuration *c)
|
||||
static int cdc_do_config(struct usb_configuration *c)
|
||||
{
|
||||
struct fsg_opts *fsg_opts;
|
||||
int ret;
|
||||
@ -466,7 +466,7 @@ fail:
|
||||
return status;
|
||||
}
|
||||
|
||||
static int __exit multi_unbind(struct usb_composite_dev *cdev)
|
||||
static int multi_unbind(struct usb_composite_dev *cdev)
|
||||
{
|
||||
#ifdef CONFIG_USB_G_MULTI_CDC
|
||||
usb_put_function(f_msg_multi);
|
||||
@ -497,13 +497,13 @@ static int __exit multi_unbind(struct usb_composite_dev *cdev)
|
||||
/****************************** Some noise ******************************/
|
||||
|
||||
|
||||
static __refdata struct usb_composite_driver multi_driver = {
|
||||
static struct usb_composite_driver multi_driver = {
|
||||
.name = "g_multi",
|
||||
.dev = &device_desc,
|
||||
.strings = dev_strings,
|
||||
.max_speed = USB_SPEED_HIGH,
|
||||
.bind = multi_bind,
|
||||
.unbind = __exit_p(multi_unbind),
|
||||
.unbind = multi_unbind,
|
||||
.needs_serial = 1,
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user