Skip to contentSkip to conversation

Compile error, bug in compat.h with kernel 2.6.27.9 ?

PATCH Nicola Soranzo 2 participants 2 messages Jan 6, 2009 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

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

---

v4l/compat.h +6 -4
diff -urN v4l-dvb-8f3a8d9d0f7c/v4l/compat.h v4l-dvb-new/v4l/compat.h
@@ -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

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

#1 lore raw
Quoted 7 lines · Nicola Soranzo

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

<snip>

Many thanks, can confirm this resolved the issue with 2.6.27.9-159.fc10.x86_64 Fedora kernel.

Quoted 8 lines

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb