Commit 6fcf1129 authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Greg Kroah-Hartman

USB: gadget: legacy: remove left-over __ref annotations

These were added in commit 780cc0f3 ("usb: gadget: add '__ref' for
rndis_config_register() and cdc_config_register()") to silence
modpost, but they didn't fix the real problem - that was fixed later
by removing wrong __init annotations in commit c94e289f ("usb:
gadget: remove incorrect __init/__exit annotations").

It really never makes sense for a function to be marked __ref unless
it (1) has some conditional that chooses whether to call an __init
function (or access __initdata) or not and (2) has a comment
explaining why the __ref is there and why it is safe.
Signed-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
Link: https://lore.kernel.org/r/20210323081607.405904-1-linux@rasmusvillemoes.dkSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d23922fc
...@@ -182,7 +182,7 @@ static int rndis_do_config(struct usb_configuration *c) ...@@ -182,7 +182,7 @@ static int rndis_do_config(struct usb_configuration *c)
return ret; return ret;
} }
static __ref int rndis_config_register(struct usb_composite_dev *cdev) static int rndis_config_register(struct usb_composite_dev *cdev)
{ {
static struct usb_configuration config = { static struct usb_configuration config = {
.bConfigurationValue = MULTI_RNDIS_CONFIG_NUM, .bConfigurationValue = MULTI_RNDIS_CONFIG_NUM,
...@@ -197,7 +197,7 @@ static __ref int rndis_config_register(struct usb_composite_dev *cdev) ...@@ -197,7 +197,7 @@ static __ref int rndis_config_register(struct usb_composite_dev *cdev)
#else #else
static __ref int rndis_config_register(struct usb_composite_dev *cdev) static int rndis_config_register(struct usb_composite_dev *cdev)
{ {
return 0; return 0;
} }
...@@ -265,7 +265,7 @@ static int cdc_do_config(struct usb_configuration *c) ...@@ -265,7 +265,7 @@ static int cdc_do_config(struct usb_configuration *c)
return ret; return ret;
} }
static __ref int cdc_config_register(struct usb_composite_dev *cdev) static int cdc_config_register(struct usb_composite_dev *cdev)
{ {
static struct usb_configuration config = { static struct usb_configuration config = {
.bConfigurationValue = MULTI_CDC_CONFIG_NUM, .bConfigurationValue = MULTI_CDC_CONFIG_NUM,
...@@ -280,7 +280,7 @@ static __ref int cdc_config_register(struct usb_composite_dev *cdev) ...@@ -280,7 +280,7 @@ static __ref int cdc_config_register(struct usb_composite_dev *cdev)
#else #else
static __ref int cdc_config_register(struct usb_composite_dev *cdev) static int cdc_config_register(struct usb_composite_dev *cdev)
{ {
return 0; return 0;
} }
...@@ -291,7 +291,7 @@ static __ref int cdc_config_register(struct usb_composite_dev *cdev) ...@@ -291,7 +291,7 @@ static __ref int cdc_config_register(struct usb_composite_dev *cdev)
/****************************** Gadget Bind ******************************/ /****************************** Gadget Bind ******************************/
static int __ref multi_bind(struct usb_composite_dev *cdev) static int multi_bind(struct usb_composite_dev *cdev)
{ {
struct usb_gadget *gadget = cdev->gadget; struct usb_gadget *gadget = cdev->gadget;
#ifdef CONFIG_USB_G_MULTI_CDC #ifdef CONFIG_USB_G_MULTI_CDC
......
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