diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-13 15:39:45 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-13 15:39:45 -0400 |
commit | 9055ba3ee2dba801e8e6bddec9003ad8bca153ab (patch) | |
tree | 91f6fd62dcf26e922c88f6521a4d229092763909 /drivers/ide/ppc/pmac.c | |
parent | e415e495f8294e536e09e6a15fba897cce4c0748 (diff) |
pmac: remove superfluous pmif == NULL checks
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 | 39 |
1 files changed, 5 insertions, 34 deletions
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index 5b083700d882..7f2ce6195d1e 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c | |||
@@ -430,9 +430,6 @@ pmac_ide_selectproc(ide_drive_t *drive) | |||
430 | pmac_ide_hwif_t *pmif = | 430 | pmac_ide_hwif_t *pmif = |
431 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); | 431 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); |
432 | 432 | ||
433 | if (pmif == NULL) | ||
434 | return; | ||
435 | |||
436 | if (drive->dn & 1) | 433 | if (drive->dn & 1) |
437 | writel(pmif->timings[1], PMAC_IDE_REG(IDE_TIMING_CONFIG)); | 434 | writel(pmif->timings[1], PMAC_IDE_REG(IDE_TIMING_CONFIG)); |
438 | else | 435 | else |
@@ -452,9 +449,6 @@ pmac_ide_kauai_selectproc(ide_drive_t *drive) | |||
452 | pmac_ide_hwif_t *pmif = | 449 | pmac_ide_hwif_t *pmif = |
453 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); | 450 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); |
454 | 451 | ||
455 | if (pmif == NULL) | ||
456 | return; | ||
457 | |||
458 | if (drive->dn & 1) { | 452 | if (drive->dn & 1) { |
459 | writel(pmif->timings[1], PMAC_IDE_REG(IDE_KAUAI_PIO_CONFIG)); | 453 | writel(pmif->timings[1], PMAC_IDE_REG(IDE_KAUAI_PIO_CONFIG)); |
460 | writel(pmif->timings[3], PMAC_IDE_REG(IDE_KAUAI_ULTRA_CONFIG)); | 454 | writel(pmif->timings[3], PMAC_IDE_REG(IDE_KAUAI_ULTRA_CONFIG)); |
@@ -475,9 +469,6 @@ pmac_ide_do_update_timings(ide_drive_t *drive) | |||
475 | pmac_ide_hwif_t *pmif = | 469 | pmac_ide_hwif_t *pmif = |
476 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); | 470 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); |
477 | 471 | ||
478 | if (pmif == NULL) | ||
479 | return; | ||
480 | |||
481 | if (pmif->kind == controller_sh_ata6 || | 472 | if (pmif->kind == controller_sh_ata6 || |
482 | pmif->kind == controller_un_ata6 || | 473 | pmif->kind == controller_un_ata6 || |
483 | pmif->kind == controller_k2_ata6) | 474 | pmif->kind == controller_k2_ata6) |
@@ -524,9 +515,6 @@ pmac_ide_set_pio_mode(ide_drive_t *drive, const u8 pio) | |||
524 | unsigned accessTime, recTime; | 515 | unsigned accessTime, recTime; |
525 | unsigned int cycle_time; | 516 | unsigned int cycle_time; |
526 | 517 | ||
527 | if (pmif == NULL) | ||
528 | return; | ||
529 | |||
530 | /* which drive is it ? */ | 518 | /* which drive is it ? */ |
531 | timings = &pmif->timings[drive->dn & 1]; | 519 | timings = &pmif->timings[drive->dn & 1]; |
532 | t = *timings; | 520 | t = *timings; |
@@ -1558,11 +1546,7 @@ pmac_ide_dma_setup(ide_drive_t *drive) | |||
1558 | pmac_ide_hwif_t *pmif = | 1546 | pmac_ide_hwif_t *pmif = |
1559 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); | 1547 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); |
1560 | struct request *rq = HWGROUP(drive)->rq; | 1548 | struct request *rq = HWGROUP(drive)->rq; |
1561 | u8 unit = drive->dn & 1, ata4; | 1549 | u8 unit = drive->dn & 1, ata4 = (pmif->kind == controller_kl_ata4); |
1562 | |||
1563 | if (pmif == NULL) | ||
1564 | return 1; | ||
1565 | ata4 = (pmif->kind == controller_kl_ata4); | ||
1566 | 1550 | ||
1567 | if (!pmac_ide_build_dmatable(drive, rq)) { | 1551 | if (!pmac_ide_build_dmatable(drive, rq)) { |
1568 | ide_map_sg(drive, rq); | 1552 | ide_map_sg(drive, rq); |
@@ -1616,12 +1600,8 @@ pmac_ide_dma_end (ide_drive_t *drive) | |||
1616 | ide_hwif_t *hwif = drive->hwif; | 1600 | ide_hwif_t *hwif = drive->hwif; |
1617 | pmac_ide_hwif_t *pmif = | 1601 | pmac_ide_hwif_t *pmif = |
1618 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); | 1602 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); |
1619 | volatile struct dbdma_regs __iomem *dma; | 1603 | volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; |
1620 | u32 dstat; | 1604 | u32 dstat; |
1621 | |||
1622 | if (pmif == NULL) | ||
1623 | return 0; | ||
1624 | dma = pmif->dma_regs; | ||
1625 | 1605 | ||
1626 | drive->waiting_for_dma = 0; | 1606 | drive->waiting_for_dma = 0; |
1627 | dstat = readl(&dma->status); | 1607 | dstat = readl(&dma->status); |
@@ -1646,13 +1626,9 @@ pmac_ide_dma_test_irq (ide_drive_t *drive) | |||
1646 | ide_hwif_t *hwif = drive->hwif; | 1626 | ide_hwif_t *hwif = drive->hwif; |
1647 | pmac_ide_hwif_t *pmif = | 1627 | pmac_ide_hwif_t *pmif = |
1648 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); | 1628 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); |
1649 | volatile struct dbdma_regs __iomem *dma; | 1629 | volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; |
1650 | unsigned long status, timeout; | 1630 | unsigned long status, timeout; |
1651 | 1631 | ||
1652 | if (pmif == NULL) | ||
1653 | return 0; | ||
1654 | dma = pmif->dma_regs; | ||
1655 | |||
1656 | /* We have to things to deal with here: | 1632 | /* We have to things to deal with here: |
1657 | * | 1633 | * |
1658 | * - The dbdma won't stop if the command was started | 1634 | * - The dbdma won't stop if the command was started |
@@ -1705,14 +1681,9 @@ pmac_ide_dma_lost_irq (ide_drive_t *drive) | |||
1705 | ide_hwif_t *hwif = drive->hwif; | 1681 | ide_hwif_t *hwif = drive->hwif; |
1706 | pmac_ide_hwif_t *pmif = | 1682 | pmac_ide_hwif_t *pmif = |
1707 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); | 1683 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); |
1708 | volatile struct dbdma_regs __iomem *dma; | 1684 | volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; |
1709 | unsigned long status; | 1685 | unsigned long status = readl(&dma->status); |
1710 | |||
1711 | if (pmif == NULL) | ||
1712 | return; | ||
1713 | dma = pmif->dma_regs; | ||
1714 | 1686 | ||
1715 | status = readl(&dma->status); | ||
1716 | printk(KERN_ERR "ide-pmac lost interrupt, dma status: %lx\n", status); | 1687 | printk(KERN_ERR "ide-pmac lost interrupt, dma status: %lx\n", status); |
1717 | } | 1688 | } |
1718 | 1689 | ||