diff options
-rw-r--r-- | linux/drivers/media/radio/radio-gemtek-pci.c | 8 | ||||
-rw-r--r-- | linux/drivers/media/video/meye.c | 4 | ||||
-rw-r--r-- | v4l/compat.h | 11 |
3 files changed, 15 insertions, 8 deletions
diff --git a/linux/drivers/media/radio/radio-gemtek-pci.c b/linux/drivers/media/radio/radio-gemtek-pci.c index 02242f1b3..dd050d4f1 100644 --- a/linux/drivers/media/radio/radio-gemtek-pci.c +++ b/linux/drivers/media/radio/radio-gemtek-pci.c @@ -95,7 +95,6 @@ struct gemtek_pci_card { u32 iobase; u32 length; - u16 model; u32 current_frequency; u8 mute; @@ -414,8 +413,6 @@ static int __devinit gemtek_pci_probe( struct pci_dev *pci_dev, const struct pci goto err_pci; } - pci_read_config_word( pci_dev, PCI_SUBSYSTEM_ID, &card->model ); - pci_set_drvdata( pci_dev, card ); if ( (devradio = kmalloc( sizeof( struct video_device ), GFP_KERNEL )) == NULL ) { @@ -437,8 +434,9 @@ static int __devinit gemtek_pci_probe( struct pci_dev *pci_dev, const struct pci printk( KERN_INFO "Gemtek PCI Radio (rev. %d) found at 0x%04x-0x%04x.\n", pci_dev->revision, card->iobase, card->iobase + card->length - 1 ); #else - printk( KERN_INFO "Gemtek PCI Radio found at 0x%04x-0x%04x.\n", - card->iobase, card->iobase + card->length - 1 ); + printk( KERN_INFO "Gemtek PCI Radio (rev. %d) found at 0x%04x-0x%04x.\n", + v4l_compat_pci_rev(pci_dev), card->iobase, + card->iobase + card->length - 1 ); #endif return 0; diff --git a/linux/drivers/media/video/meye.c b/linux/drivers/media/video/meye.c index be29d0483..035000a14 100644 --- a/linux/drivers/media/video/meye.c +++ b/linux/drivers/media/video/meye.c @@ -1945,8 +1945,8 @@ static int __devinit meye_probe(struct pci_dev *pcidev, printk(KERN_INFO "meye: mchip KL5A72002 rev. %d, base %lx, irq %d\n", meye.mchip_dev->revision, mchip_adr, meye.mchip_irq); #else - printk(KERN_INFO "meye: mchip KL5A72002, base %lx, irq %d\n", - mchip_adr, meye.mchip_irq); + printk(KERN_INFO "meye: mchip KL5A72002 rev. %d, base %lx, irq %d\n", + v4l_compat_pci_rev(meye.mchip_dev), mchip_adr, meye.mchip_irq); #endif return 0; diff --git a/v4l/compat.h b/v4l/compat.h index ed6605687..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 @@ -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: |