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

mmc: omap_hsmmc: Use devm_mmc_alloc_host() helper

parent 98d21565
Loading
Loading
Loading
Loading
+5 −12
Original line number Diff line number Diff line
@@ -1798,15 +1798,13 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
	if (IS_ERR(base))
		return PTR_ERR(base);

	mmc = mmc_alloc_host(sizeof(struct omap_hsmmc_host), &pdev->dev);
	if (!mmc) {
		ret = -ENOMEM;
		goto err;
	}
	mmc = devm_mmc_alloc_host(&pdev->dev, sizeof(*host));
	if (!mmc)
		return -ENOMEM;

	ret = mmc_of_parse(mmc);
	if (ret)
		goto err1;
		return ret;

	host		= mmc_priv(mmc);
	host->mmc	= mmc;
@@ -1842,7 +1840,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
	if (IS_ERR(host->fclk)) {
		ret = PTR_ERR(host->fclk);
		host->fclk = NULL;
		goto err1;
		return ret;
	}

	if (host->pdata->controller_flags & OMAP_HSMMC_BROKEN_MULTIBLOCK_READ) {
@@ -1973,9 +1971,6 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
	pm_runtime_put_sync(host->dev);
	pm_runtime_disable(host->dev);
	clk_disable_unprepare(host->dbclk);
err1:
	mmc_free_host(mmc);
err:
	return ret;
}

@@ -1995,8 +1990,6 @@ static void omap_hsmmc_remove(struct platform_device *pdev)
	pm_runtime_disable(host->dev);
	device_init_wakeup(&pdev->dev, false);
	clk_disable_unprepare(host->dbclk);

	mmc_free_host(host->mmc);
}

#ifdef CONFIG_PM_SLEEP