summaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-pnp.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-23 19:55:57 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-23 19:55:57 +0200
commit48c3c1072651922ed153bcf0a33ea82cf20df390 (patch)
tree92ad23e3869e70731eca99394c08a3bf06b8753e /drivers/ide/ide-pnp.c
parentide: add struct ide_tp_ops (take 2) (diff)
downloadlinux-48c3c1072651922ed153bcf0a33ea82cf20df390.tar.xz
linux-48c3c1072651922ed153bcf0a33ea82cf20df390.zip
ide: add struct ide_host (take 3)
* Add struct ide_host which keeps pointers to host's ports. * Add ide_host_alloc[_all]() and ide_host_remove() helpers. * Pass 'struct ide_host *host' instead of 'u8 *idx' to ide_device_add[_all]() and rename it to ide_host_register[_all](). * Convert host drivers and core code to use struct ide_host. * Remove no longer needed ide_find_port(). * Make ide_find_port_slot() static. * Unexport ide_unregister(). v2: * Add missing 'struct ide_host *host' to macide.c. v3: * Fix build problem in pmac.c (s/ide_alloc_host/ide_host_alloc/) (Noticed by Stephen Rothwell). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-pnp.c')
-rw-r--r--drivers/ide/ide-pnp.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/ide/ide-pnp.c b/drivers/ide/ide-pnp.c
index 89cd5cbe8573..4458ca61897a 100644
--- a/drivers/ide/ide-pnp.c
+++ b/drivers/ide/ide-pnp.c
@@ -29,7 +29,7 @@ static struct pnp_device_id idepnp_devices[] = {
static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
{
- ide_hwif_t *hwif;
+ struct ide_host *host;
unsigned long base, ctl;
hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
@@ -59,14 +59,11 @@ static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
hw.irq = pnp_irq(dev, 0);
hw.chipset = ide_generic;
- hwif = ide_find_port();
- if (hwif) {
- u8 index = hwif->index;
- u8 idx[4] = { index, 0xff, 0xff, 0xff };
+ host = ide_host_alloc(NULL, hws);
+ if (host) {
+ pnp_set_drvdata(dev, host);
- pnp_set_drvdata(dev, hwif);
-
- ide_device_add(idx, NULL, hws);
+ ide_host_register(host, NULL, hws);
return 0;
}
@@ -79,9 +76,9 @@ static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
static void idepnp_remove(struct pnp_dev *dev)
{
- ide_hwif_t *hwif = pnp_get_drvdata(dev);
+ struct ide_host *host = pnp_get_drvdata(dev);
- ide_unregister(hwif);
+ ide_host_remove(host);
release_region(pnp_port_start(dev, 1), 1);
release_region(pnp_port_start(dev, 0), 8);