Reformat ...
[linux-2.6/linux-mips.git] / drivers / ide / ide-default.c
blob40ecc4de0c058c8fbefdeeaf55ee3b9643ba0169
1 /*
2 * ide-default - Driver for unbound ide devices
4 * This provides a clean way to bind a device to default operations
5 * by having an actual driver class that rather than special casing
6 * "no driver" all over the IDE code
8 * Copyright (C) 2003, Red Hat <alan@redhat.com>
9 */
11 #include <linux/config.h>
12 #include <linux/module.h>
13 #include <linux/types.h>
14 #include <linux/string.h>
15 #include <linux/kernel.h>
16 #include <linux/delay.h>
17 #include <linux/timer.h>
18 #include <linux/mm.h>
19 #include <linux/interrupt.h>
20 #include <linux/major.h>
21 #include <linux/errno.h>
22 #include <linux/genhd.h>
23 #include <linux/slab.h>
24 #include <linux/cdrom.h>
25 #include <linux/ide.h>
27 #include <asm/byteorder.h>
28 #include <asm/irq.h>
29 #include <asm/uaccess.h>
30 #include <asm/io.h>
31 #include <asm/unaligned.h>
32 #include <asm/bitops.h>
34 #define IDEDEFAULT_VERSION "0.9.newide"
36 * Driver initialization.
39 static int idedefault_attach(ide_drive_t *drive);
42 * IDE subdriver functions, registered with ide.c
44 * idedefault *must* support DMA because it will be
45 * attached before the other drivers are loaded and
46 * we don't want to lose the DMA status at probe
47 * time.
50 ide_driver_t idedefault_driver = {
51 .name = "ide-default",
52 .version = IDEDEFAULT_VERSION,
53 .attach = idedefault_attach,
54 .supports_dma = 1,
55 .drives = LIST_HEAD_INIT(idedefault_driver.drives)
58 static int idedefault_attach (ide_drive_t *drive)
60 if (ide_register_subdriver(drive,
61 &idedefault_driver, IDE_SUBDRIVER_VERSION)) {
62 printk(KERN_ERR "ide-default: %s: Failed to register the "
63 "driver with ide.c\n", drive->name);
64 return 1;
66 return 0;
69 MODULE_DESCRIPTION("IDE Default Driver");
71 MODULE_LICENSE("GPL");