diff options
| -rw-r--r-- | drivers/ata/sata_mv.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index 6eed4a72d328..00ce26d0c047 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
| @@ -4067,6 +4067,7 @@ static int mv_platform_probe(struct platform_device *pdev) | |||
| 4067 | struct ata_host *host; | 4067 | struct ata_host *host; |
| 4068 | struct mv_host_priv *hpriv; | 4068 | struct mv_host_priv *hpriv; |
| 4069 | struct resource *res; | 4069 | struct resource *res; |
| 4070 | void __iomem *mmio; | ||
| 4070 | int n_ports = 0, irq = 0; | 4071 | int n_ports = 0, irq = 0; |
| 4071 | int rc; | 4072 | int rc; |
| 4072 | int port; | 4073 | int port; |
| @@ -4085,8 +4086,9 @@ static int mv_platform_probe(struct platform_device *pdev) | |||
| 4085 | * Get the register base first | 4086 | * Get the register base first |
| 4086 | */ | 4087 | */ |
| 4087 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 4088 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 4088 | if (res == NULL) | 4089 | mmio = devm_ioremap_resource(&pdev->dev, res); |
| 4089 | return -EINVAL; | 4090 | if (IS_ERR(mmio)) |
| 4091 | return PTR_ERR(mmio); | ||
| 4090 | 4092 | ||
| 4091 | /* allocate host */ | 4093 | /* allocate host */ |
| 4092 | if (pdev->dev.of_node) { | 4094 | if (pdev->dev.of_node) { |
| @@ -4130,12 +4132,7 @@ static int mv_platform_probe(struct platform_device *pdev) | |||
| 4130 | hpriv->board_idx = chip_soc; | 4132 | hpriv->board_idx = chip_soc; |
| 4131 | 4133 | ||
| 4132 | host->iomap = NULL; | 4134 | host->iomap = NULL; |
| 4133 | hpriv->base = devm_ioremap(&pdev->dev, res->start, | 4135 | hpriv->base = mmio - SATAHC0_REG_BASE; |
| 4134 | resource_size(res)); | ||
| 4135 | if (!hpriv->base) | ||
| 4136 | return -ENOMEM; | ||
| 4137 | |||
| 4138 | hpriv->base -= SATAHC0_REG_BASE; | ||
| 4139 | 4136 | ||
| 4140 | hpriv->clk = clk_get(&pdev->dev, NULL); | 4137 | hpriv->clk = clk_get(&pdev->dev, NULL); |
| 4141 | if (IS_ERR(hpriv->clk)) | 4138 | if (IS_ERR(hpriv->clk)) |
