diff options
Diffstat (limited to 'drivers/ata/sata_mv.c')
-rw-r--r-- | drivers/ata/sata_mv.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index 04b571764aff..6ebebde8454a 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
@@ -870,7 +870,7 @@ static void mv_start_dma(struct ata_port *ap, void __iomem *port_mmio, | |||
870 | struct mv_host_priv *hpriv = ap->host->private_data; | 870 | struct mv_host_priv *hpriv = ap->host->private_data; |
871 | int hard_port = mv_hardport_from_port(ap->port_no); | 871 | int hard_port = mv_hardport_from_port(ap->port_no); |
872 | void __iomem *hc_mmio = mv_hc_base_from_port( | 872 | void __iomem *hc_mmio = mv_hc_base_from_port( |
873 | ap->host->iomap[MV_PRIMARY_BAR], hard_port); | 873 | mv_host_base(ap->host), hard_port); |
874 | u32 hc_irq_cause, ipending; | 874 | u32 hc_irq_cause, ipending; |
875 | 875 | ||
876 | /* clear EDMA event indicators, if any */ | 876 | /* clear EDMA event indicators, if any */ |
@@ -1158,17 +1158,13 @@ static int mv_port_start(struct ata_port *ap) | |||
1158 | struct mv_port_priv *pp; | 1158 | struct mv_port_priv *pp; |
1159 | void __iomem *port_mmio = mv_ap_base(ap); | 1159 | void __iomem *port_mmio = mv_ap_base(ap); |
1160 | unsigned long flags; | 1160 | unsigned long flags; |
1161 | int tag, rc; | 1161 | int tag; |
1162 | 1162 | ||
1163 | pp = devm_kzalloc(dev, sizeof(*pp), GFP_KERNEL); | 1163 | pp = devm_kzalloc(dev, sizeof(*pp), GFP_KERNEL); |
1164 | if (!pp) | 1164 | if (!pp) |
1165 | return -ENOMEM; | 1165 | return -ENOMEM; |
1166 | ap->private_data = pp; | 1166 | ap->private_data = pp; |
1167 | 1167 | ||
1168 | rc = ata_pad_alloc(ap, dev); | ||
1169 | if (rc) | ||
1170 | return rc; | ||
1171 | |||
1172 | pp->crqb = dma_pool_alloc(hpriv->crqb_pool, GFP_KERNEL, &pp->crqb_dma); | 1168 | pp->crqb = dma_pool_alloc(hpriv->crqb_pool, GFP_KERNEL, &pp->crqb_dma); |
1173 | if (!pp->crqb) | 1169 | if (!pp->crqb) |
1174 | return -ENOMEM; | 1170 | return -ENOMEM; |
@@ -1542,7 +1538,7 @@ static void mv_err_intr(struct ata_port *ap, struct ata_queued_cmd *qc) | |||
1542 | eh_freeze_mask = EDMA_EH_FREEZE_5; | 1538 | eh_freeze_mask = EDMA_EH_FREEZE_5; |
1543 | 1539 | ||
1544 | if (edma_err_cause & EDMA_ERR_SELF_DIS_5) { | 1540 | if (edma_err_cause & EDMA_ERR_SELF_DIS_5) { |
1545 | struct mv_port_priv *pp = ap->private_data; | 1541 | pp = ap->private_data; |
1546 | pp->pp_flags &= ~MV_PP_FLAG_EDMA_EN; | 1542 | pp->pp_flags &= ~MV_PP_FLAG_EDMA_EN; |
1547 | ata_ehi_push_desc(ehi, "EDMA self-disable"); | 1543 | ata_ehi_push_desc(ehi, "EDMA self-disable"); |
1548 | } | 1544 | } |
@@ -1550,7 +1546,7 @@ static void mv_err_intr(struct ata_port *ap, struct ata_queued_cmd *qc) | |||
1550 | eh_freeze_mask = EDMA_EH_FREEZE; | 1546 | eh_freeze_mask = EDMA_EH_FREEZE; |
1551 | 1547 | ||
1552 | if (edma_err_cause & EDMA_ERR_SELF_DIS) { | 1548 | if (edma_err_cause & EDMA_ERR_SELF_DIS) { |
1553 | struct mv_port_priv *pp = ap->private_data; | 1549 | pp = ap->private_data; |
1554 | pp->pp_flags &= ~MV_PP_FLAG_EDMA_EN; | 1550 | pp->pp_flags &= ~MV_PP_FLAG_EDMA_EN; |
1555 | ata_ehi_push_desc(ehi, "EDMA self-disable"); | 1551 | ata_ehi_push_desc(ehi, "EDMA self-disable"); |
1556 | } | 1552 | } |
@@ -2951,7 +2947,8 @@ static int mv_platform_probe(struct platform_device *pdev) | |||
2951 | hpriv->n_ports = n_ports; | 2947 | hpriv->n_ports = n_ports; |
2952 | 2948 | ||
2953 | host->iomap = NULL; | 2949 | host->iomap = NULL; |
2954 | hpriv->base = ioremap(res->start, res->end - res->start + 1); | 2950 | hpriv->base = devm_ioremap(&pdev->dev, res->start, |
2951 | res->end - res->start + 1); | ||
2955 | hpriv->base -= MV_SATAHC0_REG_BASE; | 2952 | hpriv->base -= MV_SATAHC0_REG_BASE; |
2956 | 2953 | ||
2957 | rc = mv_create_dma_pools(hpriv, &pdev->dev); | 2954 | rc = mv_create_dma_pools(hpriv, &pdev->dev); |
@@ -2983,11 +2980,8 @@ static int __devexit mv_platform_remove(struct platform_device *pdev) | |||
2983 | { | 2980 | { |
2984 | struct device *dev = &pdev->dev; | 2981 | struct device *dev = &pdev->dev; |
2985 | struct ata_host *host = dev_get_drvdata(dev); | 2982 | struct ata_host *host = dev_get_drvdata(dev); |
2986 | struct mv_host_priv *hpriv = host->private_data; | ||
2987 | void __iomem *base = hpriv->base; | ||
2988 | 2983 | ||
2989 | ata_host_detach(host); | 2984 | ata_host_detach(host); |
2990 | iounmap(base); | ||
2991 | return 0; | 2985 | return 0; |
2992 | } | 2986 | } |
2993 | 2987 | ||
@@ -3198,6 +3192,7 @@ MODULE_DESCRIPTION("SCSI low-level driver for Marvell SATA controllers"); | |||
3198 | MODULE_LICENSE("GPL"); | 3192 | MODULE_LICENSE("GPL"); |
3199 | MODULE_DEVICE_TABLE(pci, mv_pci_tbl); | 3193 | MODULE_DEVICE_TABLE(pci, mv_pci_tbl); |
3200 | MODULE_VERSION(DRV_VERSION); | 3194 | MODULE_VERSION(DRV_VERSION); |
3195 | MODULE_ALIAS("platform:sata_mv"); | ||
3201 | 3196 | ||
3202 | #ifdef CONFIG_PCI | 3197 | #ifdef CONFIG_PCI |
3203 | module_param(msi, int, 0444); | 3198 | module_param(msi, int, 0444); |