[PATCH] Re: Compile error, bug in compat.h with kernel 2.6.27.9 ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fix compile error about ioremap_nocache with kernel 2.6.27.9 shipped by Fedora 
10.

Signed-off-by: Nicola Soranzo <nsoranzo@xxxxxxxxxx>

---

diff -urN v4l-dvb-8f3a8d9d0f7c/v4l/compat.h v4l-dvb-new/v4l/compat.h
--- v4l-dvb-8f3a8d9d0f7c/v4l/compat.h	2009-01-06 01:33:58.000000000 +0100
+++ v4l-dvb-new/v4l/compat.h	2009-01-05 21:34:05.000000000 +0100
@@ -270,10 +270,6 @@
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28)
 #define snd_BUG_ON(cond)	WARN((cond), "BUG? (%s)\n", __stringify(cond))
-
-#define pci_ioremap_bar(pci, a)				\
-	 ioremap_nocache(pci_resource_start(pci, a),	\
-			 pci_resource_len(pci, a))
 #endif
 
 #ifndef PCI_DEVICE_ID_MARVELL_88ALP01_CCIC
@@ -410,5 +406,11 @@
 #define netdev_priv(dev)	((dev)->priv)
 #endif
 
+#ifdef NEED_PCI_IOREMAP_BAR
+#define pci_ioremap_bar(struct pci_dev *pdev, int bar) \
+	 ioremap_nocache(pci_resource_start(pdev, bar),	\
+			 pci_resource_len(pdev, bar))
+#endif
+
 
 #endif
diff -urN v4l-dvb-8f3a8d9d0f7c/v4l/scripts/make_config_compat.pl v4l-dvb-
new/v4l/scripts/make_config_compat.pl
--- v4l-dvb-8f3a8d9d0f7c/v4l/scripts/make_config_compat.pl	2009-01-06 
01:33:58.000000000 +0100
+++ v4l-dvb-new/v4l/scripts/make_config_compat.pl	2009-01-05 21:24:47.000000000 
+0100
@@ -235,6 +235,25 @@
 	close INNET;
 }
 
+sub check_pci_ioremap_bar()
+{
+	my $file = "$kdir/include/linux/pci.h";
+	my $need_compat = 1;
+
+	open INNET, "<$file" or die "File not found: $file";
+	while (<INNET>) {
+		if (m/pci_ioremap_bar/) {
+			$need_compat = 0;
+			last;
+		}
+	}
+
+	if ($need_compat) {
+		$out.= "\n#define NEED_PCI_IOREMAP_BAR 1\n";
+	}
+	close INNET;
+}
+
 sub check_other_dependencies()
 {
 	check_spin_lock();
@@ -249,6 +268,7 @@
 	check_algo_control();
 	check_net_dev();
 	check_usb_endpoint_type();
+	check_pci_ioremap_bar();
 }
 
 # Do the basic rules

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux