summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/chipsets/ata-jmicron.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ata/chipsets/ata-jmicron.c')
-rw-r--r--sys/dev/ata/chipsets/ata-jmicron.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/dev/ata/chipsets/ata-jmicron.c b/sys/dev/ata/chipsets/ata-jmicron.c
index 32a9b57..30e334f 100644
--- a/sys/dev/ata/chipsets/ata-jmicron.c
+++ b/sys/dev/ata/chipsets/ata-jmicron.c
@@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$");
/* local prototypes */
static int ata_jmicron_chipinit(device_t dev);
-static int ata_jmicron_allocate(device_t dev);
+static int ata_jmicron_ch_attach(device_t dev);
static void ata_jmicron_reset(device_t dev);
static void ata_jmicron_dmainit(device_t dev);
static void ata_jmicron_setmode(device_t dev, int mode);
@@ -112,9 +112,8 @@ ata_jmicron_chipinit(device_t dev)
return 0;
/* otherwise we are on the PATA part */
- ctlr->allocate = ata_pci_allocate;
+ ctlr->ch_attach = ata_pci_ch_attach;
ctlr->reset = ata_generic_reset;
- ctlr->dmainit = ata_pci_dmainit;
ctlr->setmode = ata_jmicron_setmode;
ctlr->channels = ctlr->chip->cfg2;
}
@@ -126,9 +125,8 @@ ata_jmicron_chipinit(device_t dev)
if (ctlr->chip->cfg1 && (error = ata_ahci_chipinit(dev)))
return error;
- ctlr->allocate = ata_jmicron_allocate;
+ ctlr->ch_attach = ata_jmicron_ch_attach;
ctlr->reset = ata_jmicron_reset;
- ctlr->dmainit = ata_jmicron_dmainit;
ctlr->setmode = ata_jmicron_setmode;
/* set the number of HW channels */
@@ -138,19 +136,21 @@ ata_jmicron_chipinit(device_t dev)
}
static int
-ata_jmicron_allocate(device_t dev)
+ata_jmicron_ch_attach(device_t dev)
{
struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
struct ata_channel *ch = device_get_softc(dev);
int error;
+ ata_jmicron_dmainit(dev);
+
if (ch->unit >= ctlr->chip->cfg1) {
ch->unit -= ctlr->chip->cfg1;
- error = ata_pci_allocate(dev);
+ error = ata_pci_ch_attach(dev);
ch->unit += ctlr->chip->cfg1;
}
else
- error = ata_ahci_allocate(dev);
+ error = ata_ahci_ch_attach(dev);
return error;
}
OpenPOWER on IntegriCloud