Thread (8 messages) flat view 8 messages, 2 authors, 2012-01-22

Re: [PATCH] Input: q40kbd - convert driver to the split model

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2012-01-22 11:16:40
Also in: linux-m68k
Subsystem: m68k architecture, the rest · Maintainers: Geert Uytterhoeven, Linus Torvalds

On Wed, 18 Jan 2012, Dmitry Torokhov wrote:
quoted hunk ↗ jump to hunk
Input: q40kbd - convert driver to the split model

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Convert the driver to standard spilt model arch-specific code registers
platform device to which driver code can bind later.

Also request IRQ immediately upon binding to the device instead of doing
this when serio port is being opened.

Signed-off-by: Dmitry Torokhov <redacted>
---

 arch/m68k/q40/config.c       |    7 ++
 drivers/input/serio/q40kbd.c |  139 ++++++++++++++++++++++++------------------
 2 files changed, 86 insertions(+), 60 deletions(-)

diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c
index ad10fec..c72a3ed 100644
--- a/arch/m68k/q40/config.c
+++ b/arch/m68k/q40/config.c
@@ -24,6 +24,7 @@
 #include <linux/rtc.h>
 #include <linux/vt_kern.h>
 #include <linux/bcd.h>
+#include <linux/platform_device.h>
 
 #include <asm/io.h>
 #include <asm/rtc.h>
@@ -329,3 +330,9 @@ static int q40_set_rtc_pll(struct rtc_pll_info *pll)
 	} else
 		return -EINVAL;
 }
+
+static __init int q40_add_kbd_device(void)
+{
+	return platform_device_register_simple("q40kbd", -1, NULL, 0);
arch/m68k/q40/config.c: In function ‘q40_add_kbd_device’:
arch/m68k/q40/config.c:336: warning: return makes integer from pointer without a cast

Either ignore the error and always return 0, or:
diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c
index c72a3ed..be93648 100644
--- a/arch/m68k/q40/config.c
+++ b/arch/m68k/q40/config.c
@@ -333,6 +333,12 @@ static int q40_set_rtc_pll(struct rtc_pll_info *pll)
 
 static __init int q40_add_kbd_device(void)
 {
-	return platform_device_register_simple("q40kbd", -1, NULL, 0);
+	struct platform_device *pdev;
+
+	pdev = platform_device_register_simple("q40kbd", -1, NULL, 0);
+	if (IS_ERR(pdev))
+		return PTR_ERR(pdev);
+
+	return 0;
 }
 arch_initcall(q40_add_kbd_device);
The rest is
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help