aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2011-02-17 04:43:24 -0500
committerGrant Likely <grant.likely@secretlab.ca>2011-02-28 15:22:46 -0500
commit1c48a5c93da63132b92c4bbcd18e690c51539df6 (patch)
tree746e990ce0f49e48e2cc9d55766485f468ca35f6 /drivers/mtd
parent793218dfea146946a076f4fe51e574db61034a3e (diff)
dt: Eliminate of_platform_{,un}register_driver
Final step to eliminate of_platform_bus_type. They're all just platform drivers now. v2: fix type in pasemi_nand.c (thanks to Stephen Rothwell) Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/maps/physmap_of.c15
-rw-r--r--drivers/mtd/maps/sun_uflash.c8
-rw-r--r--drivers/mtd/nand/fsl_upm.c9
-rw-r--r--drivers/mtd/nand/mpc5121_nfc.c9
-rw-r--r--drivers/mtd/nand/ndfc.c9
-rw-r--r--drivers/mtd/nand/pasemi_nand.c9
-rw-r--r--drivers/mtd/nand/socrates_nand.c9
7 files changed, 33 insertions, 35 deletions
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
index 8506578e6a35..3db0cb083d31 100644
--- a/drivers/mtd/maps/physmap_of.c
+++ b/drivers/mtd/maps/physmap_of.c
@@ -216,8 +216,7 @@ static void __devinit of_free_probes(const char **probes)
216} 216}
217#endif 217#endif
218 218
219static int __devinit of_flash_probe(struct platform_device *dev, 219static int __devinit of_flash_probe(struct platform_device *dev)
220 const struct of_device_id *match)
221{ 220{
222#ifdef CONFIG_MTD_PARTITIONS 221#ifdef CONFIG_MTD_PARTITIONS
223 const char **part_probe_types; 222 const char **part_probe_types;
@@ -225,7 +224,7 @@ static int __devinit of_flash_probe(struct platform_device *dev,
225 struct device_node *dp = dev->dev.of_node; 224 struct device_node *dp = dev->dev.of_node;
226 struct resource res; 225 struct resource res;
227 struct of_flash *info; 226 struct of_flash *info;
228 const char *probe_type = match->data; 227 const char *probe_type;
229 const __be32 *width; 228 const __be32 *width;
230 int err; 229 int err;
231 int i; 230 int i;
@@ -235,6 +234,10 @@ static int __devinit of_flash_probe(struct platform_device *dev,
235 struct mtd_info **mtd_list = NULL; 234 struct mtd_info **mtd_list = NULL;
236 resource_size_t res_size; 235 resource_size_t res_size;
237 236
237 if (!dev->dev.of_match)
238 return -EINVAL;
239 probe_type = dev->dev.of_match->data;
240
238 reg_tuple_size = (of_n_addr_cells(dp) + of_n_size_cells(dp)) * sizeof(u32); 241 reg_tuple_size = (of_n_addr_cells(dp) + of_n_size_cells(dp)) * sizeof(u32);
239 242
240 /* 243 /*
@@ -418,7 +421,7 @@ static struct of_device_id of_flash_match[] = {
418}; 421};
419MODULE_DEVICE_TABLE(of, of_flash_match); 422MODULE_DEVICE_TABLE(of, of_flash_match);
420 423
421static struct of_platform_driver of_flash_driver = { 424static struct platform_driver of_flash_driver = {
422 .driver = { 425 .driver = {
423 .name = "of-flash", 426 .name = "of-flash",
424 .owner = THIS_MODULE, 427 .owner = THIS_MODULE,
@@ -430,12 +433,12 @@ static struct of_platform_driver of_flash_driver = {
430 433
431static int __init of_flash_init(void) 434static int __init of_flash_init(void)
432{ 435{
433 return of_register_platform_driver(&of_flash_driver); 436 return platform_driver_register(&of_flash_driver);
434} 437}
435 438
436static void __exit of_flash_exit(void) 439static void __exit of_flash_exit(void)
437{ 440{
438 of_unregister_platform_driver(&of_flash_driver); 441 platform_driver_unregister(&of_flash_driver);
439} 442}
440 443
441module_init(of_flash_init); 444module_init(of_flash_init);
diff --git a/drivers/mtd/maps/sun_uflash.c b/drivers/mtd/maps/sun_uflash.c
index 3582ba1f9b09..3f1cb328a574 100644
--- a/drivers/mtd/maps/sun_uflash.c
+++ b/drivers/mtd/maps/sun_uflash.c
@@ -108,7 +108,7 @@ int uflash_devinit(struct platform_device *op, struct device_node *dp)
108 return 0; 108 return 0;
109} 109}
110 110
111static int __devinit uflash_probe(struct platform_device *op, const struct of_device_id *match) 111static int __devinit uflash_probe(struct platform_device *op)
112{ 112{
113 struct device_node *dp = op->dev.of_node; 113 struct device_node *dp = op->dev.of_node;
114 114
@@ -148,7 +148,7 @@ static const struct of_device_id uflash_match[] = {
148 148
149MODULE_DEVICE_TABLE(of, uflash_match); 149MODULE_DEVICE_TABLE(of, uflash_match);
150 150
151static struct of_platform_driver uflash_driver = { 151static struct platform_driver uflash_driver = {
152 .driver = { 152 .driver = {
153 .name = DRIVER_NAME, 153 .name = DRIVER_NAME,
154 .owner = THIS_MODULE, 154 .owner = THIS_MODULE,
@@ -160,12 +160,12 @@ static struct of_platform_driver uflash_driver = {
160 160
161static int __init uflash_init(void) 161static int __init uflash_init(void)
162{ 162{
163 return of_register_platform_driver(&uflash_driver); 163 return platform_driver_register(&uflash_driver);
164} 164}
165 165
166static void __exit uflash_exit(void) 166static void __exit uflash_exit(void)
167{ 167{
168 of_unregister_platform_driver(&uflash_driver); 168 platform_driver_unregister(&uflash_driver);
169} 169}
170 170
171module_init(uflash_init); 171module_init(uflash_init);
diff --git a/drivers/mtd/nand/fsl_upm.c b/drivers/mtd/nand/fsl_upm.c
index efdcca94ce55..073ee026a17c 100644
--- a/drivers/mtd/nand/fsl_upm.c
+++ b/drivers/mtd/nand/fsl_upm.c
@@ -217,8 +217,7 @@ err:
217 return ret; 217 return ret;
218} 218}
219 219
220static int __devinit fun_probe(struct platform_device *ofdev, 220static int __devinit fun_probe(struct platform_device *ofdev)
221 const struct of_device_id *ofid)
222{ 221{
223 struct fsl_upm_nand *fun; 222 struct fsl_upm_nand *fun;
224 struct resource io_res; 223 struct resource io_res;
@@ -360,7 +359,7 @@ static const struct of_device_id of_fun_match[] = {
360}; 359};
361MODULE_DEVICE_TABLE(of, of_fun_match); 360MODULE_DEVICE_TABLE(of, of_fun_match);
362 361
363static struct of_platform_driver of_fun_driver = { 362static struct platform_driver of_fun_driver = {
364 .driver = { 363 .driver = {
365 .name = "fsl,upm-nand", 364 .name = "fsl,upm-nand",
366 .owner = THIS_MODULE, 365 .owner = THIS_MODULE,
@@ -372,13 +371,13 @@ static struct of_platform_driver of_fun_driver = {
372 371
373static int __init fun_module_init(void) 372static int __init fun_module_init(void)
374{ 373{
375 return of_register_platform_driver(&of_fun_driver); 374 return platform_driver_register(&of_fun_driver);
376} 375}
377module_init(fun_module_init); 376module_init(fun_module_init);
378 377
379static void __exit fun_module_exit(void) 378static void __exit fun_module_exit(void)
380{ 379{
381 of_unregister_platform_driver(&of_fun_driver); 380 platform_driver_unregister(&of_fun_driver);
382} 381}
383module_exit(fun_module_exit); 382module_exit(fun_module_exit);
384 383
diff --git a/drivers/mtd/nand/mpc5121_nfc.c b/drivers/mtd/nand/mpc5121_nfc.c
index 469e649c911c..c2f95437e5e9 100644
--- a/drivers/mtd/nand/mpc5121_nfc.c
+++ b/drivers/mtd/nand/mpc5121_nfc.c
@@ -650,8 +650,7 @@ static void mpc5121_nfc_free(struct device *dev, struct mtd_info *mtd)
650 iounmap(prv->csreg); 650 iounmap(prv->csreg);
651} 651}
652 652
653static int __devinit mpc5121_nfc_probe(struct platform_device *op, 653static int __devinit mpc5121_nfc_probe(struct platform_device *op)
654 const struct of_device_id *match)
655{ 654{
656 struct device_node *rootnode, *dn = op->dev.of_node; 655 struct device_node *rootnode, *dn = op->dev.of_node;
657 struct device *dev = &op->dev; 656 struct device *dev = &op->dev;
@@ -891,7 +890,7 @@ static struct of_device_id mpc5121_nfc_match[] __devinitdata = {
891 {}, 890 {},
892}; 891};
893 892
894static struct of_platform_driver mpc5121_nfc_driver = { 893static struct platform_driver mpc5121_nfc_driver = {
895 .probe = mpc5121_nfc_probe, 894 .probe = mpc5121_nfc_probe,
896 .remove = __devexit_p(mpc5121_nfc_remove), 895 .remove = __devexit_p(mpc5121_nfc_remove),
897 .driver = { 896 .driver = {
@@ -903,14 +902,14 @@ static struct of_platform_driver mpc5121_nfc_driver = {
903 902
904static int __init mpc5121_nfc_init(void) 903static int __init mpc5121_nfc_init(void)
905{ 904{
906 return of_register_platform_driver(&mpc5121_nfc_driver); 905 return platform_driver_register(&mpc5121_nfc_driver);
907} 906}
908 907
909module_init(mpc5121_nfc_init); 908module_init(mpc5121_nfc_init);
910 909
911static void __exit mpc5121_nfc_cleanup(void) 910static void __exit mpc5121_nfc_cleanup(void)
912{ 911{
913 of_unregister_platform_driver(&mpc5121_nfc_driver); 912 platform_driver_unregister(&mpc5121_nfc_driver);
914} 913}
915 914
916module_exit(mpc5121_nfc_cleanup); 915module_exit(mpc5121_nfc_cleanup);
diff --git a/drivers/mtd/nand/ndfc.c b/drivers/mtd/nand/ndfc.c
index c9ae0a5023b6..bbe6d451290d 100644
--- a/drivers/mtd/nand/ndfc.c
+++ b/drivers/mtd/nand/ndfc.c
@@ -225,8 +225,7 @@ err:
225 return ret; 225 return ret;
226} 226}
227 227
228static int __devinit ndfc_probe(struct platform_device *ofdev, 228static int __devinit ndfc_probe(struct platform_device *ofdev)
229 const struct of_device_id *match)
230{ 229{
231 struct ndfc_controller *ndfc = &ndfc_ctrl; 230 struct ndfc_controller *ndfc = &ndfc_ctrl;
232 const __be32 *reg; 231 const __be32 *reg;
@@ -292,7 +291,7 @@ static const struct of_device_id ndfc_match[] = {
292}; 291};
293MODULE_DEVICE_TABLE(of, ndfc_match); 292MODULE_DEVICE_TABLE(of, ndfc_match);
294 293
295static struct of_platform_driver ndfc_driver = { 294static struct platform_driver ndfc_driver = {
296 .driver = { 295 .driver = {
297 .name = "ndfc", 296 .name = "ndfc",
298 .owner = THIS_MODULE, 297 .owner = THIS_MODULE,
@@ -304,12 +303,12 @@ static struct of_platform_driver ndfc_driver = {
304 303
305static int __init ndfc_nand_init(void) 304static int __init ndfc_nand_init(void)
306{ 305{
307 return of_register_platform_driver(&ndfc_driver); 306 return platform_driver_register(&ndfc_driver);
308} 307}
309 308
310static void __exit ndfc_nand_exit(void) 309static void __exit ndfc_nand_exit(void)
311{ 310{
312 of_unregister_platform_driver(&ndfc_driver); 311 platform_driver_unregister(&ndfc_driver);
313} 312}
314 313
315module_init(ndfc_nand_init); 314module_init(ndfc_nand_init);
diff --git a/drivers/mtd/nand/pasemi_nand.c b/drivers/mtd/nand/pasemi_nand.c
index bb277a54986f..59efa829ef24 100644
--- a/drivers/mtd/nand/pasemi_nand.c
+++ b/drivers/mtd/nand/pasemi_nand.c
@@ -89,8 +89,7 @@ int pasemi_device_ready(struct mtd_info *mtd)
89 return !!(inl(lpcctl) & LBICTRL_LPCCTL_NR); 89 return !!(inl(lpcctl) & LBICTRL_LPCCTL_NR);
90} 90}
91 91
92static int __devinit pasemi_nand_probe(struct platform_device *ofdev, 92static int __devinit pasemi_nand_probe(struct platform_device *ofdev)
93 const struct of_device_id *match)
94{ 93{
95 struct pci_dev *pdev; 94 struct pci_dev *pdev;
96 struct device_node *np = ofdev->dev.of_node; 95 struct device_node *np = ofdev->dev.of_node;
@@ -219,7 +218,7 @@ static const struct of_device_id pasemi_nand_match[] =
219 218
220MODULE_DEVICE_TABLE(of, pasemi_nand_match); 219MODULE_DEVICE_TABLE(of, pasemi_nand_match);
221 220
222static struct of_platform_driver pasemi_nand_driver = 221static struct platform_driver pasemi_nand_driver =
223{ 222{
224 .driver = { 223 .driver = {
225 .name = (char*)driver_name, 224 .name = (char*)driver_name,
@@ -232,13 +231,13 @@ static struct of_platform_driver pasemi_nand_driver =
232 231
233static int __init pasemi_nand_init(void) 232static int __init pasemi_nand_init(void)
234{ 233{
235 return of_register_platform_driver(&pasemi_nand_driver); 234 return platform_driver_register(&pasemi_nand_driver);
236} 235}
237module_init(pasemi_nand_init); 236module_init(pasemi_nand_init);
238 237
239static void __exit pasemi_nand_exit(void) 238static void __exit pasemi_nand_exit(void)
240{ 239{
241 of_unregister_platform_driver(&pasemi_nand_driver); 240 platform_driver_unregister(&pasemi_nand_driver);
242} 241}
243module_exit(pasemi_nand_exit); 242module_exit(pasemi_nand_exit);
244 243
diff --git a/drivers/mtd/nand/socrates_nand.c b/drivers/mtd/nand/socrates_nand.c
index a8e403eebedb..a853548986f0 100644
--- a/drivers/mtd/nand/socrates_nand.c
+++ b/drivers/mtd/nand/socrates_nand.c
@@ -162,8 +162,7 @@ static const char *part_probes[] = { "cmdlinepart", NULL };
162/* 162/*
163 * Probe for the NAND device. 163 * Probe for the NAND device.
164 */ 164 */
165static int __devinit socrates_nand_probe(struct platform_device *ofdev, 165static int __devinit socrates_nand_probe(struct platform_device *ofdev)
166 const struct of_device_id *ofid)
167{ 166{
168 struct socrates_nand_host *host; 167 struct socrates_nand_host *host;
169 struct mtd_info *mtd; 168 struct mtd_info *mtd;
@@ -300,7 +299,7 @@ static const struct of_device_id socrates_nand_match[] =
300 299
301MODULE_DEVICE_TABLE(of, socrates_nand_match); 300MODULE_DEVICE_TABLE(of, socrates_nand_match);
302 301
303static struct of_platform_driver socrates_nand_driver = { 302static struct platform_driver socrates_nand_driver = {
304 .driver = { 303 .driver = {
305 .name = "socrates_nand", 304 .name = "socrates_nand",
306 .owner = THIS_MODULE, 305 .owner = THIS_MODULE,
@@ -312,12 +311,12 @@ static struct of_platform_driver socrates_nand_driver = {
312 311
313static int __init socrates_nand_init(void) 312static int __init socrates_nand_init(void)
314{ 313{
315 return of_register_platform_driver(&socrates_nand_driver); 314 return platform_driver_register(&socrates_nand_driver);
316} 315}
317 316
318static void __exit socrates_nand_exit(void) 317static void __exit socrates_nand_exit(void)
319{ 318{
320 of_unregister_platform_driver(&socrates_nand_driver); 319 platform_driver_unregister(&socrates_nand_driver);
321} 320}
322 321
323module_init(socrates_nand_init); 322module_init(socrates_nand_init);