1 From 3e4240da0e3673637c1c995bdd14cfdbc8f4dc4c Mon Sep 17 00:00:00 2001
2 From: Andrew Lunn <andrew@lunn.ch>
3 Date: Wed, 24 May 2017 01:39:35 +0200
4 Subject: Revert "ata: sata_mv: Convert to devm_ioremap_resource()"
6 From: Andrew Lunn <andrew@lunn.ch>
8 commit 3e4240da0e3673637c1c995bdd14cfdbc8f4dc4c upstream.
10 This reverts commit 368e5fbdfc60732643f34f538823ed4bc8829827.
12 devm_ioremap_resource() enforces that there are no overlapping
13 resources, where as devm_ioremap() does not. The sata phy driver needs
14 a subset of the sata IO address space, so maps some of the sata
15 address space. As a result, sata_mv now fails to probe, reporting it
16 cannot get its resources, and so we don't have any SATA disks.
18 Signed-off-by: Andrew Lunn <andrew@lunn.ch>
19 Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
20 Signed-off-by: Tejun Heo <tj@kernel.org>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24 drivers/ata/sata_mv.c | 13 ++++++++-----
25 1 file changed, 8 insertions(+), 5 deletions(-)
27 --- a/drivers/ata/sata_mv.c
28 +++ b/drivers/ata/sata_mv.c
29 @@ -4067,7 +4067,6 @@ static int mv_platform_probe(struct plat
30 struct ata_host *host;
31 struct mv_host_priv *hpriv;
34 int n_ports = 0, irq = 0;
37 @@ -4086,9 +4085,8 @@ static int mv_platform_probe(struct plat
38 * Get the register base first
40 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
41 - mmio = devm_ioremap_resource(&pdev->dev, res);
43 - return PTR_ERR(mmio);
48 if (pdev->dev.of_node) {
49 @@ -4132,7 +4130,12 @@ static int mv_platform_probe(struct plat
50 hpriv->board_idx = chip_soc;
53 - hpriv->base = mmio - SATAHC0_REG_BASE;
54 + hpriv->base = devm_ioremap(&pdev->dev, res->start,
55 + resource_size(res));
59 + hpriv->base -= SATAHC0_REG_BASE;
61 hpriv->clk = clk_get(&pdev->dev, NULL);
62 if (IS_ERR(hpriv->clk))