提交 f1cb0ea1 编写于 作者: S Saeed Bishara 提交者: Jeff Garzik

sata_mv: remove iounmap in mv_platform_remove and use devm_iomap

this will fix crash bug when doing rmmod to the driver, this is because the
port_stop function get called later and it could access the device's registers.
Signed-off-by: NSaeed Bishara <saeed@marvell.com>
Acked-by: NMark Lord <mlord@pobox.com>
Acked-by: NTejun Heo <htejun@gmail.com>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 5d44b414
......@@ -2947,7 +2947,8 @@ static int mv_platform_probe(struct platform_device *pdev)
hpriv->n_ports = n_ports;
host->iomap = NULL;
hpriv->base = ioremap(res->start, res->end - res->start + 1);
hpriv->base = devm_ioremap(&pdev->dev, res->start,
res->end - res->start + 1);
hpriv->base -= MV_SATAHC0_REG_BASE;
rc = mv_create_dma_pools(hpriv, &pdev->dev);
......@@ -2979,11 +2980,8 @@ static int __devexit mv_platform_remove(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct ata_host *host = dev_get_drvdata(dev);
struct mv_host_priv *hpriv = host->private_data;
void __iomem *base = hpriv->base;
ata_host_detach(host);
iounmap(base);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册