diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-09-09 01:41:14 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-11-14 18:21:25 -0500 |
commit | 58e48be72d675b53e57982fc5301ec1b2dbda280 (patch) | |
tree | 50ae3251aeae7d16ff6de353fe68496c469d7f74 /drivers/ide/pmac.c | |
parent | 4fbf888accb39af423f271111d44e8186f053723 (diff) |
ide: pmac: Remove casting the return value which is a void pointer
Casting the return value which is a void pointer is redundant.
The conversion from void pointer to any other pointer type is
guaranteed by the C programming language.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/ide/pmac.c')
-rw-r--r-- | drivers/ide/pmac.c | 51 |
1 files changed, 17 insertions, 34 deletions
diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c index bf83d7bb6bc6..3dd130627726 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) { |
@@ -1365,8 +1356,7 @@ pmac_ide_pci_resume(struct pci_dev *pdev) | |||
1365 | #ifdef CONFIG_PMAC_MEDIABAY | 1356 | #ifdef CONFIG_PMAC_MEDIABAY |
1366 | static void pmac_ide_macio_mb_event(struct macio_dev* mdev, int mb_state) | 1357 | static void pmac_ide_macio_mb_event(struct macio_dev* mdev, int mb_state) |
1367 | { | 1358 | { |
1368 | pmac_ide_hwif_t *pmif = | 1359 | pmac_ide_hwif_t *pmif = dev_get_drvdata(&mdev->ofdev.dev); |
1369 | (pmac_ide_hwif_t *)dev_get_drvdata(&mdev->ofdev.dev); | ||
1370 | 1360 | ||
1371 | switch(mb_state) { | 1361 | switch(mb_state) { |
1372 | case MB_CD: | 1362 | case MB_CD: |
@@ -1468,8 +1458,7 @@ out: | |||
1468 | static int pmac_ide_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd) | 1458 | static int pmac_ide_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd) |
1469 | { | 1459 | { |
1470 | ide_hwif_t *hwif = drive->hwif; | 1460 | ide_hwif_t *hwif = drive->hwif; |
1471 | pmac_ide_hwif_t *pmif = | 1461 | 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; | 1462 | struct dbdma_cmd *table; |
1474 | volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; | 1463 | volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; |
1475 | struct scatterlist *sg; | 1464 | struct scatterlist *sg; |
@@ -1546,8 +1535,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) | 1535 | static int pmac_ide_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd) |
1547 | { | 1536 | { |
1548 | ide_hwif_t *hwif = drive->hwif; | 1537 | ide_hwif_t *hwif = drive->hwif; |
1549 | pmac_ide_hwif_t *pmif = | 1538 | 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); | 1539 | u8 unit = drive->dn & 1, ata4 = (pmif->kind == controller_kl_ata4); |
1552 | u8 write = !!(cmd->tf_flags & IDE_TFLAG_WRITE); | 1540 | u8 write = !!(cmd->tf_flags & IDE_TFLAG_WRITE); |
1553 | 1541 | ||
@@ -1572,8 +1560,7 @@ static void | |||
1572 | pmac_ide_dma_start(ide_drive_t *drive) | 1560 | pmac_ide_dma_start(ide_drive_t *drive) |
1573 | { | 1561 | { |
1574 | ide_hwif_t *hwif = drive->hwif; | 1562 | ide_hwif_t *hwif = drive->hwif; |
1575 | pmac_ide_hwif_t *pmif = | 1563 | 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; | 1564 | volatile struct dbdma_regs __iomem *dma; |
1578 | 1565 | ||
1579 | dma = pmif->dma_regs; | 1566 | dma = pmif->dma_regs; |
@@ -1590,8 +1577,7 @@ static int | |||
1590 | pmac_ide_dma_end (ide_drive_t *drive) | 1577 | pmac_ide_dma_end (ide_drive_t *drive) |
1591 | { | 1578 | { |
1592 | ide_hwif_t *hwif = drive->hwif; | 1579 | ide_hwif_t *hwif = drive->hwif; |
1593 | pmac_ide_hwif_t *pmif = | 1580 | 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; | 1581 | volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; |
1596 | u32 dstat; | 1582 | u32 dstat; |
1597 | 1583 | ||
@@ -1615,8 +1601,7 @@ static int | |||
1615 | pmac_ide_dma_test_irq (ide_drive_t *drive) | 1601 | pmac_ide_dma_test_irq (ide_drive_t *drive) |
1616 | { | 1602 | { |
1617 | ide_hwif_t *hwif = drive->hwif; | 1603 | ide_hwif_t *hwif = drive->hwif; |
1618 | pmac_ide_hwif_t *pmif = | 1604 | 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; | 1605 | volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; |
1621 | unsigned long status, timeout; | 1606 | unsigned long status, timeout; |
1622 | 1607 | ||
@@ -1670,8 +1655,7 @@ static void | |||
1670 | pmac_ide_dma_lost_irq (ide_drive_t *drive) | 1655 | pmac_ide_dma_lost_irq (ide_drive_t *drive) |
1671 | { | 1656 | { |
1672 | ide_hwif_t *hwif = drive->hwif; | 1657 | ide_hwif_t *hwif = drive->hwif; |
1673 | pmac_ide_hwif_t *pmif = | 1658 | 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; | 1659 | volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; |
1676 | unsigned long status = readl(&dma->status); | 1660 | unsigned long status = readl(&dma->status); |
1677 | 1661 | ||
@@ -1693,8 +1677,7 @@ static const struct ide_dma_ops pmac_dma_ops = { | |||
1693 | */ | 1677 | */ |
1694 | static int pmac_ide_init_dma(ide_hwif_t *hwif, const struct ide_port_info *d) | 1678 | static int pmac_ide_init_dma(ide_hwif_t *hwif, const struct ide_port_info *d) |
1695 | { | 1679 | { |
1696 | pmac_ide_hwif_t *pmif = | 1680 | 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); | 1681 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
1699 | 1682 | ||
1700 | /* We won't need pci_dev if we switch to generic consistent | 1683 | /* We won't need pci_dev if we switch to generic consistent |