sata_mv: remove iounmap in mv_platform_remove and use devm_iomap
PATCH 1/1 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.
--- drivers/ata/sata_mv.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
drivers/ata/sata_mv.c +2 -4
@@ -2951,7 +2951,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);
@@ -2983,11 +2984,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 ; }
Signature · 1 line
1.5.2.5
Quoted 24 lines · Saeed Bishara
this will fix crash bug when doing rmmod to the driver, this is because the
port_stopfunction get called later and it could access the device's registers.Signed-off-by Saeed Bishara <[email protected]>--- drivers/ata/sata_mv.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)drivers/ata/sata_mv.c +2
-1@@ -2951,7 +2951,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);@@ -2983,11 +2984,8 @@ static int __devexit mv_platform_remove(struct platform_device *pdev) {
drivers/ata/sata_mv.c static int __devexit mv_platform_remove(struct platform_device *pdev) · line 2991
Quoted 10 lines
drivers/ata/sata_mv.c +0
-3struct 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 ; }
..
Acked0by: Mark Lord <[email protected]>
Looks correct to me.
Tejun Heo
Acked-byQuoted 7 lines · Mark Lord
Quoted 6 lines · Saeed Bishara
this will fix crash bug when doing rmmod to the driver, this is because the
port_stopfunction get called later and it could access the device's registers.Signed-off-by Saeed Bishara <[email protected]>
Signature · 1 line
tejun
Jeff Garzik
AppliedQuoted 7 lines · Saeed Bishara
this will fix crash bug when doing rmmod to the driver, this is because the
port_stopfunction get called later and it could access the device's registers.Signed-off-by Saeed Bishara <[email protected]>--- drivers/ata/sata_mv.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
applied