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

Commit 927ce944 authored by Felipe Balbi's avatar Felipe Balbi Committed by Chris Ball
Browse files

mmc: omap_hsmmc: trivial cleanups



A bunch of non-functional cleanups to the omap_hsmmc driver.

It basically decreases indentation level, drop unneded dereferences
and drop unneded accesses to the platform_device structure.

Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarVenkatraman S <svenkatr@ti.com>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 92a3aebf
Loading
Loading
Loading
Loading
+70 −77
Original line number Diff line number Diff line
@@ -2041,7 +2041,6 @@ static int omap_hsmmc_remove(struct platform_device *pdev)
	struct omap_hsmmc_host *host = platform_get_drvdata(pdev);
	struct resource *res;

	if (host) {
	pm_runtime_get_sync(host->dev);
	mmc_remove_host(host->mmc);
	if (host->use_reg)
@@ -2063,7 +2062,6 @@ static int omap_hsmmc_remove(struct platform_device *pdev)
	mmc_free_host(host->mmc);
	iounmap(host->base);
	omap_hsmmc_gpio_free(pdev->dev.platform_data);
	}

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	if (res)
@@ -2077,21 +2075,20 @@ static int omap_hsmmc_remove(struct platform_device *pdev)
static int omap_hsmmc_suspend(struct device *dev)
{
	int ret = 0;
	struct platform_device *pdev = to_platform_device(dev);
	struct omap_hsmmc_host *host = platform_get_drvdata(pdev);
	struct omap_hsmmc_host *host = dev_get_drvdata(dev);

	if (!host)
		return 0;

	if (host && host->suspended)
		return 0;

	if (host) {
	pm_runtime_get_sync(host->dev);
	host->suspended = 1;
	if (host->pdata->suspend) {
			ret = host->pdata->suspend(&pdev->dev,
							host->slot_id);
		ret = host->pdata->suspend(dev, host->slot_id);
		if (ret) {
				dev_dbg(mmc_dev(host->mmc),
					"Unable to handle MMC board"
			dev_dbg(dev, "Unable to handle MMC board"
					" level suspend\n");
			host->suspended = 0;
			return ret;
@@ -2102,11 +2099,9 @@ static int omap_hsmmc_suspend(struct device *dev)
	if (ret) {
		host->suspended = 0;
		if (host->pdata->resume) {
				ret = host->pdata->resume(&pdev->dev,
							  host->slot_id);
			ret = host->pdata->resume(dev, host->slot_id);
			if (ret)
					dev_dbg(mmc_dev(host->mmc),
						"Unmask interrupt failed\n");
				dev_dbg(dev, "Unmask interrupt failed\n");
		}
		goto err;
	}
@@ -2116,10 +2111,9 @@ static int omap_hsmmc_suspend(struct device *dev)
		OMAP_HSMMC_WRITE(host->base, HCTL,
				OMAP_HSMMC_READ(host->base, HCTL) & ~SDBP);
	}

	if (host->got_dbclk)
		clk_disable(host->dbclk);

	}
err:
	pm_runtime_put_sync(host->dev);
	return ret;
@@ -2129,13 +2123,14 @@ static int omap_hsmmc_suspend(struct device *dev)
static int omap_hsmmc_resume(struct device *dev)
{
	int ret = 0;
	struct platform_device *pdev = to_platform_device(dev);
	struct omap_hsmmc_host *host = platform_get_drvdata(pdev);
	struct omap_hsmmc_host *host = dev_get_drvdata(dev);

	if (!host)
		return 0;

	if (host && !host->suspended)
		return 0;

	if (host) {
	pm_runtime_get_sync(host->dev);

	if (host->got_dbclk)
@@ -2145,10 +2140,9 @@ static int omap_hsmmc_resume(struct device *dev)
		omap_hsmmc_conf_bus_power(host);

	if (host->pdata->resume) {
			ret = host->pdata->resume(&pdev->dev, host->slot_id);
		ret = host->pdata->resume(dev, host->slot_id);
		if (ret)
				dev_dbg(mmc_dev(host->mmc),
					"Unmask interrupt failed\n");
			dev_dbg(dev, "Unmask interrupt failed\n");
	}

	omap_hsmmc_protect_card(host);
@@ -2160,7 +2154,6 @@ static int omap_hsmmc_resume(struct device *dev)

	pm_runtime_mark_last_busy(host->dev);
	pm_runtime_put_autosuspend(host->dev);
	}

	return ret;

@@ -2177,7 +2170,7 @@ static int omap_hsmmc_runtime_suspend(struct device *dev)

	host = platform_get_drvdata(to_platform_device(dev));
	omap_hsmmc_context_save(host);
	dev_dbg(mmc_dev(host->mmc), "disabled\n");
	dev_dbg(dev, "disabled\n");

	return 0;
}
@@ -2188,7 +2181,7 @@ static int omap_hsmmc_runtime_resume(struct device *dev)

	host = platform_get_drvdata(to_platform_device(dev));
	omap_hsmmc_context_restore(host);
	dev_dbg(mmc_dev(host->mmc), "enabled\n");
	dev_dbg(dev, "enabled\n");

	return 0;
}