Commit c3cd5c07 authored by Fabio Estevam's avatar Fabio Estevam Committed by Ulf Hansson

mmc: mxs-mmc: No need to do NULL check on 'iores'

devm_ioremap_resource() already checks if 'iores' is NULL or not, so we can
skip this manual check.

While at it, move platform_get_resource() closer to devm_ioremap_resource() for
better readability.
Signed-off-by: default avatarFabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 4d7c07cd
...@@ -581,9 +581,8 @@ static int mxs_mmc_probe(struct platform_device *pdev) ...@@ -581,9 +581,8 @@ static int mxs_mmc_probe(struct platform_device *pdev)
struct regulator *reg_vmmc; struct regulator *reg_vmmc;
struct mxs_ssp *ssp; struct mxs_ssp *ssp;
iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
irq_err = platform_get_irq(pdev, 0); irq_err = platform_get_irq(pdev, 0);
if (!iores || irq_err < 0) if (irq_err < 0)
return -EINVAL; return -EINVAL;
mmc = mmc_alloc_host(sizeof(struct mxs_mmc_host), &pdev->dev); mmc = mmc_alloc_host(sizeof(struct mxs_mmc_host), &pdev->dev);
...@@ -593,6 +592,7 @@ static int mxs_mmc_probe(struct platform_device *pdev) ...@@ -593,6 +592,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
host = mmc_priv(mmc); host = mmc_priv(mmc);
ssp = &host->ssp; ssp = &host->ssp;
ssp->dev = &pdev->dev; ssp->dev = &pdev->dev;
iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
ssp->base = devm_ioremap_resource(&pdev->dev, iores); ssp->base = devm_ioremap_resource(&pdev->dev, iores);
if (IS_ERR(ssp->base)) { if (IS_ERR(ssp->base)) {
ret = PTR_ERR(ssp->base); ret = PTR_ERR(ssp->base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment