diff options
Diffstat (limited to 'drivers/scsi/sata_sx4.c')
-rw-r--r-- | drivers/scsi/sata_sx4.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/drivers/scsi/sata_sx4.c b/drivers/scsi/sata_sx4.c index c72fcc46f0fa..540a85191172 100644 --- a/drivers/scsi/sata_sx4.c +++ b/drivers/scsi/sata_sx4.c | |||
@@ -245,13 +245,14 @@ static struct pci_driver pdc_sata_pci_driver = { | |||
245 | 245 | ||
246 | static void pdc20621_host_stop(struct ata_host_set *host_set) | 246 | static void pdc20621_host_stop(struct ata_host_set *host_set) |
247 | { | 247 | { |
248 | struct pci_dev *pdev = to_pci_dev(host_set->dev); | ||
248 | struct pdc_host_priv *hpriv = host_set->private_data; | 249 | struct pdc_host_priv *hpriv = host_set->private_data; |
249 | void *dimm_mmio = hpriv->dimm_mmio; | 250 | void *dimm_mmio = hpriv->dimm_mmio; |
250 | 251 | ||
251 | iounmap(dimm_mmio); | 252 | pci_iounmap(pdev, dimm_mmio); |
252 | kfree(hpriv); | 253 | kfree(hpriv); |
253 | 254 | ||
254 | ata_host_stop(host_set); | 255 | pci_iounmap(pdev, host_set->mmio_base); |
255 | } | 256 | } |
256 | 257 | ||
257 | static int pdc_port_start(struct ata_port *ap) | 258 | static int pdc_port_start(struct ata_port *ap) |
@@ -451,9 +452,9 @@ static void pdc20621_dma_prep(struct ata_queued_cmd *qc) | |||
451 | struct scatterlist *sg = qc->sg; | 452 | struct scatterlist *sg = qc->sg; |
452 | struct ata_port *ap = qc->ap; | 453 | struct ata_port *ap = qc->ap; |
453 | struct pdc_port_priv *pp = ap->private_data; | 454 | struct pdc_port_priv *pp = ap->private_data; |
454 | void *mmio = ap->host_set->mmio_base; | 455 | void __iomem *mmio = ap->host_set->mmio_base; |
455 | struct pdc_host_priv *hpriv = ap->host_set->private_data; | 456 | struct pdc_host_priv *hpriv = ap->host_set->private_data; |
456 | void *dimm_mmio = hpriv->dimm_mmio; | 457 | void __iomem *dimm_mmio = hpriv->dimm_mmio; |
457 | unsigned int portno = ap->port_no; | 458 | unsigned int portno = ap->port_no; |
458 | unsigned int i, last, idx, total_len = 0, sgt_len; | 459 | unsigned int i, last, idx, total_len = 0, sgt_len; |
459 | u32 *buf = (u32 *) &pp->dimm_buf[PDC_DIMM_HEADER_SZ]; | 460 | u32 *buf = (u32 *) &pp->dimm_buf[PDC_DIMM_HEADER_SZ]; |
@@ -513,9 +514,9 @@ static void pdc20621_nodata_prep(struct ata_queued_cmd *qc) | |||
513 | { | 514 | { |
514 | struct ata_port *ap = qc->ap; | 515 | struct ata_port *ap = qc->ap; |
515 | struct pdc_port_priv *pp = ap->private_data; | 516 | struct pdc_port_priv *pp = ap->private_data; |
516 | void *mmio = ap->host_set->mmio_base; | 517 | void __iomem *mmio = ap->host_set->mmio_base; |
517 | struct pdc_host_priv *hpriv = ap->host_set->private_data; | 518 | struct pdc_host_priv *hpriv = ap->host_set->private_data; |
518 | void *dimm_mmio = hpriv->dimm_mmio; | 519 | void __iomem *dimm_mmio = hpriv->dimm_mmio; |
519 | unsigned int portno = ap->port_no; | 520 | unsigned int portno = ap->port_no; |
520 | unsigned int i; | 521 | unsigned int i; |
521 | 522 | ||
@@ -565,7 +566,7 @@ static void __pdc20621_push_hdma(struct ata_queued_cmd *qc, | |||
565 | { | 566 | { |
566 | struct ata_port *ap = qc->ap; | 567 | struct ata_port *ap = qc->ap; |
567 | struct ata_host_set *host_set = ap->host_set; | 568 | struct ata_host_set *host_set = ap->host_set; |
568 | void *mmio = host_set->mmio_base; | 569 | void __iomem *mmio = host_set->mmio_base; |
569 | 570 | ||
570 | /* hard-code chip #0 */ | 571 | /* hard-code chip #0 */ |
571 | mmio += PDC_CHIP0_OFS; | 572 | mmio += PDC_CHIP0_OFS; |
@@ -639,7 +640,7 @@ static void pdc20621_packet_start(struct ata_queued_cmd *qc) | |||
639 | struct ata_port *ap = qc->ap; | 640 | struct ata_port *ap = qc->ap; |
640 | struct ata_host_set *host_set = ap->host_set; | 641 | struct ata_host_set *host_set = ap->host_set; |
641 | unsigned int port_no = ap->port_no; | 642 | unsigned int port_no = ap->port_no; |
642 | void *mmio = host_set->mmio_base; | 643 | void __iomem *mmio = host_set->mmio_base; |
643 | unsigned int rw = (qc->tf.flags & ATA_TFLAG_WRITE); | 644 | unsigned int rw = (qc->tf.flags & ATA_TFLAG_WRITE); |
644 | u8 seq = (u8) (port_no + 1); | 645 | u8 seq = (u8) (port_no + 1); |
645 | unsigned int port_ofs; | 646 | unsigned int port_ofs; |
@@ -699,7 +700,7 @@ static int pdc20621_qc_issue_prot(struct ata_queued_cmd *qc) | |||
699 | static inline unsigned int pdc20621_host_intr( struct ata_port *ap, | 700 | static inline unsigned int pdc20621_host_intr( struct ata_port *ap, |
700 | struct ata_queued_cmd *qc, | 701 | struct ata_queued_cmd *qc, |
701 | unsigned int doing_hdma, | 702 | unsigned int doing_hdma, |
702 | void *mmio) | 703 | void __iomem *mmio) |
703 | { | 704 | { |
704 | unsigned int port_no = ap->port_no; | 705 | unsigned int port_no = ap->port_no; |
705 | unsigned int port_ofs = | 706 | unsigned int port_ofs = |
@@ -778,7 +779,7 @@ static inline unsigned int pdc20621_host_intr( struct ata_port *ap, | |||
778 | static void pdc20621_irq_clear(struct ata_port *ap) | 779 | static void pdc20621_irq_clear(struct ata_port *ap) |
779 | { | 780 | { |
780 | struct ata_host_set *host_set = ap->host_set; | 781 | struct ata_host_set *host_set = ap->host_set; |
781 | void *mmio = host_set->mmio_base; | 782 | void __iomem *mmio = host_set->mmio_base; |
782 | 783 | ||
783 | mmio += PDC_CHIP0_OFS; | 784 | mmio += PDC_CHIP0_OFS; |
784 | 785 | ||
@@ -792,7 +793,7 @@ static irqreturn_t pdc20621_interrupt (int irq, void *dev_instance, struct pt_re | |||
792 | u32 mask = 0; | 793 | u32 mask = 0; |
793 | unsigned int i, tmp, port_no; | 794 | unsigned int i, tmp, port_no; |
794 | unsigned int handled = 0; | 795 | unsigned int handled = 0; |
795 | void *mmio_base; | 796 | void __iomem *mmio_base; |
796 | 797 | ||
797 | VPRINTK("ENTER\n"); | 798 | VPRINTK("ENTER\n"); |
798 | 799 | ||
@@ -940,9 +941,9 @@ static void pdc20621_get_from_dimm(struct ata_probe_ent *pe, void *psource, | |||
940 | u16 idx; | 941 | u16 idx; |
941 | u8 page_mask; | 942 | u8 page_mask; |
942 | long dist; | 943 | long dist; |
943 | void *mmio = pe->mmio_base; | 944 | void __iomem *mmio = pe->mmio_base; |
944 | struct pdc_host_priv *hpriv = pe->private_data; | 945 | struct pdc_host_priv *hpriv = pe->private_data; |
945 | void *dimm_mmio = hpriv->dimm_mmio; | 946 | void __iomem *dimm_mmio = hpriv->dimm_mmio; |
946 | 947 | ||
947 | /* hard-code chip #0 */ | 948 | /* hard-code chip #0 */ |
948 | mmio += PDC_CHIP0_OFS; | 949 | mmio += PDC_CHIP0_OFS; |
@@ -996,9 +997,9 @@ static void pdc20621_put_to_dimm(struct ata_probe_ent *pe, void *psource, | |||
996 | u16 idx; | 997 | u16 idx; |
997 | u8 page_mask; | 998 | u8 page_mask; |
998 | long dist; | 999 | long dist; |
999 | void *mmio = pe->mmio_base; | 1000 | void __iomem *mmio = pe->mmio_base; |
1000 | struct pdc_host_priv *hpriv = pe->private_data; | 1001 | struct pdc_host_priv *hpriv = pe->private_data; |
1001 | void *dimm_mmio = hpriv->dimm_mmio; | 1002 | void __iomem *dimm_mmio = hpriv->dimm_mmio; |
1002 | 1003 | ||
1003 | /* hard-code chip #0 */ | 1004 | /* hard-code chip #0 */ |
1004 | mmio += PDC_CHIP0_OFS; | 1005 | mmio += PDC_CHIP0_OFS; |
@@ -1044,7 +1045,7 @@ static void pdc20621_put_to_dimm(struct ata_probe_ent *pe, void *psource, | |||
1044 | static unsigned int pdc20621_i2c_read(struct ata_probe_ent *pe, u32 device, | 1045 | static unsigned int pdc20621_i2c_read(struct ata_probe_ent *pe, u32 device, |
1045 | u32 subaddr, u32 *pdata) | 1046 | u32 subaddr, u32 *pdata) |
1046 | { | 1047 | { |
1047 | void *mmio = pe->mmio_base; | 1048 | void __iomem *mmio = pe->mmio_base; |
1048 | u32 i2creg = 0; | 1049 | u32 i2creg = 0; |
1049 | u32 status; | 1050 | u32 status; |
1050 | u32 count =0; | 1051 | u32 count =0; |
@@ -1103,7 +1104,7 @@ static int pdc20621_prog_dimm0(struct ata_probe_ent *pe) | |||
1103 | u32 data = 0; | 1104 | u32 data = 0; |
1104 | int size, i; | 1105 | int size, i; |
1105 | u8 bdimmsize; | 1106 | u8 bdimmsize; |
1106 | void *mmio = pe->mmio_base; | 1107 | void __iomem *mmio = pe->mmio_base; |
1107 | static const struct { | 1108 | static const struct { |
1108 | unsigned int reg; | 1109 | unsigned int reg; |
1109 | unsigned int ofs; | 1110 | unsigned int ofs; |
@@ -1166,7 +1167,7 @@ static unsigned int pdc20621_prog_dimm_global(struct ata_probe_ent *pe) | |||
1166 | { | 1167 | { |
1167 | u32 data, spd0; | 1168 | u32 data, spd0; |
1168 | int error, i; | 1169 | int error, i; |
1169 | void *mmio = pe->mmio_base; | 1170 | void __iomem *mmio = pe->mmio_base; |
1170 | 1171 | ||
1171 | /* hard-code chip #0 */ | 1172 | /* hard-code chip #0 */ |
1172 | mmio += PDC_CHIP0_OFS; | 1173 | mmio += PDC_CHIP0_OFS; |
@@ -1220,7 +1221,7 @@ static unsigned int pdc20621_dimm_init(struct ata_probe_ent *pe) | |||
1220 | u32 ticks=0; | 1221 | u32 ticks=0; |
1221 | u32 clock=0; | 1222 | u32 clock=0; |
1222 | u32 fparam=0; | 1223 | u32 fparam=0; |
1223 | void *mmio = pe->mmio_base; | 1224 | void __iomem *mmio = pe->mmio_base; |
1224 | 1225 | ||
1225 | /* hard-code chip #0 */ | 1226 | /* hard-code chip #0 */ |
1226 | mmio += PDC_CHIP0_OFS; | 1227 | mmio += PDC_CHIP0_OFS; |
@@ -1344,7 +1345,7 @@ static unsigned int pdc20621_dimm_init(struct ata_probe_ent *pe) | |||
1344 | static void pdc_20621_init(struct ata_probe_ent *pe) | 1345 | static void pdc_20621_init(struct ata_probe_ent *pe) |
1345 | { | 1346 | { |
1346 | u32 tmp; | 1347 | u32 tmp; |
1347 | void *mmio = pe->mmio_base; | 1348 | void __iomem *mmio = pe->mmio_base; |
1348 | 1349 | ||
1349 | /* hard-code chip #0 */ | 1350 | /* hard-code chip #0 */ |
1350 | mmio += PDC_CHIP0_OFS; | 1351 | mmio += PDC_CHIP0_OFS; |
@@ -1377,7 +1378,8 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id * | |||
1377 | static int printed_version; | 1378 | static int printed_version; |
1378 | struct ata_probe_ent *probe_ent = NULL; | 1379 | struct ata_probe_ent *probe_ent = NULL; |
1379 | unsigned long base; | 1380 | unsigned long base; |
1380 | void *mmio_base, *dimm_mmio = NULL; | 1381 | void __iomem *mmio_base; |
1382 | void __iomem *dimm_mmio = NULL; | ||
1381 | struct pdc_host_priv *hpriv = NULL; | 1383 | struct pdc_host_priv *hpriv = NULL; |
1382 | unsigned int board_idx = (unsigned int) ent->driver_data; | 1384 | unsigned int board_idx = (unsigned int) ent->driver_data; |
1383 | int pci_dev_busy = 0; | 1385 | int pci_dev_busy = 0; |
@@ -1417,8 +1419,7 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id * | |||
1417 | probe_ent->dev = pci_dev_to_dev(pdev); | 1419 | probe_ent->dev = pci_dev_to_dev(pdev); |
1418 | INIT_LIST_HEAD(&probe_ent->node); | 1420 | INIT_LIST_HEAD(&probe_ent->node); |
1419 | 1421 | ||
1420 | mmio_base = ioremap(pci_resource_start(pdev, 3), | 1422 | mmio_base = pci_iomap(pdev, 3, 0); |
1421 | pci_resource_len(pdev, 3)); | ||
1422 | if (mmio_base == NULL) { | 1423 | if (mmio_base == NULL) { |
1423 | rc = -ENOMEM; | 1424 | rc = -ENOMEM; |
1424 | goto err_out_free_ent; | 1425 | goto err_out_free_ent; |
@@ -1432,8 +1433,7 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id * | |||
1432 | } | 1433 | } |
1433 | memset(hpriv, 0, sizeof(*hpriv)); | 1434 | memset(hpriv, 0, sizeof(*hpriv)); |
1434 | 1435 | ||
1435 | dimm_mmio = ioremap(pci_resource_start(pdev, 4), | 1436 | dimm_mmio = pci_iomap(pdev, 4, 0); |
1436 | pci_resource_len(pdev, 4)); | ||
1437 | if (!dimm_mmio) { | 1437 | if (!dimm_mmio) { |
1438 | kfree(hpriv); | 1438 | kfree(hpriv); |
1439 | rc = -ENOMEM; | 1439 | rc = -ENOMEM; |
@@ -1480,9 +1480,9 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id * | |||
1480 | 1480 | ||
1481 | err_out_iounmap_dimm: /* only get to this label if 20621 */ | 1481 | err_out_iounmap_dimm: /* only get to this label if 20621 */ |
1482 | kfree(hpriv); | 1482 | kfree(hpriv); |
1483 | iounmap(dimm_mmio); | 1483 | pci_iounmap(pdev, dimm_mmio); |
1484 | err_out_iounmap: | 1484 | err_out_iounmap: |
1485 | iounmap(mmio_base); | 1485 | pci_iounmap(pdev, mmio_base); |
1486 | err_out_free_ent: | 1486 | err_out_free_ent: |
1487 | kfree(probe_ent); | 1487 | kfree(probe_ent); |
1488 | err_out_regions: | 1488 | err_out_regions: |