From 8a55acadcb3c75ee7a84683f612607957468a132 Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Fri, 20 Jul 2007 00:42:46 -0700 Subject: compat: keep printing pci revision on older kernels From: Trent Piepho In 2.6.23, there is a new struct pci_dev->revision field to get the pci revision. A couple drivers now use this to print the revision and on old kernels don't print it anymore. This patch adds a simple function to get the revision to compat.h to make it easy for the backward compay code to keep printing the revision like is used too. Signed-off-by: Trent Piepho --- v4l/compat.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'v4l') diff --git a/v4l/compat.h b/v4l/compat.h index ed6605687..b788e7be2 100644 --- a/v4l/compat.h +++ b/v4l/compat.h @@ -389,6 +389,15 @@ typedef int bool; #define pci_match_device(drv, dev) pci_match_device((drv)->id_table, dev) #endif +/* pci_dev got a new revision field in 2.6.23-rc1 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23) && defined(LINUX_PCI_H) +/* Just make it easier to subsitute pci_dev->revision with + * v4l_compat_pci_rev(pci_dev). It's too bad there isn't some kind of context + * sensitive macro in C that could do this for us. */ +static inline u8 v4l_compat_pci_rev(struct pci_dev *pci) +{ u8 rev; pci_read_config_byte(pci, PCI_REVISION_ID, &rev); return rev; } +#endif + #endif /* * Local variables: -- cgit v1.2.3 From d4d6f90d82150e74c1d11b906aa3a9c2239ee660 Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Fri, 20 Jul 2007 00:45:59 -0700 Subject: compat: set_freezable() version check off by 1 From: Trent Piepho The function wasn't added until after 2.6.22. Signed-off-by: Trent Piepho --- v4l/compat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'v4l') diff --git a/v4l/compat.h b/v4l/compat.h index b788e7be2..584d96035 100644 --- a/v4l/compat.h +++ b/v4l/compat.h @@ -5,7 +5,7 @@ #ifndef _COMPAT_H #define _COMPAT_H -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23) # define set_freezable() #endif -- cgit v1.2.3