瀏覽代碼

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>
Trent Piepho 16 年之前
父節點
當前提交
5e098b6689
共有 2 個文件被更改,包括 7 次插入15 次删除
  1. 2 9
      drivers/media/video/zoran/zoran.h
  2. 5 6
      drivers/media/video/zoran/zoran_card.c

+ 2 - 9
drivers/media/video/zoran/zoran.h

@@ -400,7 +400,6 @@ struct zoran {
 	char name[32];		/* name of this device */
 	char name[32];		/* name of this device */
 	struct pci_dev *pci_dev;	/* PCI device */
 	struct pci_dev *pci_dev;	/* PCI device */
 	unsigned char revision;	/* revision of zr36057 */
 	unsigned char revision;	/* revision of zr36057 */
-	unsigned int zr36057_adr;	/* bus address of IO mem returned by PCI BIOS */
 	unsigned char __iomem *zr36057_mem;/* pointer to mapped IO memory */
 	unsigned char __iomem *zr36057_mem;/* pointer to mapped IO memory */
 
 
 	spinlock_t spinlock;	/* Spinlock */
 	spinlock_t spinlock;	/* Spinlock */
@@ -489,16 +488,10 @@ struct zoran {
 	wait_queue_head_t test_q;
 	wait_queue_head_t test_q;
 };
 };
 
 
-/*The following should be done in more portable way. It depends on define
-  of _ALPHA_BUZ in the Makefile.*/
-
-#ifdef _ALPHA_BUZ
-#define btwrite(dat,adr)    writel((dat), zr->zr36057_adr+(adr))
-#define btread(adr)         readl(zr->zr36057_adr+(adr))
-#else
+/* There was something called _ALPHA_BUZ that used the PCI address instead of
+ * the kernel iomapped address for btread/btwrite.  */
 #define btwrite(dat,adr)    writel((dat), zr->zr36057_mem+(adr))
 #define btwrite(dat,adr)    writel((dat), zr->zr36057_mem+(adr))
 #define btread(adr)         readl(zr->zr36057_mem+(adr))
 #define btread(adr)         readl(zr->zr36057_mem+(adr))
-#endif
 
 
 #define btand(dat,adr)      btwrite((dat) & btread(adr), adr)
 #define btand(dat,adr)      btwrite((dat) & btread(adr), adr)
 #define btor(dat,adr)       btwrite((dat) | btread(adr), adr)
 #define btor(dat,adr)       btwrite((dat) | btread(adr), adr)

+ 5 - 6
drivers/media/video/zoran/zoran_card.c

@@ -1297,14 +1297,13 @@ static int __devinit zoran_probe(struct pci_dev *pdev,
 	mutex_init(&zr->resource_lock);
 	mutex_init(&zr->resource_lock);
 	if (pci_enable_device(pdev))
 	if (pci_enable_device(pdev))
 		goto zr_free_mem;
 		goto zr_free_mem;
-	zr->zr36057_adr = pci_resource_start(zr->pci_dev, 0);
 	pci_read_config_byte(zr->pci_dev, PCI_CLASS_REVISION, &zr->revision);
 	pci_read_config_byte(zr->pci_dev, PCI_CLASS_REVISION, &zr->revision);
 
 
 	dprintk(1,
 	dprintk(1,
 		KERN_INFO
 		KERN_INFO
-		"%s: Zoran ZR360%c7 (rev %d), irq: %d, memory: 0x%08x\n",
+		"%s: Zoran ZR360%c7 (rev %d), irq: %d, memory: 0x%08llx\n",
 		ZR_DEVNAME(zr), zr->revision < 2 ? '5' : '6', zr->revision,
 		ZR_DEVNAME(zr), zr->revision < 2 ? '5' : '6', zr->revision,
-		zr->pci_dev->irq, zr->zr36057_adr);
+		zr->pci_dev->irq, (uint64_t)pci_resource_start(zr->pci_dev, 0));
 	if (zr->revision >= 2) {
 	if (zr->revision >= 2) {
 		dprintk(1,
 		dprintk(1,
 			KERN_INFO
 			KERN_INFO
@@ -1359,12 +1358,12 @@ static int __devinit zoran_probe(struct pci_dev *pdev,
 	snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)),
 	snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)),
 		 "%s[%u]", zr->card.name, zr->id);
 		 "%s[%u]", zr->card.name, zr->id);
 
 
-	zr->zr36057_mem = ioremap_nocache(zr->zr36057_adr, 0x1000);
+	zr->zr36057_mem = pci_ioremap_bar(zr->pci_dev, 0);
 	if (!zr->zr36057_mem) {
 	if (!zr->zr36057_mem) {
 		dprintk(1,
 		dprintk(1,
 			KERN_ERR
 			KERN_ERR
-			"%s: find_zr36057() - ioremap failed\n",
-			ZR_DEVNAME(zr));
+			"%s: %s() - ioremap failed\n",
+			ZR_DEVNAME(zr), __func__);
 		goto zr_free_mem;
 		goto zr_free_mem;
 	}
 	}