diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2009-01-12 11:09:46 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-01-29 05:35:38 -0500 |
commit | 5e098b668977c85838af09005bd96c2e987654f0 (patch) | |
tree | 700a5f8a65536e8cd84290d710b5c497744102e1 /drivers/media | |
parent | 17faeb20912af5d2a1422fdb606e785f9b1d88ba (diff) |
V4L/DVB (10225): zoran: Remove zr36057_adr field
The driver should only use the kernel mapped io address, zr36057_mem, and
not the PCI bus address, zr36057_adr. Since the latter is only printed out
once, there is no need to save it in the driver data structure.
There was some old code that looked like it was for the Alpha architecture
which would use the PCI bus address. It probably no longer applies to
modern kernels.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/zoran/zoran.h | 11 | ||||
-rw-r--r-- | drivers/media/video/zoran/zoran_card.c | 11 |
2 files changed, 7 insertions, 15 deletions
diff --git a/drivers/media/video/zoran/zoran.h b/drivers/media/video/zoran/zoran.h index 7273abf5eb46..e873a916250f 100644 --- a/drivers/media/video/zoran/zoran.h +++ b/drivers/media/video/zoran/zoran.h | |||
@@ -400,7 +400,6 @@ struct zoran { | |||
400 | char name[32]; /* name of this device */ | 400 | char name[32]; /* name of this device */ |
401 | struct pci_dev *pci_dev; /* PCI device */ | 401 | struct pci_dev *pci_dev; /* PCI device */ |
402 | unsigned char revision; /* revision of zr36057 */ | 402 | unsigned char revision; /* revision of zr36057 */ |
403 | unsigned int zr36057_adr; /* bus address of IO mem returned by PCI BIOS */ | ||
404 | unsigned char __iomem *zr36057_mem;/* pointer to mapped IO memory */ | 403 | unsigned char __iomem *zr36057_mem;/* pointer to mapped IO memory */ |
405 | 404 | ||
406 | spinlock_t spinlock; /* Spinlock */ | 405 | spinlock_t spinlock; /* Spinlock */ |
@@ -489,16 +488,10 @@ struct zoran { | |||
489 | wait_queue_head_t test_q; | 488 | wait_queue_head_t test_q; |
490 | }; | 489 | }; |
491 | 490 | ||
492 | /*The following should be done in more portable way. It depends on define | 491 | /* There was something called _ALPHA_BUZ that used the PCI address instead of |
493 | of _ALPHA_BUZ in the Makefile.*/ | 492 | * the kernel iomapped address for btread/btwrite. */ |
494 | |||
495 | #ifdef _ALPHA_BUZ | ||
496 | #define btwrite(dat,adr) writel((dat), zr->zr36057_adr+(adr)) | ||
497 | #define btread(adr) readl(zr->zr36057_adr+(adr)) | ||
498 | #else | ||
499 | #define btwrite(dat,adr) writel((dat), zr->zr36057_mem+(adr)) | 493 | #define btwrite(dat,adr) writel((dat), zr->zr36057_mem+(adr)) |
500 | #define btread(adr) readl(zr->zr36057_mem+(adr)) | 494 | #define btread(adr) readl(zr->zr36057_mem+(adr)) |
501 | #endif | ||
502 | 495 | ||
503 | #define btand(dat,adr) btwrite((dat) & btread(adr), adr) | 496 | #define btand(dat,adr) btwrite((dat) & btread(adr), adr) |
504 | #define btor(dat,adr) btwrite((dat) | btread(adr), adr) | 497 | #define btor(dat,adr) btwrite((dat) | btread(adr), adr) |
diff --git a/drivers/media/video/zoran/zoran_card.c b/drivers/media/video/zoran/zoran_card.c index 7b73d83e1273..5d2f090aa0f8 100644 --- a/drivers/media/video/zoran/zoran_card.c +++ b/drivers/media/video/zoran/zoran_card.c | |||
@@ -1297,14 +1297,13 @@ static int __devinit zoran_probe(struct pci_dev *pdev, | |||
1297 | mutex_init(&zr->resource_lock); | 1297 | mutex_init(&zr->resource_lock); |
1298 | if (pci_enable_device(pdev)) | 1298 | if (pci_enable_device(pdev)) |
1299 | goto zr_free_mem; | 1299 | goto zr_free_mem; |
1300 | zr->zr36057_adr = pci_resource_start(zr->pci_dev, 0); | ||
1301 | pci_read_config_byte(zr->pci_dev, PCI_CLASS_REVISION, &zr->revision); | 1300 | pci_read_config_byte(zr->pci_dev, PCI_CLASS_REVISION, &zr->revision); |
1302 | 1301 | ||
1303 | dprintk(1, | 1302 | dprintk(1, |
1304 | KERN_INFO | 1303 | KERN_INFO |
1305 | "%s: Zoran ZR360%c7 (rev %d), irq: %d, memory: 0x%08x\n", | 1304 | "%s: Zoran ZR360%c7 (rev %d), irq: %d, memory: 0x%08llx\n", |
1306 | ZR_DEVNAME(zr), zr->revision < 2 ? '5' : '6', zr->revision, | 1305 | ZR_DEVNAME(zr), zr->revision < 2 ? '5' : '6', zr->revision, |
1307 | zr->pci_dev->irq, zr->zr36057_adr); | 1306 | zr->pci_dev->irq, (uint64_t)pci_resource_start(zr->pci_dev, 0)); |
1308 | if (zr->revision >= 2) { | 1307 | if (zr->revision >= 2) { |
1309 | dprintk(1, | 1308 | dprintk(1, |
1310 | KERN_INFO | 1309 | KERN_INFO |
@@ -1359,12 +1358,12 @@ static int __devinit zoran_probe(struct pci_dev *pdev, | |||
1359 | snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)), | 1358 | snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)), |
1360 | "%s[%u]", zr->card.name, zr->id); | 1359 | "%s[%u]", zr->card.name, zr->id); |
1361 | 1360 | ||
1362 | zr->zr36057_mem = ioremap_nocache(zr->zr36057_adr, 0x1000); | 1361 | zr->zr36057_mem = pci_ioremap_bar(zr->pci_dev, 0); |
1363 | if (!zr->zr36057_mem) { | 1362 | if (!zr->zr36057_mem) { |
1364 | dprintk(1, | 1363 | dprintk(1, |
1365 | KERN_ERR | 1364 | KERN_ERR |
1366 | "%s: find_zr36057() - ioremap failed\n", | 1365 | "%s: %s() - ioremap failed\n", |
1367 | ZR_DEVNAME(zr)); | 1366 | ZR_DEVNAME(zr), __func__); |
1368 | goto zr_free_mem; | 1367 | goto zr_free_mem; |
1369 | } | 1368 | } |
1370 | 1369 | ||