aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/mem.c
diff options
context:
space:
mode:
authorHaren Myneni <haren@us.ibm.com>2012-07-11 15:18:44 +1000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-07-11 18:22:32 +1000
commite1612de9e4cdf375c3cf1c72434ab8abdcb3927e (patch)
treed2bf73a13ea6e92c9c79d4300294584ef82767c2 /drivers/char/mem.c
parentof: Improve prom_update_property() function (diff)
downloadlinux-dev-e1612de9e4cdf375c3cf1c72434ab8abdcb3927e.tar.xz
linux-dev-e1612de9e4cdf375c3cf1c72434ab8abdcb3927e.zip
powerpc: Disable /dev/port interface on systems without an ISA bridge
Some power systems do not have legacy ISA devices. So, /dev/port is not a valid interface on these systems. User level tools such as kbdrate is trying to access the device using this interface which is causing the system crash. This patch will fix this issue by not creating this interface on these powerpc systems. Signed-off-by: Haren Myneni <haren@us.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'drivers/char/mem.c')
-rw-r--r--drivers/char/mem.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 67c3371723cc..e5eedfa24c91 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -27,14 +27,16 @@
#include <linux/splice.h>
#include <linux/pfn.h>
#include <linux/export.h>
+#include <linux/io.h>
#include <asm/uaccess.h>
-#include <asm/io.h>
#ifdef CONFIG_IA64
# include <linux/efi.h>
#endif
+#define DEVPORT_MINOR 4
+
static inline unsigned long size_inside_page(unsigned long start,
unsigned long size)
{
@@ -894,6 +896,13 @@ static int __init chr_dev_init(void)
for (minor = 1; minor < ARRAY_SIZE(devlist); minor++) {
if (!devlist[minor].name)
continue;
+
+ /*
+ * Create /dev/port?
+ */
+ if ((minor == DEVPORT_MINOR) && !arch_has_dev_port())
+ continue;
+
device_create(mem_class, NULL, MKDEV(MEM_MAJOR, minor),
NULL, devlist[minor].name);
}