aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r--drivers/mtd/nand/ams-delta.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/drivers/mtd/nand/ams-delta.c b/drivers/mtd/nand/ams-delta.c
index 2548e1065bf8..7d49f6a6b726 100644
--- a/drivers/mtd/nand/ams-delta.c
+++ b/drivers/mtd/nand/ams-delta.c
@@ -4,6 +4,7 @@
4 * Copyright (C) 2006 Jonathan McDowell <noodles@earth.li> 4 * Copyright (C) 2006 Jonathan McDowell <noodles@earth.li>
5 * 5 *
6 * Derived from drivers/mtd/toto.c 6 * Derived from drivers/mtd/toto.c
7 * Converted to platform driver by Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
7 * 8 *
8 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
@@ -151,7 +152,7 @@ static int ams_delta_nand_ready(struct mtd_info *mtd)
151/* 152/*
152 * Main initialization routine 153 * Main initialization routine
153 */ 154 */
154static int __init ams_delta_init(void) 155static int __devinit ams_delta_init(struct platform_device *pdev)
155{ 156{
156 struct nand_chip *this; 157 struct nand_chip *this;
157 int err = 0; 158 int err = 0;
@@ -219,20 +220,40 @@ static int __init ams_delta_init(void)
219 return err; 220 return err;
220} 221}
221 222
222module_init(ams_delta_init);
223
224/* 223/*
225 * Clean up routine 224 * Clean up routine
226 */ 225 */
227static void __exit ams_delta_cleanup(void) 226static int __devexit ams_delta_cleanup(struct platform_device *pdev)
228{ 227{
229 /* Release resources, unregister device */ 228 /* Release resources, unregister device */
230 nand_release(ams_delta_mtd); 229 nand_release(ams_delta_mtd);
231 230
232 /* Free the MTD device structure */ 231 /* Free the MTD device structure */
233 kfree(ams_delta_mtd); 232 kfree(ams_delta_mtd);
233
234 return 0;
235}
236
237static struct platform_driver ams_delta_nand_driver = {
238 .probe = ams_delta_init,
239 .remove = __devexit_p(ams_delta_cleanup),
240 .driver = {
241 .name = "ams-delta-nand",
242 .owner = THIS_MODULE,
243 },
244};
245
246static int __init ams_delta_nand_init(void)
247{
248 return platform_driver_register(&ams_delta_nand_driver);
249}
250module_init(ams_delta_nand_init);
251
252static void __exit ams_delta_nand_exit(void)
253{
254 platform_driver_unregister(&ams_delta_nand_driver);
234} 255}
235module_exit(ams_delta_cleanup); 256module_exit(ams_delta_nand_exit);
236 257
237MODULE_LICENSE("GPL"); 258MODULE_LICENSE("GPL");
238MODULE_AUTHOR("Jonathan McDowell <noodles@earth.li>"); 259MODULE_AUTHOR("Jonathan McDowell <noodles@earth.li>");