projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] usbfs: use the correct signal number for disconnection
[powerpc.git]
/
drivers
/
char
/
hvc_vio.c
diff --git
a/drivers/char/hvc_vio.c
b/drivers/char/hvc_vio.c
index
78d681d
..
9add81c
100644
(file)
--- a/
drivers/char/hvc_vio.c
+++ b/
drivers/char/hvc_vio.c
@@
-31,10
+31,13
@@
#include <linux/types.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/init.h>
+
#include <asm/hvconsole.h>
#include <asm/vio.h>
#include <asm/prom.h>
#include <asm/hvconsole.h>
#include <asm/vio.h>
#include <asm/prom.h>
+#include "hvc_console.h"
+
char hvc_driver_name[] = "hvc_console";
static struct vio_device_id hvc_driver_table[] __devinitdata = {
char hvc_driver_name[] = "hvc_console";
static struct vio_device_id hvc_driver_table[] __devinitdata = {
@@
-48,6
+51,14
@@
static int filtered_get_chars(uint32_t vtermno, char *buf, int count)
unsigned long got;
int i;
unsigned long got;
int i;
+ /*
+ * Vio firmware will read up to SIZE_VIO_GET_CHARS at its own discretion
+ * so we play safe and avoid the situation where got > count which could
+ * overload the flip buffer.
+ */
+ if (count < SIZE_VIO_GET_CHARS)
+ return -EAGAIN;
+
got = hvc_get_chars(vtermno, buf, count);
/*
got = hvc_get_chars(vtermno, buf, count);
/*
@@
-95,11
+106,11
@@
static int __devexit hvc_vio_remove(struct vio_dev *vdev)
}
static struct vio_driver hvc_vio_driver = {
}
static struct vio_driver hvc_vio_driver = {
- .name = hvc_driver_name,
.id_table = hvc_driver_table,
.probe = hvc_vio_probe,
.remove = hvc_vio_remove,
.driver = {
.id_table = hvc_driver_table,
.probe = hvc_vio_probe,
.remove = hvc_vio_remove,
.driver = {
+ .name = hvc_driver_name,
.owner = THIS_MODULE,
}
};
.owner = THIS_MODULE,
}
};