siimage: remove resetproc() method
[deliverable/linux.git] / drivers / ide / ide-probe.c
index c6ba439b1435785443ddf988bb59cb6851f22f38..56fb0b84342959d9a51e116ff3b0686d47998251 100644 (file)
@@ -47,6 +47,7 @@
 #include <linux/spinlock.h>
 #include <linux/kmod.h>
 #include <linux/pci.h>
+#include <linux/scatterlist.h>
 
 #include <asm/byteorder.h>
 #include <asm/irq.h>
@@ -171,11 +172,12 @@ static inline void do_identify (ide_drive_t *drive, u8 cmd)
        ide_fixstring(id->fw_rev,    sizeof(id->fw_rev),    bswap);
        ide_fixstring(id->serial_no, sizeof(id->serial_no), bswap);
 
+       /* we depend on this a lot! */
+       id->model[sizeof(id->model)-1] = '\0';
+
        if (strstr(id->model, "E X A B Y T E N E S T"))
                goto err_misc;
 
-       /* we depend on this a lot! */
-       id->model[sizeof(id->model)-1] = '\0';
        printk("%s: %s, ", drive->name, id->model);
        drive->present = 1;
        drive->dead = 0;
@@ -861,7 +863,7 @@ static void probe_hwif(ide_hwif_t *hwif)
 static int hwif_init(ide_hwif_t *hwif);
 static void hwif_register_devices(ide_hwif_t *hwif);
 
-int probe_hwif_init(ide_hwif_t *hwif)
+static int probe_hwif_init(ide_hwif_t *hwif)
 {
        probe_hwif(hwif);
 
@@ -877,8 +879,6 @@ int probe_hwif_init(ide_hwif_t *hwif)
        return 0;
 }
 
-EXPORT_SYMBOL(probe_hwif_init);
-
 #if MAX_HWIFS > 1
 /*
  * save_match() is used to simplify logic in init_irq() below.
@@ -1319,12 +1319,14 @@ static int hwif_init(ide_hwif_t *hwif)
        if (!hwif->sg_max_nents)
                hwif->sg_max_nents = PRD_ENTRIES;
 
-       hwif->sg_table = kzalloc(sizeof(struct scatterlist)*hwif->sg_max_nents,
+       hwif->sg_table = kmalloc(sizeof(struct scatterlist)*hwif->sg_max_nents,
                                 GFP_KERNEL);
        if (!hwif->sg_table) {
                printk(KERN_ERR "%s: unable to allocate SG table.\n", hwif->name);
                goto out;
        }
+
+       sg_init_table(hwif->sg_table, hwif->sg_max_nents);
        
        if (init_irq(hwif) == 0)
                goto done;
@@ -1410,3 +1412,22 @@ int ideprobe_init (void)
 }
 
 EXPORT_SYMBOL_GPL(ideprobe_init);
+
+int ide_device_add(u8 idx[4])
+{
+       int i, rc = 0;
+
+       for (i = 0; i < 4; i++) {
+               if (idx[i] != 0xff)
+                       rc |= probe_hwif_init(&ide_hwifs[idx[i]]);
+       }
+
+       for (i = 0; i < 4; i++) {
+               if (idx[i] != 0xff)
+                       ide_proc_register_port(&ide_hwifs[idx[i]]);
+       }
+
+       return rc;
+}
+
+EXPORT_SYMBOL_GPL(ide_device_add);
This page took 0.062131 seconds and 5 git commands to generate.