rtc: rtc-puv3: Add __devinit and __devexit markers for probe and remove
PATCH 1/1 rtc: rtc-puv3: Add __devinit and __devexit markers for probe and remove
--- drivers/rtc/rtc-puv3.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/rtc/rtc-puv3.c +2 -2
@@ -220,7 +220,7 @@ static void puv3_rtc_enable(struct platform_device *pdev, int en) } } -static int puv3_rtc_remove (struct platform_device *dev) +static int __devexit puv3_rtc_remove(struct platform_device *dev) {struct rtc_device *rtc =platform_get_drvdata (dev);
@@ -236,7 +236,7 @@ static int puv3_rtc_remove(struct platform_device *dev)return 0 ; } -static int puv3_rtc_probe (struct platform_device *pdev) +static int __devinit puv3_rtc_probe (struct platform_device *pdev) {struct rtc_device *rtc;struct resource *res;
Signature · 1 line
1.7.4.1
Thanks Axel.
Guan Xuetao
Quoted 27 lines · Axel Lin
Signed-off-by Axel Lin <[email protected]>--- drivers/rtc/rtc-puv3.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)drivers/rtc/rtc-puv3.c +2
-2@@ -220,7 +220,7 @@ static void puv3_rtc_enable(struct platform_device *pdev, int en) } } -static int puv3_rtc_remove (struct platform_device *dev) +static int __devexit puv3_rtc_remove(struct platform_device *dev) {struct rtc_device *rtc =platform_get_drvdata (dev);@@ -236,7 +236,7 @@ static int puv3_rtc_remove(struct platform_device *dev)return 0 ; } -static int puv3_rtc_probe (struct platform_device *pdev) +static int __devinit puv3_rtc_probe (struct platform_device *pdev) {struct rtc_device *rtc;struct resource *res;
Guan Xuetao
Acked-bySorry, I should acknowledge it, not sign off.
I will push the patch into my repo, thanks.
Guan Xuetao
Quoted 35 lines · Guan Xuetao
Thanks Axel.
Signed-off-by Guan Xuetao<[email protected]>Guan Xuetao
Quoted 27 lines · Axel Lin
Signed-off-by Axel Lin <[email protected]>--- drivers/rtc/rtc-puv3.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)drivers/rtc/rtc-puv3.c +2
-2@@ -220,7 +220,7 @@ static void puv3_rtc_enable(struct platform_device *pdev, int en) } } -static int puv3_rtc_remove (struct platform_device *dev) +static int __devexit puv3_rtc_remove(struct platform_device *dev) {struct rtc_device *rtc =platform_get_drvdata (dev);@@ -236,7 +236,7 @@ static int puv3_rtc_remove(struct platform_device *dev)return 0 ; } -static int puv3_rtc_probe (struct platform_device *pdev) +static int __devinit puv3_rtc_probe (struct platform_device *pdev) {struct rtc_device *rtc;struct resource *res;
Hi Axel,
The patch yield following warnings:
WARNING: drivers/rtc/built-in.o(.data+0x90): Section mismatch in reference from the variable puv3_rtcdrv to the
function .devinit.text:puv3_rtc_probe()
The variable puv3_rtcdrv references
the function __devinit puv3_rtc_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
WARNING: drivers/rtc/built-in.o(.data+0x94): Section mismatch in reference from the variable puv3_rtcdrv to the
function .devexit.text:puv3_rtc_remove()
The variable puv3_rtcdrv references
the function __devexit puv3_rtc_remove()
If the reference is valid then annotate the
variable with __exit* (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
WARNING: drivers/built-in.o(.data+0x6c04): Section mismatch in reference from the variable puv3_rtcdrv to the
function .devinit.text:puv3_rtc_probe()
The variable puv3_rtcdrv references
the function __devinit puv3_rtc_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
WARNING: drivers/built-in.o(.data+0x6c08): Section mismatch in reference from the variable puv3_rtcdrv to the
function .devexit.text:puv3_rtc_remove()
The variable puv3_rtcdrv references
the function __devexit puv3_rtc_remove()
If the reference is valid then annotate the
variable with __exit* (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
WARNING: vmlinux.o(.data+0x1126c): Section mismatch in reference from the variable puv3_rtcdrv to the function .devinit.text:puv3_rtc_probe() The variable puv3_rtcdrv references
the function __devinit puv3_rtc_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
WARNING: vmlinux.o(.data+0x11270): Section mismatch in reference from the variable puv3_rtcdrv to the function .devexit.text:puv3_rtc_remove() The variable puv3_rtcdrv references
the function __devexit puv3_rtc_remove()
If the reference is valid then annotate the
variable with __exit* (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
For puv3_rtc_probe, I think it should be in the white-list, but warnings are yielded.
For puv3_rtc_remove, the warning could be disappeared by modifying __devexit to __exit, however is it proper?
Also,
Cc: Michal Marek <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Any advice is appreciated, thanks.
Guan Xuetao
Quoted 27 lines · Axel Lin
Signed-off-by Axel Lin <[email protected]>--- drivers/rtc/rtc-puv3.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)drivers/rtc/rtc-puv3.c +2
-2@@ -220,7 +220,7 @@ static void puv3_rtc_enable(struct platform_device *pdev, int en) } } -static int puv3_rtc_remove (struct platform_device *dev) +static int __devexit puv3_rtc_remove(struct platform_device *dev) {struct rtc_device *rtc =platform_get_drvdata (dev);@@ -236,7 +236,7 @@ static int puv3_rtc_remove(struct platform_device *dev)return 0 ; } -static int puv3_rtc_probe (struct platform_device *pdev) +static int __devinit puv3_rtc_probe (struct platform_device *pdev) {struct rtc_device *rtc;struct resource *res;
hi Guan,
Quoted 5 lines
For
puv3_rtc_probe, I think it should be in the white-list, but warnings are yielded.
Forpuv3_rtc_remove, the warning could be disappeared by modifying__devexitto__exit, however is it proper?
I'm not able to reproduce it on linux-next tree (20111014). If I Enable loadable module support, I got below build error:
CC arch/unicore32/kernel/ksyms.oarch/unicore32/kernel/ksyms.c:39: error: 'csum_partial_copy_nocheck' undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:39: warning: type defaults to 'int' in declaration of 'csum_partial_copy_nocheck' arch/unicore32/kernel/ksyms.c:40: error: '__csum_ipv6_magic' undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:40: warning: type defaults to 'int' in declaration of '__csum_ipv6_magic' arch/unicore32/kernel/ksyms.c:44: error: '__raw_readsb' undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:44: warning: type defaults to 'int' in declaration of '__raw_readsb' arch/unicore32/kernel/ksyms.c:47: error: '__raw_readsw' undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:47: warning: type defaults to 'int' in declaration of '__raw_readsw' arch/unicore32/kernel/ksyms.c:50: error: '__raw_readsl' undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:50: warning: type defaults to 'int' in declaration of '__raw_readsl' arch/unicore32/kernel/ksyms.c:53: error: '__raw_writesb' undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:53: warning: type defaults to 'int' in declaration of '__raw_writesb' arch/unicore32/kernel/ksyms.c:56: error: '__raw_writesw' undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:56: warning: type defaults to 'int' in declaration of '__raw_writesw' arch/unicore32/kernel/ksyms.c:59: error: '__raw_writesl' undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:59: warning: type defaults to 'int' in declaration of '__raw_writesl' arch/unicore32/kernel/ksyms.c:80: error: '__get_user_1' undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:80: warning: type defaults to 'int' in declaration of '__get_user_1' arch/unicore32/kernel/ksyms.c:81: error: '__get_user_2' undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:81: warning: type defaults to 'int' in declaration of '__get_user_2' arch/unicore32/kernel/ksyms.c:82: error: '__get_user_4' undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:82: warning: type defaults to 'int' in declaration of '__get_user_4' arch/unicore32/kernel/ksyms.c:84: error: '__put_user_1' undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:84: warning: type defaults to 'int' in declaration of '__put_user_1' arch/unicore32/kernel/ksyms.c:85: error: '__put_user_2' undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:85: warning: type defaults to 'int' in declaration of '__put_user_2' arch/unicore32/kernel/ksyms.c:86: error: '__put_user_4' undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:86: warning: type defaults to 'int' in declaration of '__put_user_4' arch/unicore32/kernel/ksyms.c:87: error: '__put_user_8' undeclared here (not in a function) arch/unicore32/kernel/ksyms.c:87: warning: type defaults to 'int' in declaration of '__put_user_8'
make[1]: *** [arch/unicore32/kernel/ksyms.o] Error 1
make: *** [arch/unicore32/kernel] Error 2
I also try to clone unicore tree, but I got connection timed out. :-(
axel@phoenix:~/repos/git$ git clone git://master.kernel.org/pub/scm/linux/kernel/git/epip/linux-unicore.git Cloning into linux-unicore... master.kernel.org[0: 140.211.167.34]: errno=Connection timed out fatal: unable to connect a socket (Connection timed out)
Regards,
Axel
Quoted 66 lines · Axel Lin
hi Guan,
Quoted 5 lines
For
puv3_rtc_probe, I think it should be in the white-list, but warnings are yielded.
Forpuv3_rtc_remove, the warning could be disappeared by modifying__devexitto__exit, however is it proper?I'm not able to reproduce it on linux-next tree (20111014). If I Enable loadable module support, I got below build error:
CC
arch/unicore32/kernel/ksyms.oarch/unicore32/kernel/ksyms.c:39: error: 'csum_partial_copy_nocheck' undeclared here (not in a function)arch/unicore32/kernel/ksyms.c:39: warning: type defaults to 'int' in declaration of 'csum_partial_copy_nocheck'arch/unicore32/kernel/ksyms.c:40: error: '__csum_ipv6_magic' undeclared here (not in a function)arch/unicore32/kernel/ksyms.c:40: warning: type defaults to 'int' in declaration of '__csum_ipv6_magic'arch/unicore32/kernel/ksyms.c:44: error: '__raw_readsb' undeclared here (not in a function)arch/unicore32/kernel/ksyms.c:44: warning: type defaults to 'int' in declaration of '__raw_readsb'arch/unicore32/kernel/ksyms.c:47: error: '__raw_readsw' undeclared here (not in a function)arch/unicore32/kernel/ksyms.c:47: warning: type defaults to 'int' in declaration of '__raw_readsw'arch/unicore32/kernel/ksyms.c:50: error: '__raw_readsl' undeclared here (not in a function)arch/unicore32/kernel/ksyms.c:50: warning: type defaults to 'int' in declaration of '__raw_readsl'arch/unicore32/kernel/ksyms.c:53: error: '__raw_writesb' undeclared here (not in a function)arch/unicore32/kernel/ksyms.c:53: warning: type defaults to 'int' in declaration of '__raw_writesb'arch/unicore32/kernel/ksyms.c:56: error: '__raw_writesw' undeclared here (not in a function)arch/unicore32/kernel/ksyms.c:56: warning: type defaults to 'int' in declaration of '__raw_writesw'arch/unicore32/kernel/ksyms.c:59: error: '__raw_writesl' undeclared here (not in a function)arch/unicore32/kernel/ksyms.c:59: warning: type defaults to 'int' in declaration of '__raw_writesl'arch/unicore32/kernel/ksyms.c:80: error: '__get_user_1' undeclared here (not in a function)arch/unicore32/kernel/ksyms.c:80: warning: type defaults to 'int' in declaration of '__get_user_1'arch/unicore32/kernel/ksyms.c:81: error: '__get_user_2' undeclared here (not in a function)arch/unicore32/kernel/ksyms.c:81: warning: type defaults to 'int' in declaration of '__get_user_2'arch/unicore32/kernel/ksyms.c:82: error: '__get_user_4' undeclared here (not in a function)arch/unicore32/kernel/ksyms.c:82: warning: type defaults to 'int' in declaration of '__get_user_4'arch/unicore32/kernel/ksyms.c:84: error: '__put_user_1' undeclared here (not in a function)arch/unicore32/kernel/ksyms.c:84: warning: type defaults to 'int' in declaration of '__put_user_1'arch/unicore32/kernel/ksyms.c:85: error: '__put_user_2' undeclared here (not in a function)arch/unicore32/kernel/ksyms.c:85: warning: type defaults to 'int' in declaration of '__put_user_2'arch/unicore32/kernel/ksyms.c:86: error: '__put_user_4' undeclared here (not in a function)
Quoted 8 lines
arch/unicore32/kernel/ksyms.c:86: warning: type defaults to 'int' in declaration of '__put_user_4'arch/unicore32/kernel/ksyms.c:87: error: '__put_user_8' undeclared here (not in a function)arch/unicore32/kernel/ksyms.c:87: warning: type defaults to 'int' in declaration of '__put_user_8'
make[1]: *** [arch/unicore32/kernel/ksyms.o] Error 1
make: *** [arch/unicore32/kernel] Error 2
This output seems that there is no cross-compiler in your machine. And the cross-compiler could be downloaded from my website:
http://mprc.pku.edu.cn/~guanxuetao/linux/uc4-1.0.5-hard.tgz
(about 100MB, including glibc for unicore32)
Quoted 8 lines
I also try to clone unicore tree, but I got connection timed out. :-(
axel@phoenix:~/repos/git$ git clone git://master.kernel.org/pub/scm/linux/kernel/git/epip/linux-unicore.git Cloning into linux-unicore... master.kernel.org[0: 140.211.167.34]: errno=Connection timed out fatal: unable to connect a socket (Connection timed out)
Sorry, I just notify the email by Peter Anvin.
And I will re-establish my PGP and repo recently.
Thanks,
Guan Xuetao
Quoted 3 lines
Regards,
Axel
Quoted 13 lines · Guan Xuetao
Hi Axel,
The patch yield following warnings:WARNING: drivers/rtc/built-in.o(.data+0x90): Section mismatch in reference from the variable
puv3_rtcdrvto the
function .devinit.text:puv3_rtc_probe()
The variablepuv3_rtcdrvreferences
the function__devinitpuv3_rtc_probe()
If the reference is valid then annotate the
variable with __init* or__refdata(seelinux/init.h) or name the variable:
*driver,*_template,*_timer,*_sht,*_ops,*_probe,*_probe_one,*_console
[...]
Quoted 5 lines
For
puv3_rtc_probe, I think it should be in the white-list, but warnings are yielded.
Forpuv3_rtc_remove, the warning could be disappeared by modifying__devexitto__exit, however is it proper?
The warning message tries to hint at the solution. Just name the variable
static struct platform_driver puv3_rtc_driver
and modpost will know that this is simply a list of pointers to driver functions, in which case the section mismatch is OK (the init function will only be called at init time).
Michal
Quoted 7 lines · Michal Marek
The warning message tries to hint at the solution. Just name the variable
static struct
platform_driverpuv3_rtc_driverand modpost will know that this is simply a list of pointers to driver functions, in which case the section mismatch is OK (the init function will only be called at init time).
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Correction: it's actually a probe function with __devinit, which on most setups (with CONFIG_HOTPLUG=y) can be called any time, but then on those setups the __devinit does not cause the section to be freed. Nevertheless, naming the variable puv3_rtc_driver is the correct solution.
Michal