usb: gadget: push all usb_composite_driver structs into __refdata
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Thu, 6 Sep 2012 18:11:03 +0000 (20:11 +0200)
committerFelipe Balbi <balbi@ti.com>
Mon, 10 Sep 2012 12:34:24 +0000 (15:34 +0300)
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: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
18 files changed:
drivers/usb/gadget/acm_ms.c
drivers/usb/gadget/audio.c
drivers/usb/gadget/cdc2.c
drivers/usb/gadget/dbgp.c
drivers/usb/gadget/ether.c
drivers/usb/gadget/file_storage.c
drivers/usb/gadget/g_ffs.c
drivers/usb/gadget/gmidi.c
drivers/usb/gadget/hid.c
drivers/usb/gadget/mass_storage.c
drivers/usb/gadget/multi.c
drivers/usb/gadget/ncm.c
drivers/usb/gadget/nokia.c
drivers/usb/gadget/printer.c
drivers/usb/gadget/serial.c
drivers/usb/gadget/tcm_usb_gadget.c
drivers/usb/gadget/webcam.c
drivers/usb/gadget/zero.c

index 75b8a691fd0036154897ab530074027099b17bc8..dc5cd51de7d434aab542dcc2f68dfcc33553b2c0 100644 (file)
@@ -232,7 +232,7 @@ static int __exit acm_ms_unbind(struct usb_composite_dev *cdev)
        return 0;
 }
 
-static struct usb_composite_driver acm_ms_driver = {
+static __refdata struct usb_composite_driver acm_ms_driver = {
        .name           = "g_acm_ms",
        .dev            = &device_desc,
        .max_speed      = USB_SPEED_SUPER,
index 98899244860ecce46d86bd7592b779e9534afe94..e539490e7733846da9ebf8ac9a379d3d38789d9e 100644 (file)
@@ -198,7 +198,7 @@ static int __exit audio_unbind(struct usb_composite_dev *cdev)
        return 0;
 }
 
-static struct usb_composite_driver audio_driver = {
+static __refdata struct usb_composite_driver audio_driver = {
        .name           = "g_audio",
        .dev            = &device_desc,
        .strings        = audio_strings,
index 725550f06fab60c832b51da725ea3feb805b32d7..00b65ac7a2ef398bba26e4ba6417fed2cc89e7fb 100644 (file)
@@ -232,7 +232,7 @@ static int __exit cdc_unbind(struct usb_composite_dev *cdev)
        return 0;
 }
 
-static struct usb_composite_driver cdc_driver = {
+static __refdata struct usb_composite_driver cdc_driver = {
        .name           = "g_cdc",
        .dev            = &device_desc,
        .strings        = dev_strings,
index 19d7bb0df75a3515e0347ad6d03cda57c1c6e301..2d2cff3e454c11dde4de200e79ebae33a663adf0 100644 (file)
@@ -402,7 +402,7 @@ fail:
        return err;
 }
 
-static struct usb_gadget_driver dbgp_driver = {
+static __refdata struct usb_gadget_driver dbgp_driver = {
        .function = "dbgp",
        .max_speed = USB_SPEED_HIGH,
        .unbind = dbgp_unbind,
index a28f6ffcd0f31683d701bfd527ba1c110c92be4a..49a7dac06b1dc587c4d6a0aa6e69935daccfe603 100644 (file)
@@ -388,7 +388,7 @@ static int __exit eth_unbind(struct usb_composite_dev *cdev)
        return 0;
 }
 
-static struct usb_composite_driver eth_driver = {
+static __refdata struct usb_composite_driver eth_driver = {
        .name           = "g_ether",
        .dev            = &device_desc,
        .strings        = dev_strings,
index a896d73f7a9336f5a34015c44ea5a6b04ce34f10..683234bcdced45d8d76b616a7db5f3160be2e101 100644 (file)
@@ -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,
        .function       = (char *) fsg_string_product,
        .unbind         = fsg_unbind,
index d3ace9002a6a1e7413e5efe1b58e48a7f82437b3..d1312c404afa401b42f67f207816c8c32057d8ba 100644 (file)
@@ -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_do_config(struct usb_configuration *c);
 
-static struct usb_composite_driver gfs_driver = {
+static __refdata struct usb_composite_driver gfs_driver = {
        .name           = DRIVER_NAME,
        .dev            = &gfs_dev_desc,
        .strings        = gfs_dev_strings,
index 681bd038b1d8354f6317b7f23652f5667c584a68..ae46f69b718ae8d2abd7f1bd3874b5f82a98e7ea 100644 (file)
@@ -184,7 +184,7 @@ static int __init midi_bind(struct usb_composite_dev *cdev)
        return 0;
 }
 
-static struct usb_composite_driver midi_driver = {
+static __refdata struct usb_composite_driver midi_driver = {
        .name           = (char *) longname,
        .dev            = &device_desc,
        .strings        = dev_strings,
index 3493adf064f512bccc28358a202015188ff932e9..34e139e700b4cfa9588ee41f4b2699c48320efd8 100644 (file)
@@ -242,7 +242,7 @@ static int __devexit hidg_plat_driver_remove(struct platform_device *pdev)
 /****************************** Some noise ******************************/
 
 
-static struct usb_composite_driver hidg_driver = {
+static __refdata struct usb_composite_driver hidg_driver = {
        .name           = "g_hid",
        .dev            = &device_desc,
        .strings        = dev_strings,
index 1f376eba31f6f8a4b4f6abf02577dac5336e0d79..5df117e3f78d36afeeb54ab8ee2cb921fff339d6 100644 (file)
@@ -156,7 +156,7 @@ static int __init msg_bind(struct usb_composite_dev *cdev)
 
 /****************************** Some noise ******************************/
 
-static struct usb_composite_driver msg_driver = {
+static __refdata struct usb_composite_driver msg_driver = {
        .name           = "g_mass_storage",
        .dev            = &msg_device_desc,
        .iProduct       = DRIVER_DESC,
index c37fb33a3d1bc57718582053a6c308ff2c051a67..7e5852a28a937297c8d1611d9226ac3c0c9879cc 100644 (file)
@@ -338,7 +338,7 @@ static int __exit multi_unbind(struct usb_composite_dev *cdev)
 /****************************** Some noise ******************************/
 
 
-static struct usb_composite_driver multi_driver = {
+static __refdata struct usb_composite_driver multi_driver = {
        .name           = "g_multi",
        .dev            = &device_desc,
        .strings        = dev_strings,
index 89530034dff18bbfcf0223b200c0f75b43d0cfb7..5079bf659e31fd70d4e7c424c4021822c772d3a2 100644 (file)
@@ -215,7 +215,7 @@ static int __exit gncm_unbind(struct usb_composite_dev *cdev)
        return 0;
 }
 
-static struct usb_composite_driver ncm_driver = {
+static __refdata struct usb_composite_driver ncm_driver = {
        .name           = "g_ncm",
        .dev            = &device_desc,
        .strings        = dev_strings,
index c7fb7723c014e8491841a531f48c705de21b14ea..936d0afc4527b0f64c4cb4fd1d43f865a2016b1e 100644 (file)
@@ -237,7 +237,7 @@ static int __exit nokia_unbind(struct usb_composite_dev *cdev)
        return 0;
 }
 
-static struct usb_composite_driver nokia_driver = {
+static __refdata struct usb_composite_driver nokia_driver = {
        .name           = "g_nokia",
        .dev            = &device_desc,
        .strings        = dev_strings,
index f1f9290a2f47d11771108cb99ec53a6b6239117a..0aab51766ce62152f0a4bf4ea755057658d6ec4f 100644 (file)
@@ -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);
 }
 
-static struct usb_composite_driver printer_driver = {
+static __refdata struct usb_composite_driver printer_driver = {
        .name           = shortname,
        .dev            = &device_desc,
        .strings        = dev_strings,
index 665c07422c2670236495e028ebe203d38922ed75..7b0b6f40ed07a9b5268feedf324b7032dbfabdf8 100644 (file)
@@ -238,7 +238,7 @@ fail:
        return status;
 }
 
-static struct usb_composite_driver gserial_driver = {
+static __refdata struct usb_composite_driver gserial_driver = {
        .name           = "g_serial",
        .dev            = &device_desc,
        .strings        = dev_strings,
index 5444866e13ef72c8ddd7c9a693803c02cd37a61a..28fef844a06a2b2efbf4adeeb803cf08d45050ba 100644 (file)
@@ -2436,7 +2436,7 @@ static int usb_target_bind(struct usb_composite_dev *cdev)
        return 0;
 }
 
-static struct usb_composite_driver usbg_driver = {
+static __refdata struct usb_composite_driver usbg_driver = {
        .name           = "g_target",
        .dev            = &usbg_device_desc,
        .strings        = usbg_strings,
index 120e134e805ed9ad2101a752e303aa878b18de3b..d946f19482e86b1bd7a835d3fdf5fa16098db324 100644 (file)
@@ -390,7 +390,7 @@ error:
  * Driver
  */
 
-static struct usb_composite_driver webcam_driver = {
+static __refdata struct usb_composite_driver webcam_driver = {
        .name           = "g_webcam",
        .dev            = &webcam_device_descriptor,
        .strings        = webcam_device_strings,
index 12ad516ada77110a236600647feeaf3bbdbf954d..5db33cbe755bfc4fa25f1a045950876954af940f 100644 (file)
@@ -334,7 +334,7 @@ static int zero_unbind(struct usb_composite_dev *cdev)
        return 0;
 }
 
-static struct usb_composite_driver zero_driver = {
+static __refdata struct usb_composite_driver zero_driver = {
        .name           = "zero",
        .dev            = &device_desc,
        .strings        = dev_strings,