Patchwork rtc: mrst: Fix section mismatch warning

login
register
mail settings
Submitter Ameya Palande
Date April 1, 2011, 12:10 p.m.
Message ID <1301659803-21721-1-git-send-email-ameya.palande@nokia.com>
Download mbox | patch
Permalink /patch/89252/
State New
Headers show

Comments

Ameya Palande - April 1, 2011, 12:10 p.m.
WARNING: vmlinux.o(.data+0x25d08): Section mismatch in reference from the
variable vrtc_mrst_platform_driver to the function
.init.text:vrtc_mrst_platform_probe()

The variable vrtc_mrst_platform_driver references
the function __init vrtc_mrst_platform_probe()

Signed-off-by: Ameya Palande <ameya.palande@nokia.com>
---
 drivers/rtc/rtc-mrst.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Mark Brown - April 2, 2011, 7:57 a.m.
On Fri, Apr 01, 2011 at 03:10:03PM +0300, Ameya Palande wrote:

>  static struct platform_driver vrtc_mrst_platform_driver = {
> -	.probe		= vrtc_mrst_platform_probe,
>  	.remove		= __exit_p(vrtc_mrst_platform_remove),
>  	.shutdown	= vrtc_mrst_platform_shutdown,
>  	.driver = {
> @@ -536,7 +535,8 @@ static struct platform_driver vrtc_mrst_platform_driver = {
>  
>  static int __init vrtc_mrst_init(void)
>  {
> -	return platform_driver_register(&vrtc_mrst_platform_driver);
> +	return platform_driver_probe(&vrtc_mrst_platform_driver,
> +			vrtc_mrst_platform_probe);
>  }

This isn't a good fix, _register() and _probe() do different things.  It
would be better to fix the annotation of the _probe() function to be
__devinit.
Mark Brown - April 2, 2011, 8:05 a.m.
On Sat, Apr 02, 2011 at 08:57:24AM +0100, Mark Brown wrote:
> On Fri, Apr 01, 2011 at 03:10:03PM +0300, Ameya Palande wrote:
> 
> >  static struct platform_driver vrtc_mrst_platform_driver = {

> This isn't a good fix, _register() and _probe() do different things.  It
> would be better to fix the annotation of the _probe() function to be
> __devinit.

Please also avoid CCing patches to subscribers only lists such as the
meego-kernel list, replies to your patch will generate bounces.
Subscribers only probably isn't a good default for a kernel list.
Alan Cox - April 4, 2011, 10:30 a.m.
On Fri,  1 Apr 2011 15:10:03 +0300
Ameya Palande <ameya.palande@nokia.com> wrote:

> WARNING: vmlinux.o(.data+0x25d08): Section mismatch in reference from
> the variable vrtc_mrst_platform_driver to the function
> .init.text:vrtc_mrst_platform_probe()
> 
> The variable vrtc_mrst_platform_driver references
> the function __init vrtc_mrst_platform_probe()
> 
> Signed-off-by: Ameya Palande <ameya.palande@nokia.com>

I've already sent different patches for this upstream several times.
I'll push whats in our tree direct to Linus as I've had no response.
Ameya Palande - April 4, 2011, 6:22 p.m.
Hi Mark,

On 04/02/2011 11:05 AM, ext Mark Brown wrote:
> On Sat, Apr 02, 2011 at 08:57:24AM +0100, Mark Brown wrote:
>> On Fri, Apr 01, 2011 at 03:10:03PM +0300, Ameya Palande wrote:
>>
>>>   static struct platform_driver vrtc_mrst_platform_driver = {
>
>> This isn't a good fix, _register() and _probe() do different things.  It
>> would be better to fix the annotation of the _probe() function to be
>> __devinit.
>
> Please also avoid CCing patches to subscribers only lists such as the
> meego-kernel list, replies to your patch will generate bounces.
> Subscribers only probably isn't a good default for a kernel list.

Thank! I will take care :)

Cheers,
Ameya.
Ameya Palande - April 4, 2011, 6:27 p.m.
Hi Mark,

On 04/02/2011 10:57 AM, ext Mark Brown wrote:
> On Fri, Apr 01, 2011 at 03:10:03PM +0300, Ameya Palande wrote:
>
>>   static struct platform_driver vrtc_mrst_platform_driver = {
>> -	.probe		= vrtc_mrst_platform_probe,
>>   	.remove		= __exit_p(vrtc_mrst_platform_remove),
>>   	.shutdown	= vrtc_mrst_platform_shutdown,
>>   	.driver = {
>> @@ -536,7 +535,8 @@ static struct platform_driver vrtc_mrst_platform_driver = {
>>
>>   static int __init vrtc_mrst_init(void)
>>   {
>> -	return platform_driver_register(&vrtc_mrst_platform_driver);
>> +	return platform_driver_probe(&vrtc_mrst_platform_driver,
>> +			vrtc_mrst_platform_probe);
>>   }
>
> This isn't a good fix, _register() and _probe() do different things.  It
> would be better to fix the annotation of the _probe() function to be
> __devinit.

Thanks for your review!

Cheers,
Ameya.
Ameya Palande - April 4, 2011, 6:33 p.m.
Hi Alan,

On 04/04/2011 01:30 PM, ext Alan Cox wrote:
> On Fri,  1 Apr 2011 15:10:03 +0300
> Ameya Palande<ameya.palande@nokia.com>  wrote:
>
>> WARNING: vmlinux.o(.data+0x25d08): Section mismatch in reference from
>> the variable vrtc_mrst_platform_driver to the function
>> .init.text:vrtc_mrst_platform_probe()
>>
>> The variable vrtc_mrst_platform_driver references
>> the function __init vrtc_mrst_platform_probe()
>>
>> Signed-off-by: Ameya Palande<ameya.palande@nokia.com>
>
> I've already sent different patches for this upstream several times.
> I'll push whats in our tree direct to Linus as I've had no response.

No problem!

I was trying to understand the problem and I found following code in 
arch/x86/platform/mrst/vrtc.c

static struct platform_device vrtc_device = {
         .name           = "rtc_mrst",
         .id             = -1,
         .resource       = vrtc_resources,
         .num_resources  = ARRAY_SIZE(vrtc_resources),
};

Is .name = "rtc_mrst" correct? Or should it be "vrtc_mrst"?
Driver is using MODULE_ALIAS("platform:vrtc_mrst")

Cheers,
Ameya.

Patch

diff --git a/drivers/rtc/rtc-mrst.c b/drivers/rtc/rtc-mrst.c
index b86bc32..57a11be 100644
--- a/drivers/rtc/rtc-mrst.c
+++ b/drivers/rtc/rtc-mrst.c
@@ -524,7 +524,6 @@  static void vrtc_mrst_platform_shutdown(struct platform_device *pdev)
 MODULE_ALIAS("platform:vrtc_mrst");
 
 static struct platform_driver vrtc_mrst_platform_driver = {
-	.probe		= vrtc_mrst_platform_probe,
 	.remove		= __exit_p(vrtc_mrst_platform_remove),
 	.shutdown	= vrtc_mrst_platform_shutdown,
 	.driver = {
@@ -536,7 +535,8 @@  static struct platform_driver vrtc_mrst_platform_driver = {
 
 static int __init vrtc_mrst_init(void)
 {
-	return platform_driver_register(&vrtc_mrst_platform_driver);
+	return platform_driver_probe(&vrtc_mrst_platform_driver,
+			vrtc_mrst_platform_probe);
 }
 
 static void __exit vrtc_mrst_exit(void)