public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: use platform_device_register_simple()
@ 2008-09-21 14:25 Akinobu Mita
  2008-09-22 10:11 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Akinobu Mita @ 2008-09-21 14:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin

Cleanup pcspeaker.c

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
---
 arch/x86/kernel/pcspeaker.c |   13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

Index: 2.6-git/arch/x86/kernel/pcspeaker.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/pcspeaker.c
+++ 2.6-git/arch/x86/kernel/pcspeaker.c
@@ -1,20 +1,13 @@
 #include <linux/platform_device.h>
-#include <linux/errno.h>
+#include <linux/err.h>
 #include <linux/init.h>
 
 static __init int add_pcspkr(void)
 {
 	struct platform_device *pd;
-	int ret;
 
-	pd = platform_device_alloc("pcspkr", -1);
-	if (!pd)
-		return -ENOMEM;
+	pd = platform_device_register_simple("pcspkr", -1, NULL, 0);
 
-	ret = platform_device_add(pd);
-	if (ret)
-		platform_device_put(pd);
-
-	return ret;
+	return IS_ERR(pd) ? PTR_ERR(pd) : 0;
 }
 device_initcall(add_pcspkr);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] x86: use platform_device_register_simple()
  2008-09-21 14:25 [PATCH] x86: use platform_device_register_simple() Akinobu Mita
@ 2008-09-22 10:11 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2008-09-22 10:11 UTC (permalink / raw)
  To: Akinobu Mita; +Cc: linux-kernel, Thomas Gleixner, Ingo Molnar, H. Peter Anvin


* Akinobu Mita <akinobu.mita@gmail.com> wrote:

> Cleanup pcspeaker.c

> -	pd = platform_device_alloc("pcspkr", -1);
> +	pd = platform_device_register_simple("pcspkr", -1, NULL, 0);

applied to tip/x86/cleanups, thanks!

	Ingo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-09-22 10:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-21 14:25 [PATCH] x86: use platform_device_register_simple() Akinobu Mita
2008-09-22 10:11 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox