Commit 93f0d3ec authored by Binbin Zhou's avatar Binbin Zhou Committed by Ulf Hansson
Browse files

mmc: via-sdmmc: Use devm_mmc_alloc_host() helper

parent 155391da
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -1100,7 +1100,7 @@ static int via_sd_probe(struct pci_dev *pcidev,
	pci_write_config_byte(pcidev, VIA_CRDR_PCI_WORK_MODE, 0);
	pci_write_config_byte(pcidev, VIA_CRDR_PCI_DBG_MODE, 0);

	mmc = mmc_alloc_host(sizeof(struct via_crdr_mmc_host), &pcidev->dev);
	mmc = devm_mmc_alloc_host(&pcidev->dev, sizeof(*sdhost));
	if (!mmc) {
		ret = -ENOMEM;
		goto release;
@@ -1115,7 +1115,7 @@ static int via_sd_probe(struct pci_dev *pcidev,
	sdhost->mmiobase = ioremap(base, len);
	if (!sdhost->mmiobase) {
		ret = -ENOMEM;
		goto free_mmc_host;
		goto release;
	}

	sdhost->sdhc_mmiobase =
@@ -1160,8 +1160,6 @@ static int via_sd_probe(struct pci_dev *pcidev,

unmap:
	iounmap(sdhost->mmiobase);
free_mmc_host:
	mmc_free_host(mmc);
release:
	pci_release_regions(pcidev);
disable:
@@ -1212,7 +1210,6 @@ static void via_sd_remove(struct pci_dev *pcidev)
	writeb(gatt, sdhost->pcictrl_mmiobase + VIA_CRDR_PCICLKGATT);

	iounmap(sdhost->mmiobase);
	mmc_free_host(sdhost->mmc);
	pci_release_regions(pcidev);
	pci_disable_device(pcidev);