lkml.org 
[lkml]   [2008]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: section mismatch with a platform driver
On Mon, 13 Oct 2008 11:28:23 +0200 Neshama Parhoti wrote:

> Hi Adrian and thank you for the help!
>
> On Mon, Oct 13, 2008 at 10:51 AM, Adrian Bunk <bunk@kernel.org> wrote:
> > On Mon, Oct 13, 2008 at 10:19:05AM +0200, Neshama Parhoti wrote:
> >> WARNING: vmlinux.o(.data+0x44bc4): Section mismatch: reference to
> >> .init.text:my_probe_func (between 'my_platform_struct' and
> >> 'debug_level_variable')
> >>
> >> If I understand correctly, it shouts about my probe function being
> >> referenced from the data section:
> >>
> >> static struct platform_driver my_platform_struct = {
> >> .probe = my_probe_func,
> >> .remove = my_remove,
> >> .suspend = my_suspend,
> >> .resume = my_resume,
> >> .driver = {
> >> .name = DRIVER_NAME,
> >> },
> >> };
> >>
> > It complains about "my_probe_func", and that's not even in the code
> > you posted.
>
> It happens even if I use an empty function like this:
>
> static int __init my_probe_func(struct platform_device *pdev)
> {
> return 0;
> }
>
>
> any idea what's the problem ?

A probe function can be called at any time -- i.e., after system init
has completed, so discarding the __init function my_probe_func() is BAD,
dangerous, BUGgy.

---
~Randy


\
 
 \ /
  Last update: 2008-10-13 18:05    [W:0.162 / U:0.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site