Commit 368e5fbd authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Tejun Heo

ata: sata_mv: Convert to devm_ioremap_resource()

Convert to devm_ioremap_resource() which provides more consistent error
handling.

Note that devm_ioremap_resource() provides its own error messages.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 0fe4618d
...@@ -4067,6 +4067,7 @@ static int mv_platform_probe(struct platform_device *pdev) ...@@ -4067,6 +4067,7 @@ static int mv_platform_probe(struct platform_device *pdev)
struct ata_host *host; struct ata_host *host;
struct mv_host_priv *hpriv; struct mv_host_priv *hpriv;
struct resource *res; struct resource *res;
void __iomem *mmio;
int n_ports = 0, irq = 0; int n_ports = 0, irq = 0;
int rc; int rc;
int port; int port;
...@@ -4085,8 +4086,9 @@ static int mv_platform_probe(struct platform_device *pdev) ...@@ -4085,8 +4086,9 @@ static int mv_platform_probe(struct platform_device *pdev)
* Get the register base first * Get the register base first
*/ */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res == NULL) mmio = devm_ioremap_resource(&pdev->dev, res);
return -EINVAL; if (IS_ERR(mmio))
return PTR_ERR(mmio);
/* allocate host */ /* allocate host */
if (pdev->dev.of_node) { if (pdev->dev.of_node) {
...@@ -4130,12 +4132,7 @@ static int mv_platform_probe(struct platform_device *pdev) ...@@ -4130,12 +4132,7 @@ static int mv_platform_probe(struct platform_device *pdev)
hpriv->board_idx = chip_soc; hpriv->board_idx = chip_soc;
host->iomap = NULL; host->iomap = NULL;
hpriv->base = devm_ioremap(&pdev->dev, res->start, hpriv->base = mmio - SATAHC0_REG_BASE;
resource_size(res));
if (!hpriv->base)
return -ENOMEM;
hpriv->base -= SATAHC0_REG_BASE;
hpriv->clk = clk_get(&pdev->dev, NULL); hpriv->clk = clk_get(&pdev->dev, NULL);
if (IS_ERR(hpriv->clk)) if (IS_ERR(hpriv->clk))
......
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