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>
This commit is contained in:
@@ -174,8 +174,11 @@ static struct of_device_id __initdata apc_match[] = {
|
||||
MODULE_DEVICE_TABLE(of, apc_match);
|
||||
|
||||
static struct of_platform_driver apc_driver = {
|
||||
.name = "apc",
|
||||
.match_table = apc_match,
|
||||
.driver = {
|
||||
.name = "apc",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = apc_match,
|
||||
},
|
||||
.probe = apc_probe,
|
||||
};
|
||||
|
||||
|
@@ -132,10 +132,11 @@ static int __devinit auxio_probe(struct of_device *dev, const struct of_device_i
|
||||
}
|
||||
|
||||
static struct of_platform_driver auxio_driver = {
|
||||
.match_table = auxio_match,
|
||||
.probe = auxio_probe,
|
||||
.driver = {
|
||||
.name = "auxio",
|
||||
.driver = {
|
||||
.name = "auxio",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = auxio_match,
|
||||
},
|
||||
};
|
||||
|
||||
|
@@ -149,10 +149,11 @@ static struct of_device_id __initdata clock_board_match[] = {
|
||||
};
|
||||
|
||||
static struct of_platform_driver clock_board_driver = {
|
||||
.match_table = clock_board_match,
|
||||
.probe = clock_board_probe,
|
||||
.driver = {
|
||||
.name = "clock_board",
|
||||
.driver = {
|
||||
.name = "clock_board",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = clock_board_match,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -254,10 +255,11 @@ static struct of_device_id __initdata fhc_match[] = {
|
||||
};
|
||||
|
||||
static struct of_platform_driver fhc_driver = {
|
||||
.match_table = fhc_match,
|
||||
.probe = fhc_probe,
|
||||
.driver = {
|
||||
.name = "fhc",
|
||||
.driver = {
|
||||
.name = "fhc",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = fhc_match,
|
||||
},
|
||||
};
|
||||
|
||||
|
@@ -811,8 +811,11 @@ static const struct of_device_id us3mc_match[] = {
|
||||
MODULE_DEVICE_TABLE(of, us3mc_match);
|
||||
|
||||
static struct of_platform_driver us3mc_driver = {
|
||||
.name = "us3mc",
|
||||
.match_table = us3mc_match,
|
||||
.driver = {
|
||||
.name = "us3mc",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = us3mc_match,
|
||||
},
|
||||
.probe = us3mc_probe,
|
||||
.remove = __devexit_p(us3mc_remove),
|
||||
};
|
||||
|
@@ -508,8 +508,11 @@ static struct of_device_id __initdata fire_match[] = {
|
||||
};
|
||||
|
||||
static struct of_platform_driver fire_driver = {
|
||||
.name = DRIVER_NAME,
|
||||
.match_table = fire_match,
|
||||
.driver = {
|
||||
.name = DRIVER_NAME,
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = fire_match,
|
||||
},
|
||||
.probe = fire_probe,
|
||||
};
|
||||
|
||||
|
@@ -602,8 +602,11 @@ static struct of_device_id __initdata psycho_match[] = {
|
||||
};
|
||||
|
||||
static struct of_platform_driver psycho_driver = {
|
||||
.name = DRIVER_NAME,
|
||||
.match_table = psycho_match,
|
||||
.driver = {
|
||||
.name = DRIVER_NAME,
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = psycho_match,
|
||||
},
|
||||
.probe = psycho_probe,
|
||||
};
|
||||
|
||||
|
@@ -596,8 +596,11 @@ static struct of_device_id __initdata sabre_match[] = {
|
||||
};
|
||||
|
||||
static struct of_platform_driver sabre_driver = {
|
||||
.name = DRIVER_NAME,
|
||||
.match_table = sabre_match,
|
||||
.driver = {
|
||||
.name = DRIVER_NAME,
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = sabre_match,
|
||||
},
|
||||
.probe = sabre_probe,
|
||||
};
|
||||
|
||||
|
@@ -1491,8 +1491,11 @@ static struct of_device_id __initdata schizo_match[] = {
|
||||
};
|
||||
|
||||
static struct of_platform_driver schizo_driver = {
|
||||
.name = DRIVER_NAME,
|
||||
.match_table = schizo_match,
|
||||
.driver = {
|
||||
.name = DRIVER_NAME,
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = schizo_match,
|
||||
},
|
||||
.probe = schizo_probe,
|
||||
};
|
||||
|
||||
|
@@ -1009,8 +1009,11 @@ static struct of_device_id __initdata pci_sun4v_match[] = {
|
||||
};
|
||||
|
||||
static struct of_platform_driver pci_sun4v_driver = {
|
||||
.name = DRIVER_NAME,
|
||||
.match_table = pci_sun4v_match,
|
||||
.driver = {
|
||||
.name = DRIVER_NAME,
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = pci_sun4v_match,
|
||||
},
|
||||
.probe = pci_sun4v_probe,
|
||||
};
|
||||
|
||||
|
@@ -79,8 +79,11 @@ static struct of_device_id __initdata pmc_match[] = {
|
||||
MODULE_DEVICE_TABLE(of, pmc_match);
|
||||
|
||||
static struct of_platform_driver pmc_driver = {
|
||||
.name = "pmc",
|
||||
.match_table = pmc_match,
|
||||
.driver = {
|
||||
.name = "pmc",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = pmc_match,
|
||||
},
|
||||
.probe = pmc_probe,
|
||||
};
|
||||
|
||||
|
@@ -60,10 +60,11 @@ static struct of_device_id __initdata power_match[] = {
|
||||
};
|
||||
|
||||
static struct of_platform_driver power_driver = {
|
||||
.match_table = power_match,
|
||||
.probe = power_probe,
|
||||
.driver = {
|
||||
.name = "power",
|
||||
.driver = {
|
||||
.name = "power",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = power_match,
|
||||
},
|
||||
};
|
||||
|
||||
|
@@ -185,10 +185,11 @@ static struct of_device_id __initdata clock_match[] = {
|
||||
};
|
||||
|
||||
static struct of_platform_driver clock_driver = {
|
||||
.match_table = clock_match,
|
||||
.probe = clock_probe,
|
||||
.driver = {
|
||||
.name = "rtc",
|
||||
.driver = {
|
||||
.name = "rtc",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = clock_match,
|
||||
},
|
||||
};
|
||||
|
||||
|
@@ -463,10 +463,11 @@ static struct of_device_id __initdata rtc_match[] = {
|
||||
};
|
||||
|
||||
static struct of_platform_driver rtc_driver = {
|
||||
.match_table = rtc_match,
|
||||
.probe = rtc_probe,
|
||||
.driver = {
|
||||
.name = "rtc",
|
||||
.driver = {
|
||||
.name = "rtc",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = rtc_match,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -495,10 +496,11 @@ static struct of_device_id __initdata bq4802_match[] = {
|
||||
};
|
||||
|
||||
static struct of_platform_driver bq4802_driver = {
|
||||
.match_table = bq4802_match,
|
||||
.probe = bq4802_probe,
|
||||
.driver = {
|
||||
.name = "bq4802",
|
||||
.driver = {
|
||||
.name = "bq4802",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = bq4802_match,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -558,10 +560,11 @@ static struct of_device_id __initdata mostek_match[] = {
|
||||
};
|
||||
|
||||
static struct of_platform_driver mostek_driver = {
|
||||
.match_table = mostek_match,
|
||||
.probe = mostek_probe,
|
||||
.driver = {
|
||||
.name = "mostek",
|
||||
.driver = {
|
||||
.name = "mostek",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = mostek_match,
|
||||
},
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user