Skip to contentSkip to conversation

x86: platform: mrst: check platform_device_register() return code

PATCH In review Vasiliy Kulikov 3 participants 7 messages Nov 18, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
index 4d3f770..32cd7ed 100644
@@ -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
#1 lore raw
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

#2 lore raw
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
#3 lore raw
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/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
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 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.

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

#4 lore raw
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/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

Quoted 6 lines
Quoted 1 line

Both 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

Of course you can't duplicate this:

Quoted 1 line
Quoted 1 line

make -C /home/vasya/linux arch/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

#6 lore raw

[tip:x86/platform] x86, mrst: Check platform_device_register() return code

In reply to Vasiliy Kulikov
Commit-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
index 4d3f770..32cd7ed 100644
@@ -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);