Commit 89ba85d4 authored by Michal Nazarewicz's avatar Michal Nazarewicz Committed by Greg Kroah-Hartman

USB: gadget: section mismatch warning fixed

In may gadgets bind and bind like functions were in a init section
as they were only run during initialisation.  However, being
callback functions they were referenced from structures in “normal”
sections.  Changing the tag from “__init” to “__ref” fixes the
warnings.
Signed-off-by: default avatarMichal Nazarewicz <m.nazarewicz@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 8876f5e7
...@@ -89,7 +89,7 @@ static const struct usb_descriptor_header *otg_desc[] = { ...@@ -89,7 +89,7 @@ static const struct usb_descriptor_header *otg_desc[] = {
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
static int __init audio_do_config(struct usb_configuration *c) static int __ref audio_do_config(struct usb_configuration *c)
{ {
/* FIXME alloc iConfiguration string, set it in c->strings */ /* FIXME alloc iConfiguration string, set it in c->strings */
...@@ -113,7 +113,7 @@ static struct usb_configuration audio_config_driver = { ...@@ -113,7 +113,7 @@ static struct usb_configuration audio_config_driver = {
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
static int __init audio_bind(struct usb_composite_dev *cdev) static int __ref audio_bind(struct usb_composite_dev *cdev)
{ {
int gcnum; int gcnum;
int status; int status;
......
...@@ -129,7 +129,7 @@ static u8 hostaddr[ETH_ALEN]; ...@@ -129,7 +129,7 @@ static u8 hostaddr[ETH_ALEN];
/* /*
* We _always_ have both CDC ECM and CDC ACM functions. * We _always_ have both CDC ECM and CDC ACM functions.
*/ */
static int __init cdc_do_config(struct usb_configuration *c) static int __ref cdc_do_config(struct usb_configuration *c)
{ {
int status; int status;
...@@ -159,7 +159,7 @@ static struct usb_configuration cdc_config_driver = { ...@@ -159,7 +159,7 @@ static struct usb_configuration cdc_config_driver = {
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
static int __init cdc_bind(struct usb_composite_dev *cdev) static int __ref cdc_bind(struct usb_composite_dev *cdev)
{ {
int gcnum; int gcnum;
struct usb_gadget *gadget = cdev->gadget; struct usb_gadget *gadget = cdev->gadget;
......
...@@ -237,7 +237,7 @@ static u8 hostaddr[ETH_ALEN]; ...@@ -237,7 +237,7 @@ static u8 hostaddr[ETH_ALEN];
* the first one present. That's to make Microsoft's drivers happy, * the first one present. That's to make Microsoft's drivers happy,
* and to follow DOCSIS 1.0 (cable modem standard). * and to follow DOCSIS 1.0 (cable modem standard).
*/ */
static int __init rndis_do_config(struct usb_configuration *c) static int __ref rndis_do_config(struct usb_configuration *c)
{ {
/* FIXME alloc iConfiguration string, set it in c->strings */ /* FIXME alloc iConfiguration string, set it in c->strings */
...@@ -270,7 +270,7 @@ MODULE_PARM_DESC(use_eem, "use CDC EEM mode"); ...@@ -270,7 +270,7 @@ MODULE_PARM_DESC(use_eem, "use CDC EEM mode");
/* /*
* We _always_ have an ECM, CDC Subset, or EEM configuration. * We _always_ have an ECM, CDC Subset, or EEM configuration.
*/ */
static int __init eth_do_config(struct usb_configuration *c) static int __ref eth_do_config(struct usb_configuration *c)
{ {
/* FIXME alloc iConfiguration string, set it in c->strings */ /* FIXME alloc iConfiguration string, set it in c->strings */
...@@ -297,7 +297,7 @@ static struct usb_configuration eth_config_driver = { ...@@ -297,7 +297,7 @@ static struct usb_configuration eth_config_driver = {
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
static int __init eth_bind(struct usb_composite_dev *cdev) static int __ref eth_bind(struct usb_composite_dev *cdev)
{ {
int gcnum; int gcnum;
struct usb_gadget *gadget = cdev->gadget; struct usb_gadget *gadget = cdev->gadget;
......
...@@ -324,7 +324,7 @@ static void loopback_disable(struct usb_function *f) ...@@ -324,7 +324,7 @@ static void loopback_disable(struct usb_function *f)
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
static int __init loopback_bind_config(struct usb_configuration *c) static int __ref loopback_bind_config(struct usb_configuration *c)
{ {
struct f_loopback *loop; struct f_loopback *loop;
int status; int status;
...@@ -346,7 +346,7 @@ static int __init loopback_bind_config(struct usb_configuration *c) ...@@ -346,7 +346,7 @@ static int __init loopback_bind_config(struct usb_configuration *c)
return status; return status;
} }
static struct usb_configuration loopback_driver = { static struct usb_configuration loopback_driver = {
.label = "loopback", .label = "loopback",
.strings = loopback_strings, .strings = loopback_strings,
.bind = loopback_bind_config, .bind = loopback_bind_config,
......
...@@ -404,7 +404,7 @@ static void sourcesink_disable(struct usb_function *f) ...@@ -404,7 +404,7 @@ static void sourcesink_disable(struct usb_function *f)
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
static int __init sourcesink_bind_config(struct usb_configuration *c) static int __ref sourcesink_bind_config(struct usb_configuration *c)
{ {
struct f_sourcesink *ss; struct f_sourcesink *ss;
int status; int status;
......
...@@ -3335,7 +3335,7 @@ static int __init check_parameters(struct fsg_dev *fsg) ...@@ -3335,7 +3335,7 @@ static int __init check_parameters(struct fsg_dev *fsg)
} }
static int __init fsg_bind(struct usb_gadget *gadget) static int __ref fsg_bind(struct usb_gadget *gadget)
{ {
struct fsg_dev *fsg = the_fsg; struct fsg_dev *fsg = the_fsg;
int rc; int rc;
......
...@@ -1157,7 +1157,7 @@ static int gmidi_register_card(struct gmidi_device *dev) ...@@ -1157,7 +1157,7 @@ static int gmidi_register_card(struct gmidi_device *dev)
/* /*
* Creates an output endpoint, and initializes output ports. * Creates an output endpoint, and initializes output ports.
*/ */
static int __init gmidi_bind(struct usb_gadget *gadget) static int __ref gmidi_bind(struct usb_gadget *gadget)
{ {
struct gmidi_device *dev; struct gmidi_device *dev;
struct usb_ep *in_ep, *out_ep; struct usb_ep *in_ep, *out_ep;
......
...@@ -127,7 +127,7 @@ static struct usb_gadget_strings *dev_strings[] = { ...@@ -127,7 +127,7 @@ static struct usb_gadget_strings *dev_strings[] = {
/****************************** Configurations ******************************/ /****************************** Configurations ******************************/
static int __init do_config(struct usb_configuration *c) static int __ref do_config(struct usb_configuration *c)
{ {
struct hidg_func_node *e; struct hidg_func_node *e;
int func = 0, status = 0; int func = 0, status = 0;
...@@ -156,7 +156,7 @@ static struct usb_configuration config_driver = { ...@@ -156,7 +156,7 @@ static struct usb_configuration config_driver = {
/****************************** Gadget Bind ******************************/ /****************************** Gadget Bind ******************************/
static int __init hid_bind(struct usb_composite_dev *cdev) static int __ref hid_bind(struct usb_composite_dev *cdev)
{ {
struct usb_gadget *gadget = cdev->gadget; struct usb_gadget *gadget = cdev->gadget;
struct list_head *tmp; struct list_head *tmp;
......
...@@ -141,7 +141,7 @@ static int msg_thread_exits(struct fsg_common *common) ...@@ -141,7 +141,7 @@ static int msg_thread_exits(struct fsg_common *common)
return 0; return 0;
} }
static int __init msg_do_config(struct usb_configuration *c) static int __ref msg_do_config(struct usb_configuration *c)
{ {
static const struct fsg_operations ops = { static const struct fsg_operations ops = {
.thread_exits = msg_thread_exits, .thread_exits = msg_thread_exits,
...@@ -182,7 +182,7 @@ static struct usb_configuration msg_config_driver = { ...@@ -182,7 +182,7 @@ static struct usb_configuration msg_config_driver = {
/****************************** Gadget Bind ******************************/ /****************************** Gadget Bind ******************************/
static int __init msg_bind(struct usb_composite_dev *cdev) static int __ref msg_bind(struct usb_composite_dev *cdev)
{ {
struct usb_gadget *gadget = cdev->gadget; struct usb_gadget *gadget = cdev->gadget;
int status; int status;
......
...@@ -1346,7 +1346,7 @@ printer_unbind(struct usb_gadget *gadget) ...@@ -1346,7 +1346,7 @@ printer_unbind(struct usb_gadget *gadget)
set_gadget_data(gadget, NULL); set_gadget_data(gadget, NULL);
} }
static int __init static int __ref
printer_bind(struct usb_gadget *gadget) printer_bind(struct usb_gadget *gadget)
{ {
struct printer_dev *dev; struct printer_dev *dev;
......
...@@ -137,7 +137,7 @@ MODULE_PARM_DESC(n_ports, "number of ports to create, default=1"); ...@@ -137,7 +137,7 @@ MODULE_PARM_DESC(n_ports, "number of ports to create, default=1");
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
static int __init serial_bind_config(struct usb_configuration *c) static int __ref serial_bind_config(struct usb_configuration *c)
{ {
unsigned i; unsigned i;
int status = 0; int status = 0;
...@@ -161,7 +161,7 @@ static struct usb_configuration serial_config_driver = { ...@@ -161,7 +161,7 @@ static struct usb_configuration serial_config_driver = {
.bmAttributes = USB_CONFIG_ATT_SELFPOWER, .bmAttributes = USB_CONFIG_ATT_SELFPOWER,
}; };
static int __init gs_bind(struct usb_composite_dev *cdev) static int __ref gs_bind(struct usb_composite_dev *cdev)
{ {
int gcnum; int gcnum;
struct usb_gadget *gadget = cdev->gadget; struct usb_gadget *gadget = cdev->gadget;
......
...@@ -308,7 +308,7 @@ static const struct uvc_descriptor_header * const uvc_hs_streaming_cls[] = { ...@@ -308,7 +308,7 @@ static const struct uvc_descriptor_header * const uvc_hs_streaming_cls[] = {
* USB configuration * USB configuration
*/ */
static int __init static int __ref
webcam_config_bind(struct usb_configuration *c) webcam_config_bind(struct usb_configuration *c)
{ {
return uvc_bind_config(c, uvc_control_cls, uvc_fs_streaming_cls, return uvc_bind_config(c, uvc_control_cls, uvc_fs_streaming_cls,
...@@ -330,7 +330,7 @@ webcam_unbind(struct usb_composite_dev *cdev) ...@@ -330,7 +330,7 @@ webcam_unbind(struct usb_composite_dev *cdev)
return 0; return 0;
} }
static int __init static int __ref
webcam_bind(struct usb_composite_dev *cdev) webcam_bind(struct usb_composite_dev *cdev)
{ {
int ret; int ret;
......
...@@ -264,7 +264,7 @@ static void zero_resume(struct usb_composite_dev *cdev) ...@@ -264,7 +264,7 @@ static void zero_resume(struct usb_composite_dev *cdev)
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
static int __init zero_bind(struct usb_composite_dev *cdev) static int __ref zero_bind(struct usb_composite_dev *cdev)
{ {
int gcnum; int gcnum;
struct usb_gadget *gadget = cdev->gadget; struct usb_gadget *gadget = cdev->gadget;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment