From d3d25808df236f27ba34125e7cf90de98fbf346c Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Tue, 10 Jan 2012 15:08:01 -0800 Subject: Input: revert some over-zealous conversions to module_platform_driver() Recent conversion to module_platform_driver() went a bit too far and converted not only drivers that used platform_driver_register() but also ones using platform_driver_probe(), breaking them in process. Reported-by: Geert Uytterhoeven Signed-off-by: Dmitry Torokhov --- drivers/input/serio/at32psif.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'drivers/input/serio') diff --git a/drivers/input/serio/at32psif.c b/drivers/input/serio/at32psif.c index 421a7442e464..95280f9207e1 100644 --- a/drivers/input/serio/at32psif.c +++ b/drivers/input/serio/at32psif.c @@ -358,7 +358,19 @@ static struct platform_driver psif_driver = { .suspend = psif_suspend, .resume = psif_resume, }; -module_platform_driver(psif_driver); + +static int __init psif_init(void) +{ + return platform_driver_probe(&psif_driver, psif_probe); +} + +static void __exit psif_exit(void) +{ + platform_driver_unregister(&psif_driver); +} + +module_init(psif_init); +module_exit(psif_exit); MODULE_AUTHOR("Hans-Christian Egtvedt "); MODULE_DESCRIPTION("Atmel AVR32 PSIF PS/2 driver"); -- cgit v1.2.3 From d89c9bcb33909568905ec9c4b44a18cd8bd88aaa Mon Sep 17 00:00:00 2001 From: Che-Liang Chiou Date: Tue, 10 Jan 2012 00:45:12 -0800 Subject: Input: serio_raw - remove stray semicolon Signed-off-by: Che-Liang Chiou Signed-off-by: Dmitry Torokhov --- drivers/input/serio/serio_raw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/input/serio') diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c index 4d4cd142bbbb..ca78a890c75d 100644 --- a/drivers/input/serio/serio_raw.c +++ b/drivers/input/serio/serio_raw.c @@ -220,7 +220,7 @@ static ssize_t serio_raw_write(struct file *file, const char __user *buffer, goto out; } written++; - }; + } out: mutex_unlock(&serio_raw_mutex); -- cgit v1.2.3 From 0c62fbf6009fa338bd28bdcb14efbfc5fc0c579b Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Tue, 10 Jan 2012 00:45:12 -0800 Subject: Input: serio_raw - really signal HUP upon disconnect Commit 8c1c10d5706bbb3b41cb4a5578339d67d3eeffc2 attempted to signal POLLHUP | POLLERR condition when polling disconnected device, unfortunately it did not do it quite correctly. Reported-by: Che-Liang Chiou Signed-off-by: Dmitry Torokhov --- drivers/input/serio/serio_raw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/input/serio') diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c index ca78a890c75d..f6c83e9ecff6 100644 --- a/drivers/input/serio/serio_raw.c +++ b/drivers/input/serio/serio_raw.c @@ -237,9 +237,9 @@ static unsigned int serio_raw_poll(struct file *file, poll_table *wait) mask = serio_raw->dead ? POLLHUP | POLLERR : POLLOUT | POLLWRNORM; if (serio_raw->head != serio_raw->tail) - return POLLIN | POLLRDNORM; + mask |= POLLIN | POLLRDNORM; - return 0; + return mask; } static const struct file_operations serio_raw_fops = { -- cgit v1.2.3 From 4fa0771138d0b56fe59ab8ab3b1ce9e594484362 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Tue, 10 Jan 2012 00:45:12 -0800 Subject: Input: serio_raw - return proper result when serio_raw_write fails If serio_raw_write was always returning number of bytes successfully sent to serio port and never signalled error condition to the caller. Change it so that for completely failed transfers appropriate error code returned to the caller (partially successful writes still return number of bytes transferred). Reported-by: Che-liang Chiou Signed-off-by: Dmitry Torokhov --- drivers/input/serio/serio_raw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/input/serio') diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c index f6c83e9ecff6..8250299fd64f 100644 --- a/drivers/input/serio/serio_raw.c +++ b/drivers/input/serio/serio_raw.c @@ -224,7 +224,7 @@ static ssize_t serio_raw_write(struct file *file, const char __user *buffer, out: mutex_unlock(&serio_raw_mutex); - return written; + return written ?: retval; } static unsigned int serio_raw_poll(struct file *file, poll_table *wait) -- cgit v1.2.3