Commit c2ec75c2 authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Felipe Balbi

usb: gadget: push all usb_composite_driver structs into __refdata

As it turns out, Sam's comment was better than I initially assumed. This
patch pushes as struct usb_composite_driver data structures into
__refdata section to avoid a section missmatch report from modpost
because the ->bind() can be marked __init. The only downside is that
modpost does not check between ->bind() and other member. However, it is
temporary.

Cc: Sam Ravnborg <sam@ravnborg.org>
Acked-by: default avatarMichal Nazarewicz <mina86@mina86.com>
Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 1e1a27c3
...@@ -232,7 +232,7 @@ static int __exit acm_ms_unbind(struct usb_composite_dev *cdev) ...@@ -232,7 +232,7 @@ static int __exit acm_ms_unbind(struct usb_composite_dev *cdev)
return 0; return 0;
} }
static struct usb_composite_driver acm_ms_driver = { static __refdata struct usb_composite_driver acm_ms_driver = {
.name = "g_acm_ms", .name = "g_acm_ms",
.dev = &device_desc, .dev = &device_desc,
.max_speed = USB_SPEED_SUPER, .max_speed = USB_SPEED_SUPER,
......
...@@ -198,7 +198,7 @@ static int __exit audio_unbind(struct usb_composite_dev *cdev) ...@@ -198,7 +198,7 @@ static int __exit audio_unbind(struct usb_composite_dev *cdev)
return 0; return 0;
} }
static struct usb_composite_driver audio_driver = { static __refdata struct usb_composite_driver audio_driver = {
.name = "g_audio", .name = "g_audio",
.dev = &device_desc, .dev = &device_desc,
.strings = audio_strings, .strings = audio_strings,
......
...@@ -232,7 +232,7 @@ static int __exit cdc_unbind(struct usb_composite_dev *cdev) ...@@ -232,7 +232,7 @@ static int __exit cdc_unbind(struct usb_composite_dev *cdev)
return 0; return 0;
} }
static struct usb_composite_driver cdc_driver = { static __refdata struct usb_composite_driver cdc_driver = {
.name = "g_cdc", .name = "g_cdc",
.dev = &device_desc, .dev = &device_desc,
.strings = dev_strings, .strings = dev_strings,
......
...@@ -402,7 +402,7 @@ static int dbgp_setup(struct usb_gadget *gadget, ...@@ -402,7 +402,7 @@ static int dbgp_setup(struct usb_gadget *gadget,
return err; return err;
} }
static struct usb_gadget_driver dbgp_driver = { static __refdata struct usb_gadget_driver dbgp_driver = {
.function = "dbgp", .function = "dbgp",
.max_speed = USB_SPEED_HIGH, .max_speed = USB_SPEED_HIGH,
.unbind = dbgp_unbind, .unbind = dbgp_unbind,
......
...@@ -388,7 +388,7 @@ static int __exit eth_unbind(struct usb_composite_dev *cdev) ...@@ -388,7 +388,7 @@ static int __exit eth_unbind(struct usb_composite_dev *cdev)
return 0; return 0;
} }
static struct usb_composite_driver eth_driver = { static __refdata struct usb_composite_driver eth_driver = {
.name = "g_ether", .name = "g_ether",
.dev = &device_desc, .dev = &device_desc,
.strings = dev_strings, .strings = dev_strings,
......
...@@ -3603,7 +3603,7 @@ static void fsg_resume(struct usb_gadget *gadget) ...@@ -3603,7 +3603,7 @@ static void fsg_resume(struct usb_gadget *gadget)
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
static struct usb_gadget_driver fsg_driver = { static __refdata struct usb_gadget_driver fsg_driver = {
.max_speed = USB_SPEED_SUPER, .max_speed = USB_SPEED_SUPER,
.function = (char *) fsg_string_product, .function = (char *) fsg_string_product,
.unbind = fsg_unbind, .unbind = fsg_unbind,
......
...@@ -163,7 +163,7 @@ static int gfs_bind(struct usb_composite_dev *cdev); ...@@ -163,7 +163,7 @@ static int gfs_bind(struct usb_composite_dev *cdev);
static int gfs_unbind(struct usb_composite_dev *cdev); static int gfs_unbind(struct usb_composite_dev *cdev);
static int gfs_do_config(struct usb_configuration *c); static int gfs_do_config(struct usb_configuration *c);
static struct usb_composite_driver gfs_driver = { static __refdata struct usb_composite_driver gfs_driver = {
.name = DRIVER_NAME, .name = DRIVER_NAME,
.dev = &gfs_dev_desc, .dev = &gfs_dev_desc,
.strings = gfs_dev_strings, .strings = gfs_dev_strings,
......
...@@ -184,7 +184,7 @@ static int __init midi_bind(struct usb_composite_dev *cdev) ...@@ -184,7 +184,7 @@ static int __init midi_bind(struct usb_composite_dev *cdev)
return 0; return 0;
} }
static struct usb_composite_driver midi_driver = { static __refdata struct usb_composite_driver midi_driver = {
.name = (char *) longname, .name = (char *) longname,
.dev = &device_desc, .dev = &device_desc,
.strings = dev_strings, .strings = dev_strings,
......
...@@ -242,7 +242,7 @@ static int __devexit hidg_plat_driver_remove(struct platform_device *pdev) ...@@ -242,7 +242,7 @@ static int __devexit hidg_plat_driver_remove(struct platform_device *pdev)
/****************************** Some noise ******************************/ /****************************** Some noise ******************************/
static struct usb_composite_driver hidg_driver = { static __refdata struct usb_composite_driver hidg_driver = {
.name = "g_hid", .name = "g_hid",
.dev = &device_desc, .dev = &device_desc,
.strings = dev_strings, .strings = dev_strings,
......
...@@ -156,7 +156,7 @@ static int __init msg_bind(struct usb_composite_dev *cdev) ...@@ -156,7 +156,7 @@ static int __init msg_bind(struct usb_composite_dev *cdev)
/****************************** Some noise ******************************/ /****************************** Some noise ******************************/
static struct usb_composite_driver msg_driver = { static __refdata struct usb_composite_driver msg_driver = {
.name = "g_mass_storage", .name = "g_mass_storage",
.dev = &msg_device_desc, .dev = &msg_device_desc,
.iProduct = DRIVER_DESC, .iProduct = DRIVER_DESC,
......
...@@ -338,7 +338,7 @@ static int __exit multi_unbind(struct usb_composite_dev *cdev) ...@@ -338,7 +338,7 @@ static int __exit multi_unbind(struct usb_composite_dev *cdev)
/****************************** Some noise ******************************/ /****************************** Some noise ******************************/
static struct usb_composite_driver multi_driver = { static __refdata struct usb_composite_driver multi_driver = {
.name = "g_multi", .name = "g_multi",
.dev = &device_desc, .dev = &device_desc,
.strings = dev_strings, .strings = dev_strings,
......
...@@ -215,7 +215,7 @@ static int __exit gncm_unbind(struct usb_composite_dev *cdev) ...@@ -215,7 +215,7 @@ static int __exit gncm_unbind(struct usb_composite_dev *cdev)
return 0; return 0;
} }
static struct usb_composite_driver ncm_driver = { static __refdata struct usb_composite_driver ncm_driver = {
.name = "g_ncm", .name = "g_ncm",
.dev = &device_desc, .dev = &device_desc,
.strings = dev_strings, .strings = dev_strings,
......
...@@ -237,7 +237,7 @@ static int __exit nokia_unbind(struct usb_composite_dev *cdev) ...@@ -237,7 +237,7 @@ static int __exit nokia_unbind(struct usb_composite_dev *cdev)
return 0; return 0;
} }
static struct usb_composite_driver nokia_driver = { static __refdata struct usb_composite_driver nokia_driver = {
.name = "g_nokia", .name = "g_nokia",
.dev = &device_desc, .dev = &device_desc,
.strings = dev_strings, .strings = dev_strings,
......
...@@ -1269,7 +1269,7 @@ static int __init printer_bind(struct usb_composite_dev *cdev) ...@@ -1269,7 +1269,7 @@ static int __init printer_bind(struct usb_composite_dev *cdev)
return usb_add_config(cdev, &printer_cfg_driver, printer_bind_config); return usb_add_config(cdev, &printer_cfg_driver, printer_bind_config);
} }
static struct usb_composite_driver printer_driver = { static __refdata struct usb_composite_driver printer_driver = {
.name = shortname, .name = shortname,
.dev = &device_desc, .dev = &device_desc,
.strings = dev_strings, .strings = dev_strings,
......
...@@ -238,7 +238,7 @@ static int __init gs_bind(struct usb_composite_dev *cdev) ...@@ -238,7 +238,7 @@ static int __init gs_bind(struct usb_composite_dev *cdev)
return status; return status;
} }
static struct usb_composite_driver gserial_driver = { static __refdata struct usb_composite_driver gserial_driver = {
.name = "g_serial", .name = "g_serial",
.dev = &device_desc, .dev = &device_desc,
.strings = dev_strings, .strings = dev_strings,
......
...@@ -2436,7 +2436,7 @@ static int usb_target_bind(struct usb_composite_dev *cdev) ...@@ -2436,7 +2436,7 @@ static int usb_target_bind(struct usb_composite_dev *cdev)
return 0; return 0;
} }
static struct usb_composite_driver usbg_driver = { static __refdata struct usb_composite_driver usbg_driver = {
.name = "g_target", .name = "g_target",
.dev = &usbg_device_desc, .dev = &usbg_device_desc,
.strings = usbg_strings, .strings = usbg_strings,
......
...@@ -390,7 +390,7 @@ webcam_bind(struct usb_composite_dev *cdev) ...@@ -390,7 +390,7 @@ webcam_bind(struct usb_composite_dev *cdev)
* Driver * Driver
*/ */
static struct usb_composite_driver webcam_driver = { static __refdata struct usb_composite_driver webcam_driver = {
.name = "g_webcam", .name = "g_webcam",
.dev = &webcam_device_descriptor, .dev = &webcam_device_descriptor,
.strings = webcam_device_strings, .strings = webcam_device_strings,
......
...@@ -334,7 +334,7 @@ static int zero_unbind(struct usb_composite_dev *cdev) ...@@ -334,7 +334,7 @@ static int zero_unbind(struct usb_composite_dev *cdev)
return 0; return 0;
} }
static struct usb_composite_driver zero_driver = { static __refdata struct usb_composite_driver zero_driver = {
.name = "zero", .name = "zero",
.dev = &device_desc, .dev = &device_desc,
.strings = dev_strings, .strings = dev_strings,
......
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