{.id = ""}
};
+static const struct ide_port_info ide_pnp_port_info = {
+ .host_flags = IDE_HFLAG_NO_DMA,
+ .chipset = ide_generic,
+};
+
static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
{
struct ide_host *host;
unsigned long base, ctl;
- hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
+ int rc;
+ struct ide_hw hw, *hws[] = { &hw };
printk(KERN_INFO DRV_NAME ": generic PnP IDE interface\n");
memset(&hw, 0, sizeof(hw));
ide_std_init_ports(&hw, base, ctl);
hw.irq = pnp_irq(dev, 0);
- hw.chipset = ide_generic;
- host = ide_host_alloc(NULL, hws);
- if (host) {
- pnp_set_drvdata(dev, host);
+ rc = ide_host_add(&ide_pnp_port_info, hws, 1, &host);
+ if (rc)
+ goto out;
- ide_host_register(host, NULL, hws);
-
- return 0;
- }
+ pnp_set_drvdata(dev, host);
+ return 0;
+out:
release_region(ctl, 1);
release_region(base, 8);
- return -1;
+ return rc;
}
static void idepnp_remove(struct pnp_dev *dev)