aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ide/ide-generic.c68
1 files changed, 1 insertions, 67 deletions
diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c
index 9d03e8211536..3a93e4c41bf7 100644
--- a/drivers/ide/ide-generic.c
+++ b/drivers/ide/ide-generic.c
@@ -1,20 +1,12 @@
1/* 1/*
2 * generic/default IDE host driver 2 * generic/default IDE host driver
3 * 3 *
4 * Copyright (C) 2004, 2008 Bartlomiej Zolnierkiewicz 4 * Copyright (C) 2004, 2008-2009 Bartlomiej Zolnierkiewicz
5 * This code was split off from ide.c. See it for original copyrights. 5 * This code was split off from ide.c. See it for original copyrights.
6 * 6 *
7 * May be copied or modified under the terms of the GNU General Public License. 7 * May be copied or modified under the terms of the GNU General Public License.
8 */ 8 */
9 9
10/*
11 * For special cases new interfaces may be added using sysfs, i.e.
12 *
13 * echo -n "0x168:0x36e:10" > /sys/class/ide_generic/add
14 *
15 * will add an interface using I/O ports 0x168-0x16f/0x36e and IRQ 10.
16 */
17
18#include <linux/kernel.h> 10#include <linux/kernel.h>
19#include <linux/init.h> 11#include <linux/init.h>
20#include <linux/module.h> 12#include <linux/module.h>
@@ -36,60 +28,6 @@ static const struct ide_port_info ide_generic_port_info = {
36 .host_flags = IDE_HFLAG_NO_DMA, 28 .host_flags = IDE_HFLAG_NO_DMA,
37}; 29};
38 30
39static ssize_t store_add(struct class *cls, const char *buf, size_t n)
40{
41 unsigned int base, ctl;
42 int irq, rc;
43 hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
44
45 if (sscanf(buf, "%x:%x:%d", &base, &ctl, &irq) != 3)
46 return -EINVAL;
47
48 memset(&hw, 0, sizeof(hw));
49 ide_std_init_ports(&hw, base, ctl);
50 hw.irq = irq;
51 hw.chipset = ide_generic;
52
53 rc = ide_host_add(&ide_generic_port_info, hws, NULL);
54 if (rc)
55 return rc;
56
57 return n;
58};
59
60static struct class_attribute ide_generic_class_attrs[] = {
61 __ATTR(add, S_IWUSR, NULL, store_add),
62 __ATTR_NULL
63};
64
65static void ide_generic_class_release(struct class *cls)
66{
67 kfree(cls);
68}
69
70static int __init ide_generic_sysfs_init(void)
71{
72 struct class *cls;
73 int rc;
74
75 cls = kzalloc(sizeof(*cls), GFP_KERNEL);
76 if (!cls)
77 return -ENOMEM;
78
79 cls->name = DRV_NAME;
80 cls->owner = THIS_MODULE;
81 cls->class_release = ide_generic_class_release;
82 cls->class_attrs = ide_generic_class_attrs;
83
84 rc = class_register(cls);
85 if (rc) {
86 kfree(cls);
87 return rc;
88 }
89
90 return 0;
91}
92
93#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) \ 31#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) \
94 || defined(CONFIG_PLAT_OPSPUT) 32 || defined(CONFIG_PLAT_OPSPUT)
95static const u16 legacy_bases[] = { 0x1f0 }; 33static const u16 legacy_bases[] = { 0x1f0 };
@@ -196,10 +134,6 @@ static int __init ide_generic_init(void)
196 } 134 }
197 } 135 }
198 136
199 if (ide_generic_sysfs_init())
200 printk(KERN_ERR DRV_NAME ": failed to create ide_generic "
201 "class\n");
202
203 return rc; 137 return rc;
204} 138}
205 139