aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/excite_nandflash.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/nand/excite_nandflash.c')
-rw-r--r--drivers/mtd/nand/excite_nandflash.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/mtd/nand/excite_nandflash.c b/drivers/mtd/nand/excite_nandflash.c
index ced14b5294d5..72446fb48d4b 100644
--- a/drivers/mtd/nand/excite_nandflash.c
+++ b/drivers/mtd/nand/excite_nandflash.c
@@ -128,11 +128,11 @@ static int excite_nand_devready(struct mtd_info *mtd)
128 * The binding to the mtd and all allocated 128 * The binding to the mtd and all allocated
129 * resources are released. 129 * resources are released.
130 */ 130 */
131static int __exit excite_nand_remove(struct device *dev) 131static int __exit excite_nand_remove(struct platform_device *dev)
132{ 132{
133 struct excite_nand_drvdata * const this = dev_get_drvdata(dev); 133 struct excite_nand_drvdata * const this = platform_get_drvdata(dev);
134 134
135 dev_set_drvdata(dev, NULL); 135 platform_set_drvdata(dev, NULL);
136 136
137 if (unlikely(!this)) { 137 if (unlikely(!this)) {
138 printk(KERN_ERR "%s: called %s without private data!!", 138 printk(KERN_ERR "%s: called %s without private data!!",
@@ -159,9 +159,8 @@ static int __exit excite_nand_remove(struct device *dev)
159 * it can allocate all necessary resources then calls the 159 * it can allocate all necessary resources then calls the
160 * nand layer to look for devices. 160 * nand layer to look for devices.
161*/ 161*/
162static int __init excite_nand_probe(struct device *dev) 162static int __init excite_nand_probe(struct platform_device *pdev)
163{ 163{
164 struct platform_device * const pdev = to_platform_device(dev);
165 struct excite_nand_drvdata *drvdata; /* private driver data */ 164 struct excite_nand_drvdata *drvdata; /* private driver data */
166 struct nand_chip *board_chip; /* private flash chip data */ 165 struct nand_chip *board_chip; /* private flash chip data */
167 struct mtd_info *board_mtd; /* mtd info for this board */ 166 struct mtd_info *board_mtd; /* mtd info for this board */
@@ -175,7 +174,7 @@ static int __init excite_nand_probe(struct device *dev)
175 } 174 }
176 175
177 /* bind private data into driver */ 176 /* bind private data into driver */
178 dev_set_drvdata(dev, drvdata); 177 platform_set_drvdata(pdev, drvdata);
179 178
180 /* allocate and map the resource */ 179 /* allocate and map the resource */
181 drvdata->regs = 180 drvdata->regs =
@@ -219,23 +218,25 @@ static int __init excite_nand_probe(struct device *dev)
219 return 0; 218 return 0;
220} 219}
221 220
222static struct device_driver excite_nand_driver = { 221static struct platform_driver excite_nand_driver = {
223 .name = "excite_nand", 222 .driver = {
224 .bus = &platform_bus_type, 223 .name = "excite_nand",
224 .owner = THIS_MODULE,
225 },
225 .probe = excite_nand_probe, 226 .probe = excite_nand_probe,
226 .remove = __exit_p(excite_nand_remove) 227 .remove = __devexit_p(excite_nand_remove)
227}; 228};
228 229
229static int __init excite_nand_init(void) 230static int __init excite_nand_init(void)
230{ 231{
231 pr_info("Basler eXcite nand flash driver Version " 232 pr_info("Basler eXcite nand flash driver Version "
232 EXCITE_NANDFLASH_VERSION "\n"); 233 EXCITE_NANDFLASH_VERSION "\n");
233 return driver_register(&excite_nand_driver); 234 return platform_driver_register(&excite_nand_driver);
234} 235}
235 236
236static void __exit excite_nand_exit(void) 237static void __exit excite_nand_exit(void)
237{ 238{
238 driver_unregister(&excite_nand_driver); 239 platform_driver_unregister(&excite_nand_driver);
239} 240}
240 241
241module_init(excite_nand_init); 242module_init(excite_nand_init);