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:
Grant Likely
2010-04-13 16:13:02 -07:00
parent 597b9d1e44
commit 4018294b53
146 changed files with 671 additions and 387 deletions

View File

@@ -327,12 +327,12 @@ static struct of_device_id axon_ram_device_id[] = {
};
static struct of_platform_driver axon_ram_driver = {
.match_table = axon_ram_device_id,
.probe = axon_ram_probe,
.remove = axon_ram_remove,
.driver = {
.owner = THIS_MODULE,
.name = AXON_RAM_MODULE_NAME,
.driver = {
.name = AXON_RAM_MODULE_NAME,
.owner = THIS_MODULE,
.of_match_table = axon_ram_device_id,
},
};

View File

@@ -494,14 +494,12 @@ MODULE_DEVICE_TABLE(of, mpc52xx_bcom_of_match);
static struct of_platform_driver mpc52xx_bcom_of_platform_driver = {
.owner = THIS_MODULE,
.name = DRIVER_NAME,
.match_table = mpc52xx_bcom_of_match,
.probe = mpc52xx_bcom_probe,
.remove = mpc52xx_bcom_remove,
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
.of_match_table = mpc52xx_bcom_of_match,
},
};

View File

@@ -345,8 +345,11 @@ static const struct of_device_id fsl_of_msi_ids[] = {
};
static struct of_platform_driver fsl_of_msi_driver = {
.name = "fsl-msi",
.match_table = fsl_of_msi_ids,
.driver = {
.name = "fsl-msi",
.owner = THIS_MODULE,
.of_match_table = fsl_of_msi_ids,
},
.probe = fsl_of_msi_probe,
};

View File

@@ -76,8 +76,11 @@ static const struct of_device_id pmc_ids[] = {
};
static struct of_platform_driver pmc_driver = {
.driver.name = "fsl-pmc",
.match_table = pmc_ids,
.driver = {
.name = "fsl-pmc",
.owner = THIS_MODULE,
.of_match_table = pmc_ids,
},
.probe = pmc_probe,
};

View File

@@ -1215,8 +1215,11 @@ static const struct of_device_id fsl_of_rio_rpn_ids[] = {
};
static struct of_platform_driver fsl_of_rio_rpn_driver = {
.name = "fsl-of-rio",
.match_table = fsl_of_rio_rpn_ids,
.driver = {
.name = "fsl-of-rio",
.owner = THIS_MODULE,
.of_match_table = fsl_of_rio_rpn_ids,
},
.probe = fsl_of_rio_rpn_probe,
};

View File

@@ -206,11 +206,12 @@ static int pmi_of_remove(struct of_device *dev)
}
static struct of_platform_driver pmi_of_platform_driver = {
.match_table = pmi_match,
.probe = pmi_of_probe,
.remove = pmi_of_remove,
.driver = {
.name = "pmi",
.driver = {
.name = "pmi",
.owner = THIS_MODULE,
.of_match_table = pmi_match,
},
};

View File

@@ -669,8 +669,11 @@ static const struct of_device_id qe_ids[] = {
};
static struct of_platform_driver qe_driver = {
.driver.name = "fsl-qe",
.match_table = qe_ids,
.driver = {
.name = "fsl-qe",
.owner = THIS_MODULE,
.of_match_table = qe_ids,
},
.probe = qe_probe,
.resume = qe_resume,
};