[Prism54-devel] patch: prismcompat auto

Bruno Randolf bruno.randolf@4g-systems.biz
Sat, 3 Apr 2004 10:16:38 +0200


--Boundary-00=_mLnbA4a9Q8bIQws
Content-Type: Text/Plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hello!

the attached patch automatically selects the right prismcompatXX.h depending
on the kernel version. please consider adding it to your cvs.

thanks,
bruno


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAbnLrfg2jtUL97G4RAj4FAJsHEWNGrOZaR+X0vU5QUgfLvW3qHwCggqK8
ve2HhpRmfiO8bNe1eoZTq0E=
=NrrT
-----END PGP SIGNATURE-----

--Boundary-00=_mLnbA4a9Q8bIQws
Content-Type: text/x-diff;
  charset="us-ascii";
  name="prismcompat_auto.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="prismcompat_auto.diff"

diff -Nurb --exclude=CVS /data/mtx/prism54/prism54-cvs-latest/ksrc/prismcompat.h ./ksrc/prismcompat.h
--- /data/mtx/prism54/prism54-cvs-latest/ksrc/prismcompat.h	2004-03-20 19:23:28.000000000 +0100
+++ ./ksrc/prismcompat.h	2004-04-01 11:30:56.905815696 +0200
@@ -1,47 +1,6 @@
-/*  
- *  (C) 2004 Margit Schubert-While <margitsw@t-online.de>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- */
-
-/*  
- *	Compatibility header file to aid support of different kernel versions
- */
-
-#ifndef _PRISM_COMPAT_H
-#define _PRISM_COMPAT_H
-
-#include <linux/device.h>
-#include <linux/firmware.h>
-#include <linux/config.h>
-#include <linux/moduleparam.h>
-#include <linux/workqueue.h>
-
-#if !defined(CONFIG_FW_LOADER) && !defined(CONFIG_FW_LOADER_MODULE)
-#error Firmware Loading is not configured in the kernel !
+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+#include "prismcompat24.h"
+#else
+#include "prismcompat26.h"
 #endif
-
-#define prism54_synchronize_irq(irq) synchronize_irq(irq)
-
-#define PRISM_DEFWAITQ(x, y)	DEFINE_WAIT(y); \
-	prepare_to_wait(&(x), &(y), TASK_UNINTERRUPTIBLE)
-
-#define PRISM_ENDWAITQ(x, y)	finish_wait(&(x), &(y))
-
-#define _REQ_FW_DEV_T		struct device *
-
-#define PRISM_FW_PDEV		&priv->pdev->dev
-
-#endif				/* _PRISM_COMPAT_H */
diff -Nurb --exclude=CVS /data/mtx/prism54/prism54-cvs-latest/ksrc/prismcompat26.h ./ksrc/prismcompat26.h
--- /data/mtx/prism54/prism54-cvs-latest/ksrc/prismcompat26.h	1970-01-01 01:00:00.000000000 +0100
+++ ./ksrc/prismcompat26.h	2004-04-01 11:19:41.005568152 +0200
@@ -0,0 +1,47 @@
+/*  
+ *  (C) 2004 Margit Schubert-While <margitsw@t-online.de>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+/*  
+ *	Compatibility header file to aid support of different kernel versions
+ */
+
+#ifndef _PRISM_COMPAT_H
+#define _PRISM_COMPAT_H
+
+#include <linux/device.h>
+#include <linux/firmware.h>
+#include <linux/config.h>
+#include <linux/moduleparam.h>
+#include <linux/workqueue.h>
+
+#if !defined(CONFIG_FW_LOADER) && !defined(CONFIG_FW_LOADER_MODULE)
+#error Firmware Loading is not configured in the kernel !
+#endif
+
+#define prism54_synchronize_irq(irq) synchronize_irq(irq)
+
+#define PRISM_DEFWAITQ(x, y)	DEFINE_WAIT(y); \
+	prepare_to_wait(&(x), &(y), TASK_UNINTERRUPTIBLE)
+
+#define PRISM_ENDWAITQ(x, y)	finish_wait(&(x), &(y))
+
+#define _REQ_FW_DEV_T		struct device *
+
+#define PRISM_FW_PDEV		&priv->pdev->dev
+
+#endif				/* _PRISM_COMPAT_H */

--Boundary-00=_mLnbA4a9Q8bIQws--