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:
@@ -393,15 +393,17 @@ static struct of_device_id __devinitdata mpc5xxx_can_table[] = {
|
||||
};
|
||||
|
||||
static struct of_platform_driver mpc5xxx_can_driver = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "mpc5xxx_can",
|
||||
.driver = {
|
||||
.name = "mpc5xxx_can",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = mpc5xxx_can_table,
|
||||
},
|
||||
.probe = mpc5xxx_can_probe,
|
||||
.remove = __devexit_p(mpc5xxx_can_remove),
|
||||
#ifdef CONFIG_PM
|
||||
.suspend = mpc5xxx_can_suspend,
|
||||
.resume = mpc5xxx_can_resume,
|
||||
#endif
|
||||
.match_table = mpc5xxx_can_table,
|
||||
};
|
||||
|
||||
static int __init mpc5xxx_can_init(void)
|
||||
|
@@ -216,11 +216,13 @@ static struct of_device_id __devinitdata sja1000_ofp_table[] = {
|
||||
MODULE_DEVICE_TABLE(of, sja1000_ofp_table);
|
||||
|
||||
static struct of_platform_driver sja1000_ofp_driver = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = DRV_NAME,
|
||||
.driver = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = DRV_NAME,
|
||||
.of_match_table = sja1000_ofp_table,
|
||||
},
|
||||
.probe = sja1000_ofp_probe,
|
||||
.remove = __devexit_p(sja1000_ofp_remove),
|
||||
.match_table = sja1000_ofp_table,
|
||||
};
|
||||
|
||||
static int __init sja1000_ofp_init(void)
|
||||
|
Reference in New Issue
Block a user