diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-17 18:46:29 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-17 18:46:29 -0400 |
commit | 5c58666fae58cd69f862beaeb88d293ad00f6e37 (patch) | |
tree | 5a42cf57ef7d074c5c1b75cd5f916e986aef6edb /drivers/ide/ppc/pmac.c | |
parent | e4f7f3a0994522303c006c84cb651e4caba1158e (diff) |
ppc/pmac: remove ppc_ide_md hooks
* Add pmac_ide_init_ports() helper and use it instead of
pmac_ide_init_hwif_ports().
* Remove ppc_ide_md hooks - no need for them
(IDE pmac host driver takes care of all this setup).
* Then remove no longer needed <linux/ide.h> include
from arch/powerpc/platforms/powermac/pmac.h.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ppc/pmac.c')
-rw-r--r-- | drivers/ide/ppc/pmac.c | 50 |
1 files changed, 11 insertions, 39 deletions
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index 763bc5596c9e..88619b50d9ef 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c | |||
@@ -418,37 +418,6 @@ static void pmac_ide_kauai_selectproc(ide_drive_t *drive); | |||
418 | 418 | ||
419 | #endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ | 419 | #endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ |
420 | 420 | ||
421 | /* | ||
422 | * N.B. this can't be an initfunc, because the media-bay task can | ||
423 | * call ide_[un]register at any time. | ||
424 | */ | ||
425 | void | ||
426 | pmac_ide_init_hwif_ports(hw_regs_t *hw, | ||
427 | unsigned long data_port, unsigned long ctrl_port, | ||
428 | int *irq) | ||
429 | { | ||
430 | int i, ix; | ||
431 | |||
432 | if (data_port == 0) | ||
433 | return; | ||
434 | |||
435 | for (ix = 0; ix < MAX_HWIFS; ++ix) | ||
436 | if (data_port == pmac_ide[ix].regbase) | ||
437 | break; | ||
438 | |||
439 | if (ix >= MAX_HWIFS) | ||
440 | return; /* not an IDE PMAC interface */ | ||
441 | |||
442 | for (i = 0; i < 8; ++i) | ||
443 | hw->io_ports[i] = data_port + i * 0x10; | ||
444 | hw->io_ports[8] = data_port + 0x160; | ||
445 | |||
446 | if (irq != NULL) | ||
447 | *irq = pmac_ide[ix].irq; | ||
448 | |||
449 | hw->dev = &pmac_ide[ix].mdev->ofdev.dev; | ||
450 | } | ||
451 | |||
452 | #define PMAC_IDE_REG(x) \ | 421 | #define PMAC_IDE_REG(x) \ |
453 | ((void __iomem *)((drive)->hwif->io_ports[IDE_DATA_OFFSET] + (x))) | 422 | ((void __iomem *)((drive)->hwif->io_ports[IDE_DATA_OFFSET] + (x))) |
454 | 423 | ||
@@ -886,12 +855,6 @@ sanitize_timings(pmac_ide_hwif_t *pmif) | |||
886 | pmif->timings[2] = pmif->timings[3] = value2; | 855 | pmif->timings[2] = pmif->timings[3] = value2; |
887 | } | 856 | } |
888 | 857 | ||
889 | unsigned long | ||
890 | pmac_ide_get_base(int index) | ||
891 | { | ||
892 | return pmac_ide[index].regbase; | ||
893 | } | ||
894 | |||
895 | /* Suspend call back, should be called after the child devices | 858 | /* Suspend call back, should be called after the child devices |
896 | * have actually been suspended | 859 | * have actually been suspended |
897 | */ | 860 | */ |
@@ -1108,6 +1071,15 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif, hw_regs_t *hw) | |||
1108 | return 0; | 1071 | return 0; |
1109 | } | 1072 | } |
1110 | 1073 | ||
1074 | static void __devinit pmac_ide_init_ports(hw_regs_t *hw, unsigned long base) | ||
1075 | { | ||
1076 | int i; | ||
1077 | |||
1078 | for (i = 0; i < 8; ++i) | ||
1079 | hw->io_ports[i] = base + i * 0x10; | ||
1080 | hw->io_ports[8] = base + 0x160; | ||
1081 | } | ||
1082 | |||
1111 | /* | 1083 | /* |
1112 | * Attach to a macio probed interface | 1084 | * Attach to a macio probed interface |
1113 | */ | 1085 | */ |
@@ -1181,7 +1153,7 @@ pmac_ide_macio_attach(struct macio_dev *mdev, const struct of_device_id *match) | |||
1181 | dev_set_drvdata(&mdev->ofdev.dev, hwif); | 1153 | dev_set_drvdata(&mdev->ofdev.dev, hwif); |
1182 | 1154 | ||
1183 | memset(&hw, 0, sizeof(hw)); | 1155 | memset(&hw, 0, sizeof(hw)); |
1184 | pmac_ide_init_hwif_ports(&hw, pmif->regbase, 0, NULL); | 1156 | pmac_ide_init_ports(&hw, pmif->regbase); |
1185 | hw.irq = irq; | 1157 | hw.irq = irq; |
1186 | hw.dev = &mdev->ofdev.dev; | 1158 | hw.dev = &mdev->ofdev.dev; |
1187 | 1159 | ||
@@ -1295,7 +1267,7 @@ pmac_ide_pci_attach(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1295 | pci_set_drvdata(pdev, hwif); | 1267 | pci_set_drvdata(pdev, hwif); |
1296 | 1268 | ||
1297 | memset(&hw, 0, sizeof(hw)); | 1269 | memset(&hw, 0, sizeof(hw)); |
1298 | pmac_ide_init_hwif_ports(&hw, pmif->regbase, 0, NULL); | 1270 | pmac_ide_init_ports(&hw, pmif->regbase); |
1299 | hw.irq = pdev->irq; | 1271 | hw.irq = pdev->irq; |
1300 | hw.dev = &pdev->dev; | 1272 | hw.dev = &pdev->dev; |
1301 | 1273 | ||