All of lore.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: "Neshama Parhoti" <pneshama@gmail.com>
Cc: "Adrian Bunk" <bunk@kernel.org>, linux-kernel@vger.kernel.org
Subject: Re: section mismatch with a platform driver
Date: Mon, 13 Oct 2008 09:01:33 -0700	[thread overview]
Message-ID: <20081013090133.a58116a2.randy.dunlap@oracle.com> (raw)
In-Reply-To: <912ec82a0810130228m3e9e11bcyfcabe1ab46fb0b6b@mail.gmail.com>

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

  parent reply	other threads:[~2008-10-13 16:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-13  8:19 section mismatch with a platform driver Neshama Parhoti
2008-10-13  8:51 ` Adrian Bunk
2008-10-13  9:28   ` Neshama Parhoti
2008-10-13  9:43     ` Gilad Ben-Yossef
2008-10-13 11:11       ` Neshama Parhoti
2008-10-13  9:50     ` Adrian Bunk
2008-10-13 11:13       ` Neshama Parhoti
2008-10-13 16:01     ` Randy Dunlap [this message]
2008-10-13 16:29       ` Neshama Parhoti
2008-10-13 16:31         ` Randy Dunlap
2008-10-13 18:58           ` Neshama Parhoti
2008-10-13 19:00             ` Randy Dunlap
2008-10-13 20:22             ` sniper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081013090133.a58116a2.randy.dunlap@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=bunk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pneshama@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.