]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/pci/delkin_cb.c
ide: use unique names for struct pci_driver instances
[linux-2.6-omap-h63xx.git] / drivers / ide / pci / delkin_cb.c
index 0106e2a2df77a3ab8c42fd9092e440c3a309a9b9..8689a706f537186e46549d2253b51c5c66c3b3a6 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <linux/types.h>
 #include <linux/module.h>
-#include <linux/hdreg.h>
 #include <linux/ide.h>
 #include <linux/init.h>
 #include <linux/pci.h>
@@ -56,11 +55,10 @@ static const struct ide_port_info delkin_cb_port_info = {
 static int __devinit
 delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id)
 {
+       struct ide_host *host;
        unsigned long base;
-       hw_regs_t hw;
-       ide_hwif_t *hwif = NULL;
        int i, rc;
-       u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
+       hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
 
        rc = pci_enable_device(dev);
        if (rc) {
@@ -87,34 +85,26 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id)
        hw.dev = &dev->dev;
        hw.chipset = ide_pci;           /* this enables IRQ sharing */
 
-       hwif = ide_find_port();
-       if (hwif == NULL)
+       rc = ide_host_add(&delkin_cb_port_info, hws, &host);
+       if (rc)
                goto out_disable;
 
-       i = hwif->index;
-
-       ide_init_port_hw(hwif, &hw);
-
-       idx[0] = i;
-
-       ide_device_add(idx, &delkin_cb_port_info);
-
-       pci_set_drvdata(dev, hwif);
+       pci_set_drvdata(dev, host);
 
        return 0;
 
 out_disable:
        pci_release_regions(dev);
        pci_disable_device(dev);
-       return -ENODEV;
+       return rc;
 }
 
 static void
 delkin_cb_remove (struct pci_dev *dev)
 {
-       ide_hwif_t *hwif = pci_get_drvdata(dev);
+       struct ide_host *host = pci_get_drvdata(dev);
 
-       ide_unregister(hwif);
+       ide_host_remove(host);
 
        pci_release_regions(dev);
        pci_disable_device(dev);
@@ -127,7 +117,7 @@ static struct pci_device_id delkin_cb_pci_tbl[] __devinitdata = {
 };
 MODULE_DEVICE_TABLE(pci, delkin_cb_pci_tbl);
 
-static struct pci_driver driver = {
+static struct pci_driver delkin_cb_pci_driver = {
        .name           = "Delkin-ASKA-Workbit Cardbus IDE",
        .id_table       = delkin_cb_pci_tbl,
        .probe          = delkin_cb_probe,
@@ -136,12 +126,12 @@ static struct pci_driver driver = {
 
 static int __init delkin_cb_init(void)
 {
-       return pci_register_driver(&driver);
+       return pci_register_driver(&delkin_cb_pci_driver);
 }
 
 static void __exit delkin_cb_exit(void)
 {
-       pci_unregister_driver(&driver);
+       pci_unregister_driver(&delkin_cb_pci_driver);
 }
 
 module_init(delkin_cb_init);