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 <[email protected]>
Acked-by: Sean MacLennan <[email protected]>
This commit is contained in:
Grant Likely 2010-04-13 16:13:02 -07:00
commit 4018294b53
146 changed files with 671 additions and 387 deletions

View file

@ -677,8 +677,11 @@ static const struct of_device_id cpwd_match[] = {
MODULE_DEVICE_TABLE(of, cpwd_match);
static struct of_platform_driver cpwd_driver = {
.name = DRIVER_NAME,
.match_table = cpwd_match,
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
.of_match_table = cpwd_match,
},
.probe = cpwd_probe,
.remove = __devexit_p(cpwd_remove),
};

View file

@ -303,9 +303,11 @@ static const struct of_device_id gef_wdt_ids[] = {
};
static struct of_platform_driver gef_wdt_driver = {
.owner = THIS_MODULE,
.name = "gef_wdt",
.match_table = gef_wdt_ids,
.driver = {
.name = "gef_wdt",
.owner = THIS_MODULE,
.of_match_table = gef_wdt_ids,
},
.probe = gef_wdt_probe,
};

View file

@ -273,12 +273,12 @@ static const struct of_device_id mpc8xxx_wdt_match[] = {
MODULE_DEVICE_TABLE(of, mpc8xxx_wdt_match);
static struct of_platform_driver mpc8xxx_wdt_driver = {
.match_table = mpc8xxx_wdt_match,
.probe = mpc8xxx_wdt_probe,
.remove = __devexit_p(mpc8xxx_wdt_remove),
.driver = {
.name = "mpc8xxx_wdt",
.owner = THIS_MODULE,
.driver = {
.name = "mpc8xxx_wdt",
.owner = THIS_MODULE,
.of_match_table = mpc8xxx_wdt_match,
},
};

View file

@ -239,8 +239,11 @@ static const struct of_device_id riowd_match[] = {
MODULE_DEVICE_TABLE(of, riowd_match);
static struct of_platform_driver riowd_driver = {
.name = DRIVER_NAME,
.match_table = riowd_match,
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
.of_match_table = riowd_match,
},
.probe = riowd_probe,
.remove = __devexit_p(riowd_remove),
};