x86: platform: mrst: check platform_device_register() return code
Subsystems (2)
PATCH 1/4 x86: platform: mrst: check platform_device_register() return code
platform_device_register() may fail, if so propagate the return code from mrst_device_create().
---
I cannot compile this driver in next-20101117, so it is not tested at all.
arch/x86/platform/mrst/vrtc.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
arch/x86/platform/mrst/vrtc.c +1 -2
@@ -159,8 +159,7 @@ static int __init mrst_device_create(void) vrtc_resources[1 ].start = sfi_mrtc_array[0 ].irq; vrtc_resources[1 ].end = sfi_mrtc_array[0 ].irq; -platform_device_register (&vrtc_device); -return 0 ; +return platform_device_register (&vrtc_device); }module_init (mrst_device_create);
Signature · 1 line
1.7.0.4
Quoted 2 lines
I cannot compile this driver in next-20101117, so it is not tested
at all.
Compile or test - if it bombs out compiling for you please send me (off list the .config that fails so I can fix that
Otherwise NAK the patch because it needs to do the cleanup but thanks for finding the bug - you've done the hard 99%
Alan
Quoted 8 lines · Alan Cox
Quoted 2 lines
I cannot compile this driver in next-20101117, so it is not tested
at all.Compile or test - if it bombs out compiling for you please send me (off list the .config that fails so I can fix that
Otherwise NAK the patch because it needs to do the cleanup but thanks for finding the bug - you've done the hard 99%
make -C /home/vasya/linux arch/x86/platform/mrst/vrtc.o
make: Entering directory `/home/vasya/dev/linux-next'
CHK include/linux/version.h CHK include/generated/utsrelease.h CALL scripts/checksyscalls.sh CC arch/x86/platform/mrst/vrtc.o
arch/x86/platform/mrst/vrtc.c: In function 'mrst_rtc_init':arch/x86/platform/mrst/vrtc.c:113: error: 'FIX_LNW_VRTC' undeclared (first use in this function) arch/x86/platform/mrst/vrtc.c:113: error: (Each undeclared identifier is reported only once arch/x86/platform/mrst/vrtc.c:113: error: for each function it appears in.) make[1]: *** [arch/x86/platform/mrst/vrtc.o] Error 1
Both with allyesconfig and allmodconfig, x86_64.
These are not patched lines, though.
Thanks,
Signature · 2 lines
Vasiliy Kulikov http://www.openwall.com - bringing security into open computing environments
Quoted 16 lines · On Thu, 18 Nov 2010 21:44:21 +0300 Vasiliy Kulikov <[email protected]> wrote:
Quoted 8 lines · Alan Cox
Quoted 2 lines
I cannot compile this driver in next-20101117, so it is not
tested at all.Compile or test - if it bombs out compiling for you please send me (off list the .config that fails so I can fix that
Otherwise NAK the patch because it needs to do the cleanup but thanks for finding the bug - you've done the hard 99%
make -C
/home/vasya/linuxarch/x86/platform/mrst/vrtc.o
make: Entering directory `/home/vasya/dev/linux-next'CHK include/linux/version.h CHK include/generated/utsrelease.h CALL scripts/checksyscalls.sh CC arch/x86/platform/mrst/vrtc.o
Quoted 8 lines
arch/x86/platform/mrst/vrtc.c: In function 'mrst_rtc_init':arch/x86/platform/mrst/vrtc.c:113: error: 'FIX_LNW_VRTC' undeclared (first use in this function)arch/x86/platform/mrst/vrtc.c:113:
error: (Each undeclared identifier is reported only oncearch/x86/platform/mrst/vrtc.c:113: error: for each function it appears in.) make[1]: *** [arch/x86/platform/mrst/vrtc.o] Error 1Both with allyesconfig and allmodconfig,
x86_64.
I can't duplicate this.
It's defined if CONFIG_X86_MRST is defined, and the file in question is only compiled if CONFIG_X86_MRST is defined
Quoted 26 lines · Alan Cox
Quoted 23 lines · On Thu, 18 Nov 2010 21:44:21 +0300 Vasiliy Kulikov <[email protected]> wrote:
Quoted 8 lines · Alan Cox
Quoted 2 lines
I cannot compile this driver in next-20101117, so it is not
tested at all.Compile or test - if it bombs out compiling for you please send me (off list the .config that fails so I can fix that
Otherwise NAK the patch because it needs to do the cleanup but thanks for finding the bug - you've done the hard 99%
make -C
/home/vasya/linuxarch/x86/platform/mrst/vrtc.o
make: Entering directory `/home/vasya/dev/linux-next'CHK include/linux/version.h CHK include/generated/utsrelease.h CALL scripts/checksyscalls.sh CC arch/x86/platform/mrst/vrtc.o
arch/x86/platform/mrst/vrtc.c: In function 'mrst_rtc_init':arch/x86/platform/mrst/vrtc.c:113: error: 'FIX_LNW_VRTC' undeclared (first use in this function)arch/x86/platform/mrst/vrtc.c:113:
error: (Each undeclared identifier is reported only oncearch/x86/platform/mrst/vrtc.c:113: error: for each function it appears in.) make[1]: *** [arch/x86/platform/mrst/vrtc.o] Error 1
Quoted 6 lines
Quoted 1 line
Both with allyesconfig and allmodconfig,
x86_64.I can't duplicate this.
It's defined if
CONFIG_X86_MRSTis defined, and the file in question is only compiled ifCONFIG_X86_MRSTis defined
Of course you can't duplicate this:
Quoted 1 line
Quoted 1 line
make -C
/home/vasya/linuxarch/x86/platform/mrst/vrtc.o
Vasiliy forced a manual compile of that file with a 64bit config which has CONFIG_X86_MRST=n. That's PEBKAC not a build failure :)
Thanks,
tglx
Quoted 4 lines · On Thu, 18 Nov 2010 21:16:45 +0300 Vasiliy Kulikov <[email protected]> wrote:
platform_device_register()may fail, if so propagate the return code frommrst_device_create().Signed-off-by Vasiliy Kulikov <[email protected]>
On further inspection this fix is actually correct as the other cleanup got moved to the arch/x86 driver.
Alan
[tip:x86/platform] x86, mrst: Check platform_device_register() return code
In reply to Vasiliy KulikovCommit-ID: 5ca9afdb9f6a5267927b54de3f42c756e8af7fcd Gitweb: http://git.kernel.org/tip/5ca9afdb9f6a5267927b54de3f42c756e8af7fcd Author: Vasiliy Kulikov <[email protected]> AuthorDate: Thu, 18 Nov 2010 21:16:45 +0300 Committer: H. Peter Anvin <[email protected]> CommitDate: Thu, 18 Nov 2010 13:45:46 -0800
x86, mrst: Check platform_device_register() return code
platform_device_register() may fail, if so propagate the return code from mrst_device_create().
LKML-Reference: <[email protected]>
--- arch/x86/platform/mrst/vrtc.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
arch/x86/platform/mrst/vrtc.c +1 -2
@@ -159,8 +159,7 @@ static int __init mrst_device_create(void) vrtc_resources[1 ].start = sfi_mrtc_array[0 ].irq; vrtc_resources[1 ].end = sfi_mrtc_array[0 ].irq; -platform_device_register (&vrtc_device); -return 0 ; +return platform_device_register (&vrtc_device); }module_init (mrst_device_create);