diff options
author | Kyungmin Park <kyungmin.park@samsung.com> | 2005-09-09 02:43:16 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@mtd.linutronix.de> | 2005-11-06 15:35:12 -0500 |
commit | 1b01d9798d58bf28a40fede184482ebf39e63335 (patch) | |
tree | d158089f6f0cb0e8ee652e371ff8960155b798db | |
parent | 68ee4b1c50847743393b01847a640ebf1002789b (diff) |
OneNAND: Remove OMAP platform driver
Now we can use the generic platform driver
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | drivers/mtd/onenand/Kconfig | 6 | ||||
-rw-r--r-- | drivers/mtd/onenand/Makefile | 1 | ||||
-rw-r--r-- | drivers/mtd/onenand/omap-onenand.c | 147 |
3 files changed, 0 insertions, 154 deletions
diff --git a/drivers/mtd/onenand/Kconfig b/drivers/mtd/onenand/Kconfig index 666ad3217730..fa5045c9d6e7 100644 --- a/drivers/mtd/onenand/Kconfig +++ b/drivers/mtd/onenand/Kconfig | |||
@@ -30,12 +30,6 @@ config MTD_ONENAND_GENERIC | |||
30 | Support for OneNAND flash on generic board. Using device driver | 30 | Support for OneNAND flash on generic board. Using device driver |
31 | framework, now all most platfrom are support. | 31 | framework, now all most platfrom are support. |
32 | 32 | ||
33 | config MTD_ONENAND_OMAP | ||
34 | tristate "OneNAND Flash device on OMAP board" | ||
35 | depends on ARCH_OMAP && MTD_ONENAND | ||
36 | help | ||
37 | Support for OneNAND flash on TI OMAP board. | ||
38 | |||
39 | config MTD_ONENAND_SYNC_READ | 33 | config MTD_ONENAND_SYNC_READ |
40 | bool "OneNAND Sync. Burst Read Support" | 34 | bool "OneNAND Sync. Burst Read Support" |
41 | depends on ARCH_OMAP | 35 | depends on ARCH_OMAP |
diff --git a/drivers/mtd/onenand/Makefile b/drivers/mtd/onenand/Makefile index e2a96549fcd8..4d2eacfd7e11 100644 --- a/drivers/mtd/onenand/Makefile +++ b/drivers/mtd/onenand/Makefile | |||
@@ -7,7 +7,6 @@ obj-$(CONFIG_MTD_ONENAND) += onenand.o | |||
7 | 7 | ||
8 | # Board specific. | 8 | # Board specific. |
9 | obj-$(CONFIG_MTD_ONENAND_GENERIC) += generic.o | 9 | obj-$(CONFIG_MTD_ONENAND_GENERIC) += generic.o |
10 | obj-$(CONFIG_MTD_ONENAND_OMAP) += omap-onenand.o | ||
11 | 10 | ||
12 | # Simulator | 11 | # Simulator |
13 | obj-$(CONFIG_MTD_ONENAND_SIM) += onenand_sim.o | 12 | obj-$(CONFIG_MTD_ONENAND_SIM) += onenand_sim.o |
diff --git a/drivers/mtd/onenand/omap-onenand.c b/drivers/mtd/onenand/omap-onenand.c deleted file mode 100644 index 57e69f184d33..000000000000 --- a/drivers/mtd/onenand/omap-onenand.c +++ /dev/null | |||
@@ -1,147 +0,0 @@ | |||
1 | /* | ||
2 | * linux/drivers/mtd/onenand/omap-onenand.c | ||
3 | * | ||
4 | * Copyright (c) 2005 Samsung Electronics | ||
5 | * Kyungmin Park <kyungmin.park@samsung.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | * Overview: | ||
12 | * This is a device driver for the OneNAND flash for OMAP boards. | ||
13 | */ | ||
14 | |||
15 | #include <linux/device.h> | ||
16 | #include <linux/module.h> | ||
17 | #include <linux/init.h> | ||
18 | #include <linux/mtd/mtd.h> | ||
19 | #include <linux/mtd/onenand.h> | ||
20 | #include <linux/mtd/partitions.h> | ||
21 | |||
22 | #include <asm/io.h> | ||
23 | #include <asm/mach/flash.h> | ||
24 | |||
25 | #define DRIVER_NAME "onenand" | ||
26 | |||
27 | |||
28 | #ifdef CONFIG_MTD_PARTITIONS | ||
29 | static const char *part_probes[] = { "cmdlinepart", NULL, }; | ||
30 | #endif | ||
31 | |||
32 | struct omap_onenand_info { | ||
33 | struct mtd_info mtd; | ||
34 | struct mtd_partition *parts; | ||
35 | struct onenand_chip onenand; | ||
36 | }; | ||
37 | |||
38 | static int __devinit omap_onenand_probe(struct device *dev) | ||
39 | { | ||
40 | struct omap_onenand_info *info; | ||
41 | struct platform_device *pdev = to_platform_device(dev); | ||
42 | struct onenand_platform_data *pdata = pdev->dev.platform_data; | ||
43 | struct resource *res = pdev->resource; | ||
44 | unsigned long size = res->end - res->start + 1; | ||
45 | int err; | ||
46 | |||
47 | info = kmalloc(sizeof(struct omap_onenand_info), GFP_KERNEL); | ||
48 | if (!info) | ||
49 | return -ENOMEM; | ||
50 | |||
51 | memset(info, 0, sizeof(struct omap_onenand_info)); | ||
52 | |||
53 | if (!request_mem_region(res->start, size, dev->driver->name)) { | ||
54 | err = -EBUSY; | ||
55 | goto out_free_info; | ||
56 | } | ||
57 | |||
58 | info->onenand.base = ioremap(res->start, size); | ||
59 | if (!info->onenand.base) { | ||
60 | err = -ENOMEM; | ||
61 | goto out_release_mem_region; | ||
62 | } | ||
63 | |||
64 | info->onenand.mmcontrol = pdata->mmcontrol; | ||
65 | |||
66 | info->mtd.name = pdev->dev.bus_id; | ||
67 | info->mtd.priv = &info->onenand; | ||
68 | info->mtd.owner = THIS_MODULE; | ||
69 | |||
70 | if (onenand_scan(&info->mtd, 1)) { | ||
71 | err = -ENXIO; | ||
72 | goto out_iounmap; | ||
73 | } | ||
74 | |||
75 | #ifdef CONFIG_MTD_PARTITIONS | ||
76 | err = parse_mtd_partitions(&info->mtd, part_probes, &info->parts, 0); | ||
77 | if (err > 0) | ||
78 | add_mtd_partitions(&info->mtd, info->parts, err); | ||
79 | else if (err < 0 && pdata->parts) | ||
80 | add_mtd_partitions(&info->mtd, pdata->parts, pdata->nr_parts); | ||
81 | else | ||
82 | #endif | ||
83 | err = add_mtd_device(&info->mtd); | ||
84 | |||
85 | dev_set_drvdata(&pdev->dev, info); | ||
86 | |||
87 | return 0; | ||
88 | |||
89 | out_iounmap: | ||
90 | iounmap(info->onenand.base); | ||
91 | out_release_mem_region: | ||
92 | release_mem_region(res->start, size); | ||
93 | out_free_info: | ||
94 | kfree(info); | ||
95 | |||
96 | return err; | ||
97 | } | ||
98 | |||
99 | static int __devexit omap_onenand_remove(struct device *dev) | ||
100 | { | ||
101 | struct platform_device *pdev = to_platform_device(dev); | ||
102 | struct omap_onenand_info *info = dev_get_drvdata(&pdev->dev); | ||
103 | struct resource *res = pdev->resource; | ||
104 | unsigned long size = res->end - res->start + 1; | ||
105 | |||
106 | dev_set_drvdata(&pdev->dev, NULL); | ||
107 | |||
108 | if (info) { | ||
109 | if (info->parts) | ||
110 | del_mtd_partitions(&info->mtd); | ||
111 | else | ||
112 | del_mtd_device(&info->mtd); | ||
113 | |||
114 | onenand_release(&info->mtd); | ||
115 | release_mem_region(res->start, size); | ||
116 | iounmap(info->onenand.base); | ||
117 | kfree(info); | ||
118 | } | ||
119 | |||
120 | return 0; | ||
121 | } | ||
122 | |||
123 | static struct device_driver omap_onenand_driver = { | ||
124 | .name = DRIVER_NAME, | ||
125 | .bus = &platform_bus_type, | ||
126 | .probe = omap_onenand_probe, | ||
127 | .remove = __devexit_p(omap_onenand_remove), | ||
128 | }; | ||
129 | |||
130 | MODULE_ALIAS(DRIVER_NAME); | ||
131 | |||
132 | static int __init omap_onenand_init(void) | ||
133 | { | ||
134 | return driver_register(&omap_onenand_driver); | ||
135 | } | ||
136 | |||
137 | static void __exit omap_onenand_exit(void) | ||
138 | { | ||
139 | driver_unregister(&omap_onenand_driver); | ||
140 | } | ||
141 | |||
142 | module_init(omap_onenand_init); | ||
143 | module_exit(omap_onenand_exit); | ||
144 | |||
145 | MODULE_LICENSE("GPL"); | ||
146 | MODULE_AUTHOR("Kyungmin Park <kyungmin.park@samsung.com>"); | ||
147 | MODULE_DESCRIPTION("Glue layer for OneNAND flash on OMAP boards"); | ||