diff options
author | Bjørn Mork <bjorn@mork.no> | 2011-03-21 10:35:56 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-05-20 06:26:16 -0400 |
commit | abd34d8d6b213c792c1a06fd75488595c5fb6d3f (patch) | |
tree | d5aa6d8081e8bb7ad152153f28e29f472fe4e304 /drivers/media/video | |
parent | ec0c8d555a93aa7e2c5c4f11f12686e5b2245696 (diff) |
[media] use pci_dev->revision
pci_setup_device() has saved the PCI revision in the pci_dev
struct since Linux 2.6.23. Use it.
Cc: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/bt8xx/bttv-driver.c | 2 | ||||
-rw-r--r-- | drivers/media/video/cx18/cx18-driver.c | 2 | ||||
-rw-r--r-- | drivers/media/video/cx23885/cx23885-core.c | 2 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-mpeg.c | 2 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-video.c | 2 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-driver.c | 4 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-core.c | 2 | ||||
-rw-r--r-- | drivers/media/video/saa7164/saa7164-core.c | 2 | ||||
-rw-r--r-- | drivers/media/video/zoran/zoran_card.c | 2 |
9 files changed, 9 insertions, 11 deletions
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index 91399c94cd18..a97cf2750bd9 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c | |||
@@ -4303,7 +4303,7 @@ static int __devinit bttv_probe(struct pci_dev *dev, | |||
4303 | goto fail0; | 4303 | goto fail0; |
4304 | } | 4304 | } |
4305 | 4305 | ||
4306 | pci_read_config_byte(dev, PCI_CLASS_REVISION, &btv->revision); | 4306 | btv->revision = dev->revision; |
4307 | pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat); | 4307 | pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat); |
4308 | printk(KERN_INFO "bttv%d: Bt%d (rev %d) at %s, ", | 4308 | printk(KERN_INFO "bttv%d: Bt%d (rev %d) at %s, ", |
4309 | bttv_num,btv->id, btv->revision, pci_name(dev)); | 4309 | bttv_num,btv->id, btv->revision, pci_name(dev)); |
diff --git a/drivers/media/video/cx18/cx18-driver.c b/drivers/media/video/cx18/cx18-driver.c index 321c1b79794c..841ea4ef6200 100644 --- a/drivers/media/video/cx18/cx18-driver.c +++ b/drivers/media/video/cx18/cx18-driver.c | |||
@@ -818,7 +818,7 @@ static int cx18_setup_pci(struct cx18 *cx, struct pci_dev *pci_dev, | |||
818 | cmd |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER; | 818 | cmd |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER; |
819 | pci_write_config_word(pci_dev, PCI_COMMAND, cmd); | 819 | pci_write_config_word(pci_dev, PCI_COMMAND, cmd); |
820 | 820 | ||
821 | pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &cx->card_rev); | 821 | cx->card_rev = pci_dev->revision; |
822 | pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &pci_latency); | 822 | pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &pci_latency); |
823 | 823 | ||
824 | if (pci_latency < 64 && cx18_pci_latency) { | 824 | if (pci_latency < 64 && cx18_pci_latency) { |
diff --git a/drivers/media/video/cx23885/cx23885-core.c b/drivers/media/video/cx23885/cx23885-core.c index 9933810b4e33..64d9b2136ff6 100644 --- a/drivers/media/video/cx23885/cx23885-core.c +++ b/drivers/media/video/cx23885/cx23885-core.c | |||
@@ -2045,7 +2045,7 @@ static int __devinit cx23885_initdev(struct pci_dev *pci_dev, | |||
2045 | } | 2045 | } |
2046 | 2046 | ||
2047 | /* print pci info */ | 2047 | /* print pci info */ |
2048 | pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &dev->pci_rev); | 2048 | dev->pci_rev = pci_dev->revision; |
2049 | pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat); | 2049 | pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat); |
2050 | printk(KERN_INFO "%s/0: found at %s, rev: %d, irq: %d, " | 2050 | printk(KERN_INFO "%s/0: found at %s, rev: %d, irq: %d, " |
2051 | "latency: %d, mmio: 0x%llx\n", dev->name, | 2051 | "latency: %d, mmio: 0x%llx\n", dev->name, |
diff --git a/drivers/media/video/cx88/cx88-mpeg.c b/drivers/media/video/cx88/cx88-mpeg.c index addf9545e9bf..9b500e691a5c 100644 --- a/drivers/media/video/cx88/cx88-mpeg.c +++ b/drivers/media/video/cx88/cx88-mpeg.c | |||
@@ -474,7 +474,7 @@ static int cx8802_init_common(struct cx8802_dev *dev) | |||
474 | return -EIO; | 474 | return -EIO; |
475 | } | 475 | } |
476 | 476 | ||
477 | pci_read_config_byte(dev->pci, PCI_CLASS_REVISION, &dev->pci_rev); | 477 | dev->pci_rev = dev->pci->revision; |
478 | pci_read_config_byte(dev->pci, PCI_LATENCY_TIMER, &dev->pci_lat); | 478 | pci_read_config_byte(dev->pci, PCI_LATENCY_TIMER, &dev->pci_lat); |
479 | printk(KERN_INFO "%s/2: found at %s, rev: %d, irq: %d, " | 479 | printk(KERN_INFO "%s/2: found at %s, rev: %d, irq: %d, " |
480 | "latency: %d, mmio: 0x%llx\n", dev->core->name, | 480 | "latency: %d, mmio: 0x%llx\n", dev->core->name, |
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 287a41ee1c4f..b1f734dccea0 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c | |||
@@ -1832,7 +1832,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev, | |||
1832 | dev->core = core; | 1832 | dev->core = core; |
1833 | 1833 | ||
1834 | /* print pci info */ | 1834 | /* print pci info */ |
1835 | pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &dev->pci_rev); | 1835 | dev->pci_rev = pci_dev->revision; |
1836 | pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat); | 1836 | pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat); |
1837 | printk(KERN_INFO "%s/0: found at %s, rev: %d, irq: %d, " | 1837 | printk(KERN_INFO "%s/0: found at %s, rev: %d, irq: %d, " |
1838 | "latency: %d, mmio: 0x%llx\n", core->name, | 1838 | "latency: %d, mmio: 0x%llx\n", core->name, |
diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c index 39946420b301..a4e4dfdbc2f2 100644 --- a/drivers/media/video/ivtv/ivtv-driver.c +++ b/drivers/media/video/ivtv/ivtv-driver.c | |||
@@ -810,7 +810,6 @@ static int ivtv_setup_pci(struct ivtv *itv, struct pci_dev *pdev, | |||
810 | const struct pci_device_id *pci_id) | 810 | const struct pci_device_id *pci_id) |
811 | { | 811 | { |
812 | u16 cmd; | 812 | u16 cmd; |
813 | u8 card_rev; | ||
814 | unsigned char pci_latency; | 813 | unsigned char pci_latency; |
815 | 814 | ||
816 | IVTV_DEBUG_INFO("Enabling pci device\n"); | 815 | IVTV_DEBUG_INFO("Enabling pci device\n"); |
@@ -857,7 +856,6 @@ static int ivtv_setup_pci(struct ivtv *itv, struct pci_dev *pdev, | |||
857 | } | 856 | } |
858 | IVTV_DEBUG_INFO("Bus Mastering Enabled.\n"); | 857 | IVTV_DEBUG_INFO("Bus Mastering Enabled.\n"); |
859 | 858 | ||
860 | pci_read_config_byte(pdev, PCI_CLASS_REVISION, &card_rev); | ||
861 | pci_read_config_byte(pdev, PCI_LATENCY_TIMER, &pci_latency); | 859 | pci_read_config_byte(pdev, PCI_LATENCY_TIMER, &pci_latency); |
862 | 860 | ||
863 | if (pci_latency < 64 && ivtv_pci_latency) { | 861 | if (pci_latency < 64 && ivtv_pci_latency) { |
@@ -874,7 +872,7 @@ static int ivtv_setup_pci(struct ivtv *itv, struct pci_dev *pdev, | |||
874 | 872 | ||
875 | IVTV_DEBUG_INFO("%d (rev %d) at %02x:%02x.%x, " | 873 | IVTV_DEBUG_INFO("%d (rev %d) at %02x:%02x.%x, " |
876 | "irq: %d, latency: %d, memory: 0x%lx\n", | 874 | "irq: %d, latency: %d, memory: 0x%lx\n", |
877 | pdev->device, card_rev, pdev->bus->number, | 875 | pdev->device, pdev->revision, pdev->bus->number, |
878 | PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn), | 876 | PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn), |
879 | pdev->irq, pci_latency, (unsigned long)itv->base_addr); | 877 | pdev->irq, pci_latency, (unsigned long)itv->base_addr); |
880 | 878 | ||
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c index 41f836fc93ec..f9be737ba6f4 100644 --- a/drivers/media/video/saa7134/saa7134-core.c +++ b/drivers/media/video/saa7134/saa7134-core.c | |||
@@ -927,7 +927,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, | |||
927 | } | 927 | } |
928 | 928 | ||
929 | /* print pci info */ | 929 | /* print pci info */ |
930 | pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &dev->pci_rev); | 930 | dev->pci_rev = pci_dev->revision; |
931 | pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat); | 931 | pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat); |
932 | printk(KERN_INFO "%s: found at %s, rev: %d, irq: %d, " | 932 | printk(KERN_INFO "%s: found at %s, rev: %d, irq: %d, " |
933 | "latency: %d, mmio: 0x%llx\n", dev->name, | 933 | "latency: %d, mmio: 0x%llx\n", dev->name, |
diff --git a/drivers/media/video/saa7164/saa7164-core.c b/drivers/media/video/saa7164/saa7164-core.c index b813aec1e456..3b7d7b4e3034 100644 --- a/drivers/media/video/saa7164/saa7164-core.c +++ b/drivers/media/video/saa7164/saa7164-core.c | |||
@@ -1247,7 +1247,7 @@ static int __devinit saa7164_initdev(struct pci_dev *pci_dev, | |||
1247 | } | 1247 | } |
1248 | 1248 | ||
1249 | /* print pci info */ | 1249 | /* print pci info */ |
1250 | pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &dev->pci_rev); | 1250 | dev->pci_rev = pci_dev->revision; |
1251 | pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat); | 1251 | pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat); |
1252 | printk(KERN_INFO "%s/0: found at %s, rev: %d, irq: %d, " | 1252 | printk(KERN_INFO "%s/0: found at %s, rev: %d, irq: %d, " |
1253 | "latency: %d, mmio: 0x%llx\n", dev->name, | 1253 | "latency: %d, mmio: 0x%llx\n", dev->name, |
diff --git a/drivers/media/video/zoran/zoran_card.c b/drivers/media/video/zoran/zoran_card.c index 9f2bac519647..ba6878b2d663 100644 --- a/drivers/media/video/zoran/zoran_card.c +++ b/drivers/media/video/zoran/zoran_card.c | |||
@@ -1230,7 +1230,7 @@ static int __devinit zoran_probe(struct pci_dev *pdev, | |||
1230 | mutex_init(&zr->other_lock); | 1230 | mutex_init(&zr->other_lock); |
1231 | if (pci_enable_device(pdev)) | 1231 | if (pci_enable_device(pdev)) |
1232 | goto zr_unreg; | 1232 | goto zr_unreg; |
1233 | pci_read_config_byte(zr->pci_dev, PCI_CLASS_REVISION, &zr->revision); | 1233 | zr->revision = zr->pci_dev->revision; |
1234 | 1234 | ||
1235 | dprintk(1, | 1235 | dprintk(1, |
1236 | KERN_INFO | 1236 | KERN_INFO |