aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-04-13 19:13:02 -0400
committerGrant Likely <grant.likely@secretlab.ca>2010-05-22 02:10:40 -0400
commit4018294b53d1dae026880e45f174c1cc63b5d435 (patch)
tree6db3538eaf91b653381720a6d92f4f15634a93d0 /drivers/mtd
parent597b9d1e44e9ba69f2454a5318bbe7a6d5e6930a (diff)
of: Remove duplicate fields from of_platform_driver
.name, .match_table and .owner are duplicated in both of_platform_driver and device_driver. This patch is a removes the extra copies from struct of_platform_driver and converts all users to the device_driver members. This patch is a pretty mechanical change. The usage model doesn't change and if any drivers have been missed, or if anything has been fixed up incorrectly, then it will fail with a compile time error, and the fixup will be trivial. This patch looks big and scary because it touches so many files, but it should be pretty safe. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Sean MacLennan <smaclennan@pikatech.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/maps/physmap_of.c7
-rw-r--r--drivers/mtd/maps/sun_uflash.c7
-rw-r--r--drivers/mtd/nand/fsl_elbc_nand.c5
-rw-r--r--drivers/mtd/nand/fsl_upm.c7
-rw-r--r--drivers/mtd/nand/ndfc.c5
-rw-r--r--drivers/mtd/nand/pasemi_nand.c7
-rw-r--r--drivers/mtd/nand/socrates_nand.c7
7 files changed, 31 insertions, 14 deletions
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
index 3dc7a2fbf025..4147fe328c55 100644
--- a/drivers/mtd/maps/physmap_of.c
+++ b/drivers/mtd/maps/physmap_of.c
@@ -375,8 +375,11 @@ static struct of_device_id of_flash_match[] = {
375MODULE_DEVICE_TABLE(of, of_flash_match); 375MODULE_DEVICE_TABLE(of, of_flash_match);
376 376
377static struct of_platform_driver of_flash_driver = { 377static struct of_platform_driver of_flash_driver = {
378 .name = "of-flash", 378 .driver = {
379 .match_table = of_flash_match, 379 .name = "of-flash",
380 .owner = THIS_MODULE,
381 .of_match_table = of_flash_match,
382 },
380 .probe = of_flash_probe, 383 .probe = of_flash_probe,
381 .remove = of_flash_remove, 384 .remove = of_flash_remove,
382}; 385};
diff --git a/drivers/mtd/maps/sun_uflash.c b/drivers/mtd/maps/sun_uflash.c
index 5945a23e681f..0391c2527bd7 100644
--- a/drivers/mtd/maps/sun_uflash.c
+++ b/drivers/mtd/maps/sun_uflash.c
@@ -149,8 +149,11 @@ static const struct of_device_id uflash_match[] = {
149MODULE_DEVICE_TABLE(of, uflash_match); 149MODULE_DEVICE_TABLE(of, uflash_match);
150 150
151static struct of_platform_driver uflash_driver = { 151static struct of_platform_driver uflash_driver = {
152 .name = DRIVER_NAME, 152 .driver = {
153 .match_table = uflash_match, 153 .name = DRIVER_NAME,
154 .owner = THIS_MODULE,
155 .of_match_table = uflash_match,
156 },
154 .probe = uflash_probe, 157 .probe = uflash_probe,
155 .remove = __devexit_p(uflash_remove), 158 .remove = __devexit_p(uflash_remove),
156}; 159};
diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
index 4a6079588ab2..f45a8d0c1508 100644
--- a/drivers/mtd/nand/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/fsl_elbc_nand.c
@@ -1078,9 +1078,10 @@ static const struct of_device_id fsl_elbc_match[] = {
1078 1078
1079static struct of_platform_driver fsl_elbc_ctrl_driver = { 1079static struct of_platform_driver fsl_elbc_ctrl_driver = {
1080 .driver = { 1080 .driver = {
1081 .name = "fsl-elbc", 1081 .name = "fsl-elbc",
1082 .owner = THIS_MODULE,
1083 .of_match_table = fsl_elbc_match,
1082 }, 1084 },
1083 .match_table = fsl_elbc_match,
1084 .probe = fsl_elbc_ctrl_probe, 1085 .probe = fsl_elbc_ctrl_probe,
1085 .remove = fsl_elbc_ctrl_remove, 1086 .remove = fsl_elbc_ctrl_remove,
1086}; 1087};
diff --git a/drivers/mtd/nand/fsl_upm.c b/drivers/mtd/nand/fsl_upm.c
index 4b96296af321..b7ab5a0ec35d 100644
--- a/drivers/mtd/nand/fsl_upm.c
+++ b/drivers/mtd/nand/fsl_upm.c
@@ -357,8 +357,11 @@ static struct of_device_id of_fun_match[] = {
357MODULE_DEVICE_TABLE(of, of_fun_match); 357MODULE_DEVICE_TABLE(of, of_fun_match);
358 358
359static struct of_platform_driver of_fun_driver = { 359static struct of_platform_driver of_fun_driver = {
360 .name = "fsl,upm-nand", 360 .driver = {
361 .match_table = of_fun_match, 361 .name = "fsl,upm-nand",
362 .owner = THIS_MODULE,
363 .of_match_table = of_fun_match,
364 },
362 .probe = fun_probe, 365 .probe = fun_probe,
363 .remove = __devexit_p(fun_remove), 366 .remove = __devexit_p(fun_remove),
364}; 367};
diff --git a/drivers/mtd/nand/ndfc.c b/drivers/mtd/nand/ndfc.c
index c0e05f5ff8a4..98fd2bdf8be1 100644
--- a/drivers/mtd/nand/ndfc.c
+++ b/drivers/mtd/nand/ndfc.c
@@ -294,9 +294,10 @@ MODULE_DEVICE_TABLE(of, ndfc_match);
294 294
295static struct of_platform_driver ndfc_driver = { 295static struct of_platform_driver ndfc_driver = {
296 .driver = { 296 .driver = {
297 .name = "ndfc", 297 .name = "ndfc",
298 .owner = THIS_MODULE,
299 .of_match_table = ndfc_match,
298 }, 300 },
299 .match_table = ndfc_match,
300 .probe = ndfc_probe, 301 .probe = ndfc_probe,
301 .remove = __devexit_p(ndfc_remove), 302 .remove = __devexit_p(ndfc_remove),
302}; 303};
diff --git a/drivers/mtd/nand/pasemi_nand.c b/drivers/mtd/nand/pasemi_nand.c
index edfc27b78513..a97e9c95ab6a 100644
--- a/drivers/mtd/nand/pasemi_nand.c
+++ b/drivers/mtd/nand/pasemi_nand.c
@@ -221,8 +221,11 @@ MODULE_DEVICE_TABLE(of, pasemi_nand_match);
221 221
222static struct of_platform_driver pasemi_nand_driver = 222static struct of_platform_driver pasemi_nand_driver =
223{ 223{
224 .name = (char*)driver_name, 224 .driver = {
225 .match_table = pasemi_nand_match, 225 .name = (char*)driver_name,
226 .owner = THIS_MODULE,
227 .of_match_table = pasemi_nand_match,
228 },
226 .probe = pasemi_nand_probe, 229 .probe = pasemi_nand_probe,
227 .remove = pasemi_nand_remove, 230 .remove = pasemi_nand_remove,
228}; 231};
diff --git a/drivers/mtd/nand/socrates_nand.c b/drivers/mtd/nand/socrates_nand.c
index a4519a7bd683..edb9b1384143 100644
--- a/drivers/mtd/nand/socrates_nand.c
+++ b/drivers/mtd/nand/socrates_nand.c
@@ -301,8 +301,11 @@ static struct of_device_id socrates_nand_match[] =
301MODULE_DEVICE_TABLE(of, socrates_nand_match); 301MODULE_DEVICE_TABLE(of, socrates_nand_match);
302 302
303static struct of_platform_driver socrates_nand_driver = { 303static struct of_platform_driver socrates_nand_driver = {
304 .name = "socrates_nand", 304 .driver = {
305 .match_table = socrates_nand_match, 305 .name = "socrates_nand",
306 .owner = THIS_MODULE,
307 .of_match_table = socrates_nand_match,
308 },
306 .probe = socrates_nand_probe, 309 .probe = socrates_nand_probe,
307 .remove = __devexit_p(socrates_nand_remove), 310 .remove = __devexit_p(socrates_nand_remove),
308}; 311};