mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-28 23:24:50 +00:00
ide-pmac: add ->init_dev method (take 4)
v2/3: * Build fixes from Stephen Rothwell. v4: * Fix ->noprobe setting. (From Benjamin Herrenschmidt) Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This commit is contained in:
parent
7b8797acd4
commit
07eb106f3a
1 changed files with 20 additions and 11 deletions
|
@ -941,7 +941,25 @@ static u8 pmac_ide_cable_detect(ide_hwif_t *hwif)
|
|||
return ATA_CBL_PATA40;
|
||||
}
|
||||
|
||||
static void pmac_ide_init_dev(ide_drive_t *drive)
|
||||
{
|
||||
ide_hwif_t *hwif = drive->hwif;
|
||||
pmac_ide_hwif_t *pmif =
|
||||
(pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent);
|
||||
|
||||
if (pmif->mediabay) {
|
||||
#ifdef CONFIG_PMAC_MEDIABAY
|
||||
if (check_media_bay_by_base(pmif->regbase, MB_CD) == 0) {
|
||||
drive->noprobe = 0;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
drive->noprobe = 1;
|
||||
}
|
||||
}
|
||||
|
||||
static const struct ide_port_ops pmac_ide_ata6_port_ops = {
|
||||
.init_dev = pmac_ide_init_dev,
|
||||
.set_pio_mode = pmac_ide_set_pio_mode,
|
||||
.set_dma_mode = pmac_ide_set_dma_mode,
|
||||
.selectproc = pmac_ide_kauai_selectproc,
|
||||
|
@ -949,6 +967,7 @@ static const struct ide_port_ops pmac_ide_ata6_port_ops = {
|
|||
};
|
||||
|
||||
static const struct ide_port_ops pmac_ide_ata4_port_ops = {
|
||||
.init_dev = pmac_ide_init_dev,
|
||||
.set_pio_mode = pmac_ide_set_pio_mode,
|
||||
.set_dma_mode = pmac_ide_set_dma_mode,
|
||||
.selectproc = pmac_ide_selectproc,
|
||||
|
@ -956,6 +975,7 @@ static const struct ide_port_ops pmac_ide_ata4_port_ops = {
|
|||
};
|
||||
|
||||
static const struct ide_port_ops pmac_ide_port_ops = {
|
||||
.init_dev = pmac_ide_init_dev,
|
||||
.set_pio_mode = pmac_ide_set_pio_mode,
|
||||
.set_dma_mode = pmac_ide_set_dma_mode,
|
||||
.selectproc = pmac_ide_selectproc,
|
||||
|
@ -1069,17 +1089,6 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif, hw_regs_t *hw)
|
|||
hwif->index, model_name[pmif->kind], pmif->aapl_bus_id,
|
||||
pmif->mediabay ? " (mediabay)" : "", hwif->irq);
|
||||
|
||||
if (pmif->mediabay) {
|
||||
#ifdef CONFIG_PMAC_MEDIABAY
|
||||
if (check_media_bay_by_base(pmif->regbase, MB_CD)) {
|
||||
#else
|
||||
if (1) {
|
||||
#endif
|
||||
hwif->drives[0].noprobe = 1;
|
||||
hwif->drives[1].noprobe = 1;
|
||||
}
|
||||
}
|
||||
|
||||
idx[0] = hwif->index;
|
||||
|
||||
ide_device_add(idx, &d);
|
||||
|
|
Loading…
Reference in a new issue