diff options
-rw-r--r-- | drivers/ide/cs5536.c | 13 | ||||
-rw-r--r-- | drivers/ide/pmac.c | 52 |
2 files changed, 18 insertions, 47 deletions
diff --git a/drivers/ide/cs5536.c b/drivers/ide/cs5536.c index 24214ab60ac0..de9185db41d4 100644 --- a/drivers/ide/cs5536.c +++ b/drivers/ide/cs5536.c | |||
@@ -295,15 +295,7 @@ static struct pci_driver cs5536_pci_driver = { | |||
295 | .resume = ide_pci_resume, | 295 | .resume = ide_pci_resume, |
296 | }; | 296 | }; |
297 | 297 | ||
298 | static int __init cs5536_init(void) | 298 | module_pci_driver(cs5536_pci_driver); |
299 | { | ||
300 | return pci_register_driver(&cs5536_pci_driver); | ||
301 | } | ||
302 | |||
303 | static void __exit cs5536_exit(void) | ||
304 | { | ||
305 | pci_unregister_driver(&cs5536_pci_driver); | ||
306 | } | ||
307 | 299 | ||
308 | MODULE_AUTHOR("Martin K. Petersen, Bartlomiej Zolnierkiewicz"); | 300 | MODULE_AUTHOR("Martin K. Petersen, Bartlomiej Zolnierkiewicz"); |
309 | MODULE_DESCRIPTION("low-level driver for the CS5536 IDE controller"); | 301 | MODULE_DESCRIPTION("low-level driver for the CS5536 IDE controller"); |
@@ -312,6 +304,3 @@ MODULE_DEVICE_TABLE(pci, cs5536_pci_tbl); | |||
312 | 304 | ||
313 | module_param_named(msr, use_msr, int, 0644); | 305 | module_param_named(msr, use_msr, int, 0644); |
314 | MODULE_PARM_DESC(msr, "Force using MSR to configure IDE function (Default: 0)"); | 306 | MODULE_PARM_DESC(msr, "Force using MSR to configure IDE function (Default: 0)"); |
315 | |||
316 | module_init(cs5536_init); | ||
317 | module_exit(cs5536_exit); | ||
diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c index bf83d7bb6bc6..2db803cd095c 100644 --- a/drivers/ide/pmac.c +++ b/drivers/ide/pmac.c | |||
@@ -416,8 +416,7 @@ static int pmac_ide_init_dma(ide_hwif_t *, const struct ide_port_info *); | |||
416 | static void pmac_ide_apply_timings(ide_drive_t *drive) | 416 | static void pmac_ide_apply_timings(ide_drive_t *drive) |
417 | { | 417 | { |
418 | ide_hwif_t *hwif = drive->hwif; | 418 | ide_hwif_t *hwif = drive->hwif; |
419 | pmac_ide_hwif_t *pmif = | 419 | pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); |
420 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); | ||
421 | 420 | ||
422 | if (drive->dn & 1) | 421 | if (drive->dn & 1) |
423 | writel(pmif->timings[1], PMAC_IDE_REG(IDE_TIMING_CONFIG)); | 422 | writel(pmif->timings[1], PMAC_IDE_REG(IDE_TIMING_CONFIG)); |
@@ -434,8 +433,7 @@ static void pmac_ide_apply_timings(ide_drive_t *drive) | |||
434 | static void pmac_ide_kauai_apply_timings(ide_drive_t *drive) | 433 | static void pmac_ide_kauai_apply_timings(ide_drive_t *drive) |
435 | { | 434 | { |
436 | ide_hwif_t *hwif = drive->hwif; | 435 | ide_hwif_t *hwif = drive->hwif; |
437 | pmac_ide_hwif_t *pmif = | 436 | pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); |
438 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); | ||
439 | 437 | ||
440 | if (drive->dn & 1) { | 438 | if (drive->dn & 1) { |
441 | writel(pmif->timings[1], PMAC_IDE_REG(IDE_KAUAI_PIO_CONFIG)); | 439 | writel(pmif->timings[1], PMAC_IDE_REG(IDE_KAUAI_PIO_CONFIG)); |
@@ -454,8 +452,7 @@ static void | |||
454 | pmac_ide_do_update_timings(ide_drive_t *drive) | 452 | pmac_ide_do_update_timings(ide_drive_t *drive) |
455 | { | 453 | { |
456 | ide_hwif_t *hwif = drive->hwif; | 454 | ide_hwif_t *hwif = drive->hwif; |
457 | pmac_ide_hwif_t *pmif = | 455 | pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); |
458 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); | ||
459 | 456 | ||
460 | if (pmif->kind == controller_sh_ata6 || | 457 | if (pmif->kind == controller_sh_ata6 || |
461 | pmif->kind == controller_un_ata6 || | 458 | pmif->kind == controller_un_ata6 || |
@@ -500,8 +497,7 @@ static void pmac_write_devctl(ide_hwif_t *hwif, u8 ctl) | |||
500 | */ | 497 | */ |
501 | static void pmac_ide_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive) | 498 | static void pmac_ide_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive) |
502 | { | 499 | { |
503 | pmac_ide_hwif_t *pmif = | 500 | pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); |
504 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); | ||
505 | const u8 pio = drive->pio_mode - XFER_PIO_0; | 501 | const u8 pio = drive->pio_mode - XFER_PIO_0; |
506 | struct ide_timing *tim = ide_timing_find_mode(XFER_PIO_0 + pio); | 502 | struct ide_timing *tim = ide_timing_find_mode(XFER_PIO_0 + pio); |
507 | u32 *timings, t; | 503 | u32 *timings, t; |
@@ -781,8 +777,7 @@ set_timings_mdma(ide_drive_t *drive, int intf_type, u32 *timings, u32 *timings2, | |||
781 | 777 | ||
782 | static void pmac_ide_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive) | 778 | static void pmac_ide_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive) |
783 | { | 779 | { |
784 | pmac_ide_hwif_t *pmif = | 780 | pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); |
785 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); | ||
786 | int ret = 0; | 781 | int ret = 0; |
787 | u32 *timings, *timings2, tl[2]; | 782 | u32 *timings, *timings2, tl[2]; |
788 | u8 unit = drive->dn & 1; | 783 | u8 unit = drive->dn & 1; |
@@ -919,8 +914,7 @@ static int pmac_ide_do_resume(pmac_ide_hwif_t *pmif) | |||
919 | 914 | ||
920 | static u8 pmac_ide_cable_detect(ide_hwif_t *hwif) | 915 | static u8 pmac_ide_cable_detect(ide_hwif_t *hwif) |
921 | { | 916 | { |
922 | pmac_ide_hwif_t *pmif = | 917 | pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); |
923 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); | ||
924 | struct device_node *np = pmif->node; | 918 | struct device_node *np = pmif->node; |
925 | const char *cable = of_get_property(np, "cable-type", NULL); | 919 | const char *cable = of_get_property(np, "cable-type", NULL); |
926 | struct device_node *root = of_find_node_by_path("/"); | 920 | struct device_node *root = of_find_node_by_path("/"); |
@@ -951,8 +945,7 @@ static u8 pmac_ide_cable_detect(ide_hwif_t *hwif) | |||
951 | static void pmac_ide_init_dev(ide_drive_t *drive) | 945 | static void pmac_ide_init_dev(ide_drive_t *drive) |
952 | { | 946 | { |
953 | ide_hwif_t *hwif = drive->hwif; | 947 | ide_hwif_t *hwif = drive->hwif; |
954 | pmac_ide_hwif_t *pmif = | 948 | pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); |
955 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); | ||
956 | 949 | ||
957 | if (on_media_bay(pmif)) { | 950 | if (on_media_bay(pmif)) { |
958 | if (check_media_bay(pmif->mdev->media_bay) == MB_CD) { | 951 | if (check_media_bay(pmif->mdev->media_bay) == MB_CD) { |
@@ -1228,8 +1221,7 @@ out_free_pmif: | |||
1228 | static int | 1221 | static int |
1229 | pmac_ide_macio_suspend(struct macio_dev *mdev, pm_message_t mesg) | 1222 | pmac_ide_macio_suspend(struct macio_dev *mdev, pm_message_t mesg) |
1230 | { | 1223 | { |
1231 | pmac_ide_hwif_t *pmif = | 1224 | pmac_ide_hwif_t *pmif = dev_get_drvdata(&mdev->ofdev.dev); |
1232 | (pmac_ide_hwif_t *)dev_get_drvdata(&mdev->ofdev.dev); | ||
1233 | int rc = 0; | 1225 | int rc = 0; |
1234 | 1226 | ||
1235 | if (mesg.event != mdev->ofdev.dev.power.power_state.event | 1227 | if (mesg.event != mdev->ofdev.dev.power.power_state.event |
@@ -1245,8 +1237,7 @@ pmac_ide_macio_suspend(struct macio_dev *mdev, pm_message_t mesg) | |||
1245 | static int | 1237 | static int |
1246 | pmac_ide_macio_resume(struct macio_dev *mdev) | 1238 | pmac_ide_macio_resume(struct macio_dev *mdev) |
1247 | { | 1239 | { |
1248 | pmac_ide_hwif_t *pmif = | 1240 | pmac_ide_hwif_t *pmif = dev_get_drvdata(&mdev->ofdev.dev); |
1249 | (pmac_ide_hwif_t *)dev_get_drvdata(&mdev->ofdev.dev); | ||
1250 | int rc = 0; | 1241 | int rc = 0; |
1251 | 1242 | ||
1252 | if (mdev->ofdev.dev.power.power_state.event != PM_EVENT_ON) { | 1243 | if (mdev->ofdev.dev.power.power_state.event != PM_EVENT_ON) { |
@@ -1318,7 +1309,6 @@ static int pmac_ide_pci_attach(struct pci_dev *pdev, | |||
1318 | rc = pmac_ide_setup_device(pmif, &hw); | 1309 | rc = pmac_ide_setup_device(pmif, &hw); |
1319 | if (rc != 0) { | 1310 | if (rc != 0) { |
1320 | /* The inteface is released to the common IDE layer */ | 1311 | /* The inteface is released to the common IDE layer */ |
1321 | pci_set_drvdata(pdev, NULL); | ||
1322 | iounmap(base); | 1312 | iounmap(base); |
1323 | pci_release_regions(pdev); | 1313 | pci_release_regions(pdev); |
1324 | kfree(pmif); | 1314 | kfree(pmif); |
@@ -1365,8 +1355,7 @@ pmac_ide_pci_resume(struct pci_dev *pdev) | |||
1365 | #ifdef CONFIG_PMAC_MEDIABAY | 1355 | #ifdef CONFIG_PMAC_MEDIABAY |
1366 | static void pmac_ide_macio_mb_event(struct macio_dev* mdev, int mb_state) | 1356 | static void pmac_ide_macio_mb_event(struct macio_dev* mdev, int mb_state) |
1367 | { | 1357 | { |
1368 | pmac_ide_hwif_t *pmif = | 1358 | pmac_ide_hwif_t *pmif = dev_get_drvdata(&mdev->ofdev.dev); |
1369 | (pmac_ide_hwif_t *)dev_get_drvdata(&mdev->ofdev.dev); | ||
1370 | 1359 | ||
1371 | switch(mb_state) { | 1360 | switch(mb_state) { |
1372 | case MB_CD: | 1361 | case MB_CD: |
@@ -1468,8 +1457,7 @@ out: | |||
1468 | static int pmac_ide_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd) | 1457 | static int pmac_ide_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd) |
1469 | { | 1458 | { |
1470 | ide_hwif_t *hwif = drive->hwif; | 1459 | ide_hwif_t *hwif = drive->hwif; |
1471 | pmac_ide_hwif_t *pmif = | 1460 | pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); |
1472 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); | ||
1473 | struct dbdma_cmd *table; | 1461 | struct dbdma_cmd *table; |
1474 | volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; | 1462 | volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; |
1475 | struct scatterlist *sg; | 1463 | struct scatterlist *sg; |
@@ -1546,8 +1534,7 @@ static int pmac_ide_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd) | |||
1546 | static int pmac_ide_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd) | 1534 | static int pmac_ide_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd) |
1547 | { | 1535 | { |
1548 | ide_hwif_t *hwif = drive->hwif; | 1536 | ide_hwif_t *hwif = drive->hwif; |
1549 | pmac_ide_hwif_t *pmif = | 1537 | pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); |
1550 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); | ||
1551 | u8 unit = drive->dn & 1, ata4 = (pmif->kind == controller_kl_ata4); | 1538 | u8 unit = drive->dn & 1, ata4 = (pmif->kind == controller_kl_ata4); |
1552 | u8 write = !!(cmd->tf_flags & IDE_TFLAG_WRITE); | 1539 | u8 write = !!(cmd->tf_flags & IDE_TFLAG_WRITE); |
1553 | 1540 | ||
@@ -1572,8 +1559,7 @@ static void | |||
1572 | pmac_ide_dma_start(ide_drive_t *drive) | 1559 | pmac_ide_dma_start(ide_drive_t *drive) |
1573 | { | 1560 | { |
1574 | ide_hwif_t *hwif = drive->hwif; | 1561 | ide_hwif_t *hwif = drive->hwif; |
1575 | pmac_ide_hwif_t *pmif = | 1562 | pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); |
1576 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); | ||
1577 | volatile struct dbdma_regs __iomem *dma; | 1563 | volatile struct dbdma_regs __iomem *dma; |
1578 | 1564 | ||
1579 | dma = pmif->dma_regs; | 1565 | dma = pmif->dma_regs; |
@@ -1590,8 +1576,7 @@ static int | |||
1590 | pmac_ide_dma_end (ide_drive_t *drive) | 1576 | pmac_ide_dma_end (ide_drive_t *drive) |
1591 | { | 1577 | { |
1592 | ide_hwif_t *hwif = drive->hwif; | 1578 | ide_hwif_t *hwif = drive->hwif; |
1593 | pmac_ide_hwif_t *pmif = | 1579 | pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); |
1594 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); | ||
1595 | volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; | 1580 | volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; |
1596 | u32 dstat; | 1581 | u32 dstat; |
1597 | 1582 | ||
@@ -1615,8 +1600,7 @@ static int | |||
1615 | pmac_ide_dma_test_irq (ide_drive_t *drive) | 1600 | pmac_ide_dma_test_irq (ide_drive_t *drive) |
1616 | { | 1601 | { |
1617 | ide_hwif_t *hwif = drive->hwif; | 1602 | ide_hwif_t *hwif = drive->hwif; |
1618 | pmac_ide_hwif_t *pmif = | 1603 | pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); |
1619 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); | ||
1620 | volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; | 1604 | volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; |
1621 | unsigned long status, timeout; | 1605 | unsigned long status, timeout; |
1622 | 1606 | ||
@@ -1670,8 +1654,7 @@ static void | |||
1670 | pmac_ide_dma_lost_irq (ide_drive_t *drive) | 1654 | pmac_ide_dma_lost_irq (ide_drive_t *drive) |
1671 | { | 1655 | { |
1672 | ide_hwif_t *hwif = drive->hwif; | 1656 | ide_hwif_t *hwif = drive->hwif; |
1673 | pmac_ide_hwif_t *pmif = | 1657 | pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); |
1674 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); | ||
1675 | volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; | 1658 | volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; |
1676 | unsigned long status = readl(&dma->status); | 1659 | unsigned long status = readl(&dma->status); |
1677 | 1660 | ||
@@ -1693,8 +1676,7 @@ static const struct ide_dma_ops pmac_dma_ops = { | |||
1693 | */ | 1676 | */ |
1694 | static int pmac_ide_init_dma(ide_hwif_t *hwif, const struct ide_port_info *d) | 1677 | static int pmac_ide_init_dma(ide_hwif_t *hwif, const struct ide_port_info *d) |
1695 | { | 1678 | { |
1696 | pmac_ide_hwif_t *pmif = | 1679 | pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); |
1697 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); | ||
1698 | struct pci_dev *dev = to_pci_dev(hwif->dev); | 1680 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
1699 | 1681 | ||
1700 | /* We won't need pci_dev if we switch to generic consistent | 1682 | /* We won't need pci_dev if we switch to generic consistent |