Re: section mismatch with a platform driver

From: sniper
Date: Mon Oct 13 2008 - 16:23:21 EST


There are some examples in kernel as following:

static struct platform_driver my_platform_driver = {
.probe = my_probe_func,
.remove = __devexit_p(my_remove),
.suspend = my_suspend,
.resume = my_resume,
.driver = {
.name = DRIVER_NAME,
},
};


static int __devinit my_probe_func(struct platform_device *pdev)
{
return 0;
}

note that my_platform_*driver*, it let this variable can refer to
init/exit sections.
You can find the explanation in /scripts/mod/modpost.c:

/* symbols in .data that may refer to init/exit sections */
static const char *symbol_white_list[] =
{
"*driver",
"*_template", /* scsi uses *_template a lot */
"*_timer", /* arm uses ops structures named _timer a lot */
"*_sht", /* scsi also used *_sht to some extent */
"*_ops",
"*_probe",
"*_probe_one",
"*_console",
NULL
};


On Tue, Oct 14, 2008 at 2:58 AM, Neshama Parhoti <pneshama@xxxxxxxxx> wrote:
> On Mon, Oct 13, 2008 at 6:31 PM, Randy Dunlap <randy.dunlap@xxxxxxxxxx> wrote:
>>> Does that mean that all drivers with __init in their probe functions are bogus ?
>>
>> It depends. If your platform doesn't support hotplug, then it's possible
>> that the probe function is only called during system init, so it would be OK.
>
> Hmm any idea then why did it give me a section mismatch warning ?
>
> Thanks!!
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/