From aaed3ca66f31e9c0f6b12ba9c2666dc2eeb62c04 Mon Sep 17 00:00:00 2001
From: Ian Abbott <abbotti@mev.co.uk>
Date: Mon, 2 Apr 2012 17:13:35 +0100
Subject: [PATCH] Replace <asm/system.h> with <asm/barrier.h>

Added a compatibility header for <asm/barrier.h> which is being added in
kernel version 3.4, along with the removal of <asm/system.h>.

Changed C files that previously included <asm/system.h> to include
<asm/barrier.h> instead.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 comedi/drivers.c             |  2 +-
 comedi/drivers/cb_pcidas64.c |  2 +-
 comedi/drivers/mite.c        |  2 +-
 include/asm/barrier.h        | 16 ++++++++++++++++
 4 files changed, 19 insertions(+), 3 deletions(-)
 create mode 100644 include/asm/barrier.h

diff --git a/comedi/drivers.c b/comedi/drivers.c
index 4eed3671..27c34fe7 100644
--- a/comedi/drivers.c
+++ b/comedi/drivers.c
@@ -44,7 +44,7 @@
 #include <linux/dma-mapping.h>
 
 #include <asm/io.h>
-#include <asm/system.h>
+#include <asm/barrier.h>
 
 #include "comedi_fops.h"
 
diff --git a/comedi/drivers/cb_pcidas64.c b/comedi/drivers/cb_pcidas64.c
index 3cb2e4b3..2cf2ac6f 100644
--- a/comedi/drivers/cb_pcidas64.c
+++ b/comedi/drivers/cb_pcidas64.c
@@ -85,7 +85,7 @@ TODO:
 
 #include <linux/comedidev.h>
 #include <linux/delay.h>
-#include <asm/system.h>
+#include <asm/barrier.h>
 
 #include "comedi_pci.h"
 #include "8253.h"
diff --git a/comedi/drivers/mite.c b/comedi/drivers/mite.c
index 962b364a..d1772e72 100644
--- a/comedi/drivers/mite.c
+++ b/comedi/drivers/mite.c
@@ -55,7 +55,7 @@
 #include "comedi_pci.h"
 #include <linux/comedidev.h>
 
-#include <asm/system.h>
+#include <asm/barrier.h>
 
 #define PCI_MITE_SIZE		4096
 #define PCI_DAQ_SIZE		4096
diff --git a/include/asm/barrier.h b/include/asm/barrier.h
new file mode 100644
index 00000000..d91fd54b
--- /dev/null
+++ b/include/asm/barrier.h
@@ -0,0 +1,16 @@
+/*
+ * asm/barrier.h compatibility header
+ */
+
+#ifndef __COMPAT_ASM_BARRIER_H_
+#define __COMPAT_ASM_BARRIER_H_
+
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)
+#include <asm/system.h>
+#else
+#include_next <asm/barrier.h>
+#endif
+
+#endif /* __COMPAT_ASM_BARRIER_H_ */
-- 
2.26.2