Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c7f80993 authored by Brice Goglin's avatar Brice Goglin Committed by Jeff Garzik
Browse files

myri10ge: use ioremap_wc



Switch to ioremap_wc(). We keep the MTRR code since ioremap_wc()
will use UC_MINUS when falling back to uncachable, and thus let
the MTRR WC take precedence.

Also rename the error path better.

Signed-off-by: default avatarBrice Goglin <brice@myri.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent e454e7e2
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -3720,14 +3720,14 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
	if (mgp->sram_size > mgp->board_span) {
	if (mgp->sram_size > mgp->board_span) {
		dev_err(&pdev->dev, "board span %ld bytes too small\n",
		dev_err(&pdev->dev, "board span %ld bytes too small\n",
			mgp->board_span);
			mgp->board_span);
		goto abort_with_wc;
		goto abort_with_mtrr;
	}
	}
	mgp->sram = ioremap(mgp->iomem_base, mgp->board_span);
	mgp->sram = ioremap_wc(mgp->iomem_base, mgp->board_span);
	if (mgp->sram == NULL) {
	if (mgp->sram == NULL) {
		dev_err(&pdev->dev, "ioremap failed for %ld bytes at 0x%lx\n",
		dev_err(&pdev->dev, "ioremap failed for %ld bytes at 0x%lx\n",
			mgp->board_span, mgp->iomem_base);
			mgp->board_span, mgp->iomem_base);
		status = -ENXIO;
		status = -ENXIO;
		goto abort_with_wc;
		goto abort_with_mtrr;
	}
	}
	memcpy_fromio(mgp->eeprom_strings,
	memcpy_fromio(mgp->eeprom_strings,
		      mgp->sram + mgp->sram_size - MYRI10GE_EEPROM_STRINGS_SIZE,
		      mgp->sram + mgp->sram_size - MYRI10GE_EEPROM_STRINGS_SIZE,
@@ -3828,7 +3828,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
abort_with_ioremap:
abort_with_ioremap:
	iounmap(mgp->sram);
	iounmap(mgp->sram);


abort_with_wc:
abort_with_mtrr:
#ifdef CONFIG_MTRR
#ifdef CONFIG_MTRR
	if (mgp->mtrr >= 0)
	if (mgp->mtrr >= 0)
		mtrr_del(mgp->mtrr, mgp->iomem_base, mgp->board_span);
		mtrr_del(mgp->mtrr, mgp->iomem_base, mgp->board_span);