public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: fotg210-udc: Remove bogus __init/__exit annotations
@ 2013-07-10 21:45 Geert Uytterhoeven
  2013-07-10 21:52 ` Sergei Shtylyov
  2013-07-15  9:59 ` Felipe Balbi
  0 siblings, 2 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2013-07-10 21:45 UTC (permalink / raw)
  To: Yuan-Hsin Chen, Felipe Balbi; +Cc: linux-usb, linux-kernel, Geert Uytterhoeven

When builtin (CONFIG_USB_FOTG210_UDC=y):

  LD      drivers/usb/gadget/built-in.o
WARNING: drivers/usb/gadget/built-in.o(.data+0xbf8): Section mismatch in reference from the variable fotg210_driver to the function .init.text:fotg210_udc_probe()
The variable fotg210_driver references
the function __init fotg210_udc_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

  LD      drivers/usb/built-in.o
WARNING: drivers/usb/built-in.o(.data+0x14684): Section mismatch in reference from the variable fotg210_driver to the function .init.text:fotg210_udc_probe()
The variable fotg210_driver references
the function __init fotg210_udc_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

  LD      drivers/built-in.o
WARNING: drivers/built-in.o(.data+0x8b0c8): Section mismatch in reference from the variable fotg210_driver to the function .init.text:fotg210_udc_probe()
The variable fotg210_driver references
the function __init fotg210_udc_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

  CHK     include/generated/uapi/linux/version.h
  LINK    vmlinux
  LD      vmlinux.o
  MODPOST vmlinux.o
WARNING: vmlinux.o(.data+0xc6730): Section mismatch in reference from the variable fotg210_driver to the function .init.text:fotg210_udc_probe()
The variable fotg210_driver references
the function __init fotg210_udc_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

  GEN     .version
  CHK     include/generated/compile.h
  UPD     include/generated/compile.h
  CC      init/version.o
  LD      init/built-in.o
`.exit.text' referenced in section `.data' of drivers/built-in.o: defined in discarded section `.exit.text' of drivers/built-in.o
make[3]: *** [vmlinux] Error 1

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 drivers/usb/gadget/fotg210-udc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/fotg210-udc.c b/drivers/usb/gadget/fotg210-udc.c
index cce5535..10cd18d 100644
--- a/drivers/usb/gadget/fotg210-udc.c
+++ b/drivers/usb/gadget/fotg210-udc.c
@@ -1074,7 +1074,7 @@ static struct usb_gadget_ops fotg210_gadget_ops = {
 	.udc_stop		= fotg210_udc_stop,
 };
 
-static int __exit fotg210_udc_remove(struct platform_device *pdev)
+static int fotg210_udc_remove(struct platform_device *pdev)
 {
 	struct fotg210_udc *fotg210 = dev_get_drvdata(&pdev->dev);
 
@@ -1088,7 +1088,7 @@ static int __exit fotg210_udc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int __init fotg210_udc_probe(struct platform_device *pdev)
+static int fotg210_udc_probe(struct platform_device *pdev)
 {
 	struct resource *res, *ires;
 	struct fotg210_udc *fotg210 = NULL;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: gadget: fotg210-udc: Remove bogus __init/__exit annotations
  2013-07-10 21:45 [PATCH] usb: gadget: fotg210-udc: Remove bogus __init/__exit annotations Geert Uytterhoeven
@ 2013-07-10 21:52 ` Sergei Shtylyov
  2013-07-11  7:25   ` Geert Uytterhoeven
  2013-07-15  9:59 ` Felipe Balbi
  1 sibling, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2013-07-10 21:52 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Yuan-Hsin Chen, Felipe Balbi, linux-usb, linux-kernel

On 07/11/2013 01:45 AM, Geert Uytterhoeven wrote:

> When builtin (CONFIG_USB_FOTG210_UDC=y):

>    LD      drivers/usb/gadget/built-in.o
> WARNING: drivers/usb/gadget/built-in.o(.data+0xbf8): Section mismatch in reference from the variable fotg210_driver to the function .init.text:fotg210_udc_probe()
> The variable fotg210_driver references
> the function __init fotg210_udc_probe()
> If the reference is valid then annotate the
> variable with __init* or __refdata (see linux/init.h) or name the variable:
> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

>    LD      drivers/usb/built-in.o
> WARNING: drivers/usb/built-in.o(.data+0x14684): Section mismatch in reference from the variable fotg210_driver to the function .init.text:fotg210_udc_probe()
> The variable fotg210_driver references
> the function __init fotg210_udc_probe()
> If the reference is valid then annotate the
> variable with __init* or __refdata (see linux/init.h) or name the variable:
> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

>    LD      drivers/built-in.o
> WARNING: drivers/built-in.o(.data+0x8b0c8): Section mismatch in reference from the variable fotg210_driver to the function .init.text:fotg210_udc_probe()
> The variable fotg210_driver references
> the function __init fotg210_udc_probe()
> If the reference is valid then annotate the
> variable with __init* or __refdata (see linux/init.h) or name the variable:
> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

>    CHK     include/generated/uapi/linux/version.h
>    LINK    vmlinux
>    LD      vmlinux.o
>    MODPOST vmlinux.o
> WARNING: vmlinux.o(.data+0xc6730): Section mismatch in reference from the variable fotg210_driver to the function .init.text:fotg210_udc_probe()
> The variable fotg210_driver references
> the function __init fotg210_udc_probe()
> If the reference is valid then annotate the
> variable with __init* or __refdata (see linux/init.h) or name the variable:
> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

>    GEN     .version
>    CHK     include/generated/compile.h
>    UPD     include/generated/compile.h
>    CC      init/version.o
>    LD      init/built-in.o
> `.exit.text' referenced in section `.data' of drivers/built-in.o: defined in discarded section `.exit.text' of drivers/built-in.o
> make[3]: *** [vmlinux] Error 1

> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
>   drivers/usb/gadget/fotg210-udc.c |    4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)

> diff --git a/drivers/usb/gadget/fotg210-udc.c b/drivers/usb/gadget/fotg210-udc.c
> index cce5535..10cd18d 100644
> --- a/drivers/usb/gadget/fotg210-udc.c
> +++ b/drivers/usb/gadget/fotg210-udc.c
> @@ -1074,7 +1074,7 @@ static struct usb_gadget_ops fotg210_gadget_ops = {
>   	.udc_stop		= fotg210_udc_stop,
>   };
>
> -static int __exit fotg210_udc_remove(struct platform_device *pdev)
> +static int fotg210_udc_remove(struct platform_device *pdev)

    I think you can leave __exit annotation here, if you enclose the 
reference in the driver structure in __exit_p()...

WBR, Sergei


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: gadget: fotg210-udc: Remove bogus __init/__exit annotations
  2013-07-10 21:52 ` Sergei Shtylyov
@ 2013-07-11  7:25   ` Geert Uytterhoeven
  2013-07-12 21:44     ` Sergei Shtylyov
  0 siblings, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2013-07-11  7:25 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Yuan-Hsin Chen, Felipe Balbi, USB list,
	linux-kernel@vger.kernel.org

On Wed, Jul 10, 2013 at 11:52 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> On 07/11/2013 01:45 AM, Geert Uytterhoeven wrote:
>
>> When builtin (CONFIG_USB_FOTG210_UDC=y):
>
>>    LD      drivers/usb/gadget/built-in.o
>> WARNING: drivers/usb/gadget/built-in.o(.data+0xbf8): Section mismatch in
>> reference from the variable fotg210_driver to the function
>> .init.text:fotg210_udc_probe()
>> The variable fotg210_driver references
>> the function __init fotg210_udc_probe()
>> If the reference is valid then annotate the
>> variable with __init* or __refdata (see linux/init.h) or name the
>> variable:
>> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

>> diff --git a/drivers/usb/gadget/fotg210-udc.c
>> b/drivers/usb/gadget/fotg210-udc.c
>> index cce5535..10cd18d 100644
>> --- a/drivers/usb/gadget/fotg210-udc.c
>> +++ b/drivers/usb/gadget/fotg210-udc.c
>> @@ -1074,7 +1074,7 @@ static struct usb_gadget_ops fotg210_gadget_ops = {
>>         .udc_stop               = fotg210_udc_stop,
>>   };
>>
>> -static int __exit fotg210_udc_remove(struct platform_device *pdev)
>> +static int fotg210_udc_remove(struct platform_device *pdev)
>
>
>    I think you can leave __exit annotation here, if you enclose the
> reference in the driver structure in __exit_p()...

The driver is using module_platform_driver(), not
module_platform_driver_probe(),
so it expects the platform device to show up or disappear anytime.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: gadget: fotg210-udc: Remove bogus __init/__exit annotations
  2013-07-11  7:25   ` Geert Uytterhoeven
@ 2013-07-12 21:44     ` Sergei Shtylyov
  0 siblings, 0 replies; 5+ messages in thread
From: Sergei Shtylyov @ 2013-07-12 21:44 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Yuan-Hsin Chen, Felipe Balbi, USB list,
	linux-kernel@vger.kernel.org

Hello.

On 07/11/2013 11:25 AM, Geert Uytterhoeven wrote:

>>> When builtin (CONFIG_USB_FOTG210_UDC=y):

>>>     LD      drivers/usb/gadget/built-in.o
>>> WARNING: drivers/usb/gadget/built-in.o(.data+0xbf8): Section mismatch in
>>> reference from the variable fotg210_driver to the function
>>> .init.text:fotg210_udc_probe()
>>> The variable fotg210_driver references
>>> the function __init fotg210_udc_probe()
>>> If the reference is valid then annotate the
>>> variable with __init* or __refdata (see linux/init.h) or name the
>>> variable:
>>> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

>>> diff --git a/drivers/usb/gadget/fotg210-udc.c
>>> b/drivers/usb/gadget/fotg210-udc.c
>>> index cce5535..10cd18d 100644
>>> --- a/drivers/usb/gadget/fotg210-udc.c
>>> +++ b/drivers/usb/gadget/fotg210-udc.c
>>> @@ -1074,7 +1074,7 @@ static struct usb_gadget_ops fotg210_gadget_ops = {
>>>          .udc_stop               = fotg210_udc_stop,
>>>    };
>>>
>>> -static int __exit fotg210_udc_remove(struct platform_device *pdev)
>>> +static int fotg210_udc_remove(struct platform_device *pdev)

>>     I think you can leave __exit annotation here, if you enclose the
>> reference in the driver structure in __exit_p()...

> The driver is using module_platform_driver(), not
> module_platform_driver_probe(),
> so it expects the platform device to show up or disappear anytime.

    Well, I don't think it actually does. Perhaps the reason was that 
the latter function wasn't available yet at the time of conversion to 
the former (IIRC it appeared later).

WBR, Sergei


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: gadget: fotg210-udc: Remove bogus __init/__exit annotations
  2013-07-10 21:45 [PATCH] usb: gadget: fotg210-udc: Remove bogus __init/__exit annotations Geert Uytterhoeven
  2013-07-10 21:52 ` Sergei Shtylyov
@ 2013-07-15  9:59 ` Felipe Balbi
  1 sibling, 0 replies; 5+ messages in thread
From: Felipe Balbi @ 2013-07-15  9:59 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Yuan-Hsin Chen, Felipe Balbi, linux-usb, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2565 bytes --]

On Wed, Jul 10, 2013 at 11:45:16PM +0200, Geert Uytterhoeven wrote:
> When builtin (CONFIG_USB_FOTG210_UDC=y):
> 
>   LD      drivers/usb/gadget/built-in.o
> WARNING: drivers/usb/gadget/built-in.o(.data+0xbf8): Section mismatch in reference from the variable fotg210_driver to the function .init.text:fotg210_udc_probe()
> The variable fotg210_driver references
> the function __init fotg210_udc_probe()
> If the reference is valid then annotate the
> variable with __init* or __refdata (see linux/init.h) or name the variable:
> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
> 
>   LD      drivers/usb/built-in.o
> WARNING: drivers/usb/built-in.o(.data+0x14684): Section mismatch in reference from the variable fotg210_driver to the function .init.text:fotg210_udc_probe()
> The variable fotg210_driver references
> the function __init fotg210_udc_probe()
> If the reference is valid then annotate the
> variable with __init* or __refdata (see linux/init.h) or name the variable:
> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
> 
>   LD      drivers/built-in.o
> WARNING: drivers/built-in.o(.data+0x8b0c8): Section mismatch in reference from the variable fotg210_driver to the function .init.text:fotg210_udc_probe()
> The variable fotg210_driver references
> the function __init fotg210_udc_probe()
> If the reference is valid then annotate the
> variable with __init* or __refdata (see linux/init.h) or name the variable:
> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
> 
>   CHK     include/generated/uapi/linux/version.h
>   LINK    vmlinux
>   LD      vmlinux.o
>   MODPOST vmlinux.o
> WARNING: vmlinux.o(.data+0xc6730): Section mismatch in reference from the variable fotg210_driver to the function .init.text:fotg210_udc_probe()
> The variable fotg210_driver references
> the function __init fotg210_udc_probe()
> If the reference is valid then annotate the
> variable with __init* or __refdata (see linux/init.h) or name the variable:
> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
> 
>   GEN     .version
>   CHK     include/generated/compile.h
>   UPD     include/generated/compile.h
>   CC      init/version.o
>   LD      init/built-in.o
> `.exit.text' referenced in section `.data' of drivers/built-in.o: defined in discarded section `.exit.text' of drivers/built-in.o
> make[3]: *** [vmlinux] Error 1
> 
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

has already being sent before. Sorry

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-07-15  9:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-10 21:45 [PATCH] usb: gadget: fotg210-udc: Remove bogus __init/__exit annotations Geert Uytterhoeven
2013-07-10 21:52 ` Sergei Shtylyov
2013-07-11  7:25   ` Geert Uytterhoeven
2013-07-12 21:44     ` Sergei Shtylyov
2013-07-15  9:59 ` Felipe Balbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox