Commit bcc87666 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Chris Ball

mmc: dw_mmc-pltfm: don't check resource with devm_ioremap_resource

devm_ioremap_resource does sanity checks on the given resource.
No need to duplicate this in the driver.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarSeungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent fdfa20c1
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include "dw_mmc.h" #include "dw_mmc.h"
int dw_mci_pltfm_register(struct platform_device *pdev, int dw_mci_pltfm_register(struct platform_device *pdev,
const struct dw_mci_drv_data *drv_data) const struct dw_mci_drv_data *drv_data)
{ {
struct dw_mci *host; struct dw_mci *host;
struct resource *regs; struct resource *regs;
...@@ -35,10 +35,6 @@ int dw_mci_pltfm_register(struct platform_device *pdev, ...@@ -35,10 +35,6 @@ int dw_mci_pltfm_register(struct platform_device *pdev,
if (!host) if (!host)
return -ENOMEM; return -ENOMEM;
regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!regs)
return -ENXIO;
host->irq = platform_get_irq(pdev, 0); host->irq = platform_get_irq(pdev, 0);
if (host->irq < 0) if (host->irq < 0)
return host->irq; return host->irq;
...@@ -47,6 +43,8 @@ int dw_mci_pltfm_register(struct platform_device *pdev, ...@@ -47,6 +43,8 @@ int dw_mci_pltfm_register(struct platform_device *pdev,
host->dev = &pdev->dev; host->dev = &pdev->dev;
host->irq_flags = 0; host->irq_flags = 0;
host->pdata = pdev->dev.platform_data; host->pdata = pdev->dev.platform_data;
regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
host->regs = devm_ioremap_resource(&pdev->dev, regs); host->regs = devm_ioremap_resource(&pdev->dev, regs);
if (IS_ERR(host->regs)) if (IS_ERR(host->regs))
return PTR_ERR(host->regs); return PTR_ERR(host->regs);
......
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