diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2005-10-29 01:38:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-29 13:35:07 -0400 |
commit | 4b4a5eaedfc098d825d4c34cad1f1115802512b7 (patch) | |
tree | a91db63ceed5da83934ccb376e48cc8321e2883a /drivers/scsi/sata_sil24.c | |
parent | 7533624527b9afa5585ca43ba534758052d848e5 (diff) |
[PATCH] sata_sil24 iomem annotations and fixes
trivial iomem annotations + missing memcpy_fromio() caught by those
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/scsi/sata_sil24.c')
-rw-r--r-- | drivers/scsi/sata_sil24.c | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c index 32d730bd5bb6..51855d3bac64 100644 --- a/drivers/scsi/sata_sil24.c +++ b/drivers/scsi/sata_sil24.c | |||
@@ -220,8 +220,8 @@ struct sil24_port_priv { | |||
220 | 220 | ||
221 | /* ap->host_set->private_data */ | 221 | /* ap->host_set->private_data */ |
222 | struct sil24_host_priv { | 222 | struct sil24_host_priv { |
223 | void *host_base; /* global controller control (128 bytes @BAR0) */ | 223 | void __iomem *host_base; /* global controller control (128 bytes @BAR0) */ |
224 | void *port_base; /* port registers (4 * 8192 bytes @BAR2) */ | 224 | void __iomem *port_base; /* port registers (4 * 8192 bytes @BAR2) */ |
225 | }; | 225 | }; |
226 | 226 | ||
227 | static u8 sil24_check_status(struct ata_port *ap); | 227 | static u8 sil24_check_status(struct ata_port *ap); |
@@ -349,10 +349,12 @@ static struct ata_port_info sil24_port_info[] = { | |||
349 | static inline void sil24_update_tf(struct ata_port *ap) | 349 | static inline void sil24_update_tf(struct ata_port *ap) |
350 | { | 350 | { |
351 | struct sil24_port_priv *pp = ap->private_data; | 351 | struct sil24_port_priv *pp = ap->private_data; |
352 | void *port = (void *)ap->ioaddr.cmd_addr; | 352 | void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr; |
353 | struct sil24_prb *prb = port; | 353 | struct sil24_prb __iomem *prb = port; |
354 | u8 fis[6 * 4]; | ||
354 | 355 | ||
355 | ata_tf_from_fis(prb->fis, &pp->tf); | 356 | memcpy_fromio(fis, prb->fis, 6 * 4); |
357 | ata_tf_from_fis(fis, &pp->tf); | ||
356 | } | 358 | } |
357 | 359 | ||
358 | static u8 sil24_check_status(struct ata_port *ap) | 360 | static u8 sil24_check_status(struct ata_port *ap) |
@@ -376,9 +378,9 @@ static int sil24_scr_map[] = { | |||
376 | 378 | ||
377 | static u32 sil24_scr_read(struct ata_port *ap, unsigned sc_reg) | 379 | static u32 sil24_scr_read(struct ata_port *ap, unsigned sc_reg) |
378 | { | 380 | { |
379 | void *scr_addr = (void *)ap->ioaddr.scr_addr; | 381 | void __iomem *scr_addr = (void __iomem *)ap->ioaddr.scr_addr; |
380 | if (sc_reg < ARRAY_SIZE(sil24_scr_map)) { | 382 | if (sc_reg < ARRAY_SIZE(sil24_scr_map)) { |
381 | void *addr; | 383 | void __iomem *addr; |
382 | addr = scr_addr + sil24_scr_map[sc_reg] * 4; | 384 | addr = scr_addr + sil24_scr_map[sc_reg] * 4; |
383 | return readl(scr_addr + sil24_scr_map[sc_reg] * 4); | 385 | return readl(scr_addr + sil24_scr_map[sc_reg] * 4); |
384 | } | 386 | } |
@@ -387,9 +389,9 @@ static u32 sil24_scr_read(struct ata_port *ap, unsigned sc_reg) | |||
387 | 389 | ||
388 | static void sil24_scr_write(struct ata_port *ap, unsigned sc_reg, u32 val) | 390 | static void sil24_scr_write(struct ata_port *ap, unsigned sc_reg, u32 val) |
389 | { | 391 | { |
390 | void *scr_addr = (void *)ap->ioaddr.scr_addr; | 392 | void __iomem *scr_addr = (void __iomem *)ap->ioaddr.scr_addr; |
391 | if (sc_reg < ARRAY_SIZE(sil24_scr_map)) { | 393 | if (sc_reg < ARRAY_SIZE(sil24_scr_map)) { |
392 | void *addr; | 394 | void __iomem *addr; |
393 | addr = scr_addr + sil24_scr_map[sc_reg] * 4; | 395 | addr = scr_addr + sil24_scr_map[sc_reg] * 4; |
394 | writel(val, scr_addr + sil24_scr_map[sc_reg] * 4); | 396 | writel(val, scr_addr + sil24_scr_map[sc_reg] * 4); |
395 | } | 397 | } |
@@ -454,7 +456,7 @@ static void sil24_qc_prep(struct ata_queued_cmd *qc) | |||
454 | static int sil24_qc_issue(struct ata_queued_cmd *qc) | 456 | static int sil24_qc_issue(struct ata_queued_cmd *qc) |
455 | { | 457 | { |
456 | struct ata_port *ap = qc->ap; | 458 | struct ata_port *ap = qc->ap; |
457 | void *port = (void *)ap->ioaddr.cmd_addr; | 459 | void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr; |
458 | struct sil24_port_priv *pp = ap->private_data; | 460 | struct sil24_port_priv *pp = ap->private_data; |
459 | dma_addr_t paddr = pp->cmd_block_dma + qc->tag * sizeof(*pp->cmd_block); | 461 | dma_addr_t paddr = pp->cmd_block_dma + qc->tag * sizeof(*pp->cmd_block); |
460 | 462 | ||
@@ -467,7 +469,7 @@ static void sil24_irq_clear(struct ata_port *ap) | |||
467 | /* unused */ | 469 | /* unused */ |
468 | } | 470 | } |
469 | 471 | ||
470 | static int __sil24_reset_controller(void *port) | 472 | static int __sil24_reset_controller(void __iomem *port) |
471 | { | 473 | { |
472 | int cnt; | 474 | int cnt; |
473 | u32 tmp; | 475 | u32 tmp; |
@@ -493,7 +495,7 @@ static void sil24_reset_controller(struct ata_port *ap) | |||
493 | { | 495 | { |
494 | printk(KERN_NOTICE DRV_NAME | 496 | printk(KERN_NOTICE DRV_NAME |
495 | " ata%u: resetting controller...\n", ap->id); | 497 | " ata%u: resetting controller...\n", ap->id); |
496 | if (__sil24_reset_controller((void *)ap->ioaddr.cmd_addr)) | 498 | if (__sil24_reset_controller((void __iomem *)ap->ioaddr.cmd_addr)) |
497 | printk(KERN_ERR DRV_NAME | 499 | printk(KERN_ERR DRV_NAME |
498 | " ata%u: failed to reset controller\n", ap->id); | 500 | " ata%u: failed to reset controller\n", ap->id); |
499 | } | 501 | } |
@@ -527,7 +529,7 @@ static void sil24_error_intr(struct ata_port *ap, u32 slot_stat) | |||
527 | { | 529 | { |
528 | struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->active_tag); | 530 | struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->active_tag); |
529 | struct sil24_port_priv *pp = ap->private_data; | 531 | struct sil24_port_priv *pp = ap->private_data; |
530 | void *port = (void *)ap->ioaddr.cmd_addr; | 532 | void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr; |
531 | u32 irq_stat, cmd_err, sstatus, serror; | 533 | u32 irq_stat, cmd_err, sstatus, serror; |
532 | 534 | ||
533 | irq_stat = readl(port + PORT_IRQ_STAT); | 535 | irq_stat = readl(port + PORT_IRQ_STAT); |
@@ -574,7 +576,7 @@ static void sil24_error_intr(struct ata_port *ap, u32 slot_stat) | |||
574 | static inline void sil24_host_intr(struct ata_port *ap) | 576 | static inline void sil24_host_intr(struct ata_port *ap) |
575 | { | 577 | { |
576 | struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->active_tag); | 578 | struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->active_tag); |
577 | void *port = (void *)ap->ioaddr.cmd_addr; | 579 | void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr; |
578 | u32 slot_stat; | 580 | u32 slot_stat; |
579 | 581 | ||
580 | slot_stat = readl(port + PORT_SLOT_STAT); | 582 | slot_stat = readl(port + PORT_SLOT_STAT); |
@@ -689,7 +691,8 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
689 | struct ata_port_info *pinfo = &sil24_port_info[board_id]; | 691 | struct ata_port_info *pinfo = &sil24_port_info[board_id]; |
690 | struct ata_probe_ent *probe_ent = NULL; | 692 | struct ata_probe_ent *probe_ent = NULL; |
691 | struct sil24_host_priv *hpriv = NULL; | 693 | struct sil24_host_priv *hpriv = NULL; |
692 | void *host_base = NULL, *port_base = NULL; | 694 | void __iomem *host_base = NULL; |
695 | void __iomem *port_base = NULL; | ||
693 | int i, rc; | 696 | int i, rc; |
694 | 697 | ||
695 | if (!printed_version++) | 698 | if (!printed_version++) |
@@ -771,7 +774,7 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
771 | writel(0, host_base + HOST_CTRL); | 774 | writel(0, host_base + HOST_CTRL); |
772 | 775 | ||
773 | for (i = 0; i < probe_ent->n_ports; i++) { | 776 | for (i = 0; i < probe_ent->n_ports; i++) { |
774 | void *port = port_base + i * PORT_REGS_SIZE; | 777 | void __iomem *port = port_base + i * PORT_REGS_SIZE; |
775 | unsigned long portu = (unsigned long)port; | 778 | unsigned long portu = (unsigned long)port; |
776 | u32 tmp; | 779 | u32 tmp; |
777 | int cnt; | 780 | int cnt; |