Skip to content
Snippets Groups Projects
Commit 4018294b authored by Grant Likely's avatar Grant Likely
Browse files

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: default avatarGrant Likely <grant.likely@secretlab.ca>
Acked-by: default avatarSean MacLennan <smaclennan@pikatech.com>
parent 597b9d1e
No related merge requests found
Showing
with 91 additions and 56 deletions
...@@ -201,9 +201,6 @@ static int ibmebus_create_devices(const struct of_device_id *matches) ...@@ -201,9 +201,6 @@ static int ibmebus_create_devices(const struct of_device_id *matches)
int ibmebus_register_driver(struct of_platform_driver *drv) int ibmebus_register_driver(struct of_platform_driver *drv)
{ {
if (!drv->driver.of_match_table)
drv->driver.of_match_table = drv->match_table;
/* If the driver uses devices that ibmebus doesn't know, add them */ /* If the driver uses devices that ibmebus doesn't know, add them */
ibmebus_create_devices(drv->driver.of_match_table); ibmebus_create_devices(drv->driver.of_match_table);
......
...@@ -306,10 +306,11 @@ static struct of_device_id of_pci_phb_ids[] = { ...@@ -306,10 +306,11 @@ static struct of_device_id of_pci_phb_ids[] = {
}; };
static struct of_platform_driver of_pci_phb_driver = { static struct of_platform_driver of_pci_phb_driver = {
.match_table = of_pci_phb_ids,
.probe = of_pci_phb_probe, .probe = of_pci_phb_probe,
.driver = { .driver = {
.name = "of-pci", .name = "of-pci",
.owner = THIS_MODULE,
.of_match_table = of_pci_phb_ids,
}, },
}; };
......
...@@ -193,8 +193,11 @@ static const struct of_device_id mpc52xx_wkup_gpiochip_match[] = { ...@@ -193,8 +193,11 @@ static const struct of_device_id mpc52xx_wkup_gpiochip_match[] = {
}; };
static struct of_platform_driver mpc52xx_wkup_gpiochip_driver = { static struct of_platform_driver mpc52xx_wkup_gpiochip_driver = {
.name = "gpio_wkup", .driver = {
.match_table = mpc52xx_wkup_gpiochip_match, .name = "gpio_wkup",
.owner = THIS_MODULE,
.of_match_table = mpc52xx_wkup_gpiochip_match,
},
.probe = mpc52xx_wkup_gpiochip_probe, .probe = mpc52xx_wkup_gpiochip_probe,
.remove = mpc52xx_gpiochip_remove, .remove = mpc52xx_gpiochip_remove,
}; };
...@@ -349,8 +352,11 @@ static const struct of_device_id mpc52xx_simple_gpiochip_match[] = { ...@@ -349,8 +352,11 @@ static const struct of_device_id mpc52xx_simple_gpiochip_match[] = {
}; };
static struct of_platform_driver mpc52xx_simple_gpiochip_driver = { static struct of_platform_driver mpc52xx_simple_gpiochip_driver = {
.name = "gpio", .driver = {
.match_table = mpc52xx_simple_gpiochip_match, .name = "gpio",
.owner = THIS_MODULE,
.of_match_table = mpc52xx_simple_gpiochip_match,
},
.probe = mpc52xx_simple_gpiochip_probe, .probe = mpc52xx_simple_gpiochip_probe,
.remove = mpc52xx_gpiochip_remove, .remove = mpc52xx_gpiochip_remove,
}; };
......
...@@ -784,8 +784,11 @@ static const struct of_device_id mpc52xx_gpt_match[] = { ...@@ -784,8 +784,11 @@ static const struct of_device_id mpc52xx_gpt_match[] = {
}; };
static struct of_platform_driver mpc52xx_gpt_driver = { static struct of_platform_driver mpc52xx_gpt_driver = {
.name = "mpc52xx-gpt", .driver = {
.match_table = mpc52xx_gpt_match, .name = "mpc52xx-gpt",
.owner = THIS_MODULE,
.of_match_table = mpc52xx_gpt_match,
},
.probe = mpc52xx_gpt_probe, .probe = mpc52xx_gpt_probe,
.remove = mpc52xx_gpt_remove, .remove = mpc52xx_gpt_remove,
}; };
......
...@@ -537,9 +537,11 @@ static struct of_device_id mpc52xx_lpbfifo_match[] __devinitconst = { ...@@ -537,9 +537,11 @@ static struct of_device_id mpc52xx_lpbfifo_match[] __devinitconst = {
}; };
static struct of_platform_driver mpc52xx_lpbfifo_driver = { static struct of_platform_driver mpc52xx_lpbfifo_driver = {
.owner = THIS_MODULE, .driver = {
.name = "mpc52xx-lpbfifo", .name = "mpc52xx-lpbfifo",
.match_table = mpc52xx_lpbfifo_match, .owner = THIS_MODULE,
.of_match_table = mpc52xx_lpbfifo_match,
},
.probe = mpc52xx_lpbfifo_probe, .probe = mpc52xx_lpbfifo_probe,
.remove = __devexit_p(mpc52xx_lpbfifo_remove), .remove = __devexit_p(mpc52xx_lpbfifo_remove),
}; };
......
...@@ -170,8 +170,9 @@ static const struct of_device_id ep8248e_mdio_match[] = { ...@@ -170,8 +170,9 @@ static const struct of_device_id ep8248e_mdio_match[] = {
static struct of_platform_driver ep8248e_mdio_driver = { static struct of_platform_driver ep8248e_mdio_driver = {
.driver = { .driver = {
.name = "ep8248e-mdio-bitbang", .name = "ep8248e-mdio-bitbang",
.owner = THIS_MODULE,
.of_match_table = ep8248e_mdio_match,
}, },
.match_table = ep8248e_mdio_match,
.probe = ep8248e_mdio_probe, .probe = ep8248e_mdio_probe,
.remove = ep8248e_mdio_remove, .remove = ep8248e_mdio_remove,
}; };
......
...@@ -423,8 +423,11 @@ static struct of_device_id pmc_match[] = { ...@@ -423,8 +423,11 @@ static struct of_device_id pmc_match[] = {
}; };
static struct of_platform_driver pmc_driver = { static struct of_platform_driver pmc_driver = {
.name = "mpc83xx-pmc", .driver = {
.match_table = pmc_match, .name = "mpc83xx-pmc",
.owner = THIS_MODULE,
.of_match_table = pmc_match,
},
.probe = pmc_probe, .probe = pmc_probe,
.remove = pmc_remove .remove = pmc_remove
}; };
......
...@@ -447,11 +447,12 @@ static const struct of_device_id axon_msi_device_id[] = { ...@@ -447,11 +447,12 @@ static const struct of_device_id axon_msi_device_id[] = {
}; };
static struct of_platform_driver axon_msi_driver = { static struct of_platform_driver axon_msi_driver = {
.match_table = axon_msi_device_id,
.probe = axon_msi_probe, .probe = axon_msi_probe,
.shutdown = axon_msi_shutdown, .shutdown = axon_msi_shutdown,
.driver = { .driver = {
.name = "axon-msi" .name = "axon-msi",
.owner = THIS_MODULE,
.of_match_table = axon_msi_device_id,
}, },
}; };
......
...@@ -301,11 +301,12 @@ MODULE_DEVICE_TABLE(of, gpio_mdio_match); ...@@ -301,11 +301,12 @@ MODULE_DEVICE_TABLE(of, gpio_mdio_match);
static struct of_platform_driver gpio_mdio_driver = static struct of_platform_driver gpio_mdio_driver =
{ {
.match_table = gpio_mdio_match,
.probe = gpio_mdio_probe, .probe = gpio_mdio_probe,
.remove = gpio_mdio_remove, .remove = gpio_mdio_remove,
.driver = { .driver = {
.name = "gpio-mdio-bitbang", .name = "gpio-mdio-bitbang",
.owner = THIS_MODULE,
.of_match_table = gpio_mdio_match,
}, },
}; };
......
...@@ -327,12 +327,12 @@ static struct of_device_id axon_ram_device_id[] = { ...@@ -327,12 +327,12 @@ static struct of_device_id axon_ram_device_id[] = {
}; };
static struct of_platform_driver axon_ram_driver = { static struct of_platform_driver axon_ram_driver = {
.match_table = axon_ram_device_id,
.probe = axon_ram_probe, .probe = axon_ram_probe,
.remove = axon_ram_remove, .remove = axon_ram_remove,
.driver = { .driver = {
.owner = THIS_MODULE, .name = AXON_RAM_MODULE_NAME,
.name = AXON_RAM_MODULE_NAME, .owner = THIS_MODULE,
.of_match_table = axon_ram_device_id,
}, },
}; };
......
...@@ -494,14 +494,12 @@ MODULE_DEVICE_TABLE(of, mpc52xx_bcom_of_match); ...@@ -494,14 +494,12 @@ MODULE_DEVICE_TABLE(of, mpc52xx_bcom_of_match);
static struct of_platform_driver mpc52xx_bcom_of_platform_driver = { 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, .probe = mpc52xx_bcom_probe,
.remove = mpc52xx_bcom_remove, .remove = mpc52xx_bcom_remove,
.driver = { .driver = {
.name = DRIVER_NAME, .name = DRIVER_NAME,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.of_match_table = mpc52xx_bcom_of_match,
}, },
}; };
......
...@@ -345,8 +345,11 @@ static const struct of_device_id fsl_of_msi_ids[] = { ...@@ -345,8 +345,11 @@ static const struct of_device_id fsl_of_msi_ids[] = {
}; };
static struct of_platform_driver fsl_of_msi_driver = { static struct of_platform_driver fsl_of_msi_driver = {
.name = "fsl-msi", .driver = {
.match_table = fsl_of_msi_ids, .name = "fsl-msi",
.owner = THIS_MODULE,
.of_match_table = fsl_of_msi_ids,
},
.probe = fsl_of_msi_probe, .probe = fsl_of_msi_probe,
}; };
......
...@@ -76,8 +76,11 @@ static const struct of_device_id pmc_ids[] = { ...@@ -76,8 +76,11 @@ static const struct of_device_id pmc_ids[] = {
}; };
static struct of_platform_driver pmc_driver = { static struct of_platform_driver pmc_driver = {
.driver.name = "fsl-pmc", .driver = {
.match_table = pmc_ids, .name = "fsl-pmc",
.owner = THIS_MODULE,
.of_match_table = pmc_ids,
},
.probe = pmc_probe, .probe = pmc_probe,
}; };
......
...@@ -1215,8 +1215,11 @@ static const struct of_device_id fsl_of_rio_rpn_ids[] = { ...@@ -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 = { static struct of_platform_driver fsl_of_rio_rpn_driver = {
.name = "fsl-of-rio", .driver = {
.match_table = fsl_of_rio_rpn_ids, .name = "fsl-of-rio",
.owner = THIS_MODULE,
.of_match_table = fsl_of_rio_rpn_ids,
},
.probe = fsl_of_rio_rpn_probe, .probe = fsl_of_rio_rpn_probe,
}; };
......
...@@ -206,11 +206,12 @@ static int pmi_of_remove(struct of_device *dev) ...@@ -206,11 +206,12 @@ static int pmi_of_remove(struct of_device *dev)
} }
static struct of_platform_driver pmi_of_platform_driver = { static struct of_platform_driver pmi_of_platform_driver = {
.match_table = pmi_match,
.probe = pmi_of_probe, .probe = pmi_of_probe,
.remove = pmi_of_remove, .remove = pmi_of_remove,
.driver = { .driver = {
.name = "pmi", .name = "pmi",
.owner = THIS_MODULE,
.of_match_table = pmi_match,
}, },
}; };
......
...@@ -669,8 +669,11 @@ static const struct of_device_id qe_ids[] = { ...@@ -669,8 +669,11 @@ static const struct of_device_id qe_ids[] = {
}; };
static struct of_platform_driver qe_driver = { static struct of_platform_driver qe_driver = {
.driver.name = "fsl-qe", .driver = {
.match_table = qe_ids, .name = "fsl-qe",
.owner = THIS_MODULE,
.of_match_table = qe_ids,
},
.probe = qe_probe, .probe = qe_probe,
.resume = qe_resume, .resume = qe_resume,
}; };
......
...@@ -232,8 +232,11 @@ static const struct of_device_id ecpp_match[] = { ...@@ -232,8 +232,11 @@ static const struct of_device_id ecpp_match[] = {
}; };
static struct of_platform_driver ecpp_driver = { static struct of_platform_driver ecpp_driver = {
.name = "ecpp", .driver = {
.match_table = ecpp_match, .name = "ecpp",
.owner = THIS_MODULE,
.of_match_table = ecpp_match,
},
.probe = ecpp_probe, .probe = ecpp_probe,
.remove = __devexit_p(ecpp_remove), .remove = __devexit_p(ecpp_remove),
}; };
......
...@@ -174,8 +174,11 @@ static struct of_device_id __initdata apc_match[] = { ...@@ -174,8 +174,11 @@ static struct of_device_id __initdata apc_match[] = {
MODULE_DEVICE_TABLE(of, apc_match); MODULE_DEVICE_TABLE(of, apc_match);
static struct of_platform_driver apc_driver = { static struct of_platform_driver apc_driver = {
.name = "apc", .driver = {
.match_table = apc_match, .name = "apc",
.owner = THIS_MODULE,
.of_match_table = apc_match,
},
.probe = apc_probe, .probe = apc_probe,
}; };
......
...@@ -132,10 +132,11 @@ static int __devinit auxio_probe(struct of_device *dev, const struct of_device_i ...@@ -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 = { static struct of_platform_driver auxio_driver = {
.match_table = auxio_match,
.probe = auxio_probe, .probe = auxio_probe,
.driver = { .driver = {
.name = "auxio", .name = "auxio",
.owner = THIS_MODULE,
.of_match_table = auxio_match,
}, },
}; };
......
...@@ -149,10 +149,11 @@ static struct of_device_id __initdata clock_board_match[] = { ...@@ -149,10 +149,11 @@ static struct of_device_id __initdata clock_board_match[] = {
}; };
static struct of_platform_driver clock_board_driver = { static struct of_platform_driver clock_board_driver = {
.match_table = clock_board_match,
.probe = clock_board_probe, .probe = clock_board_probe,
.driver = { .driver = {
.name = "clock_board", .name = "clock_board",
.owner = THIS_MODULE,
.of_match_table = clock_board_match,
}, },
}; };
...@@ -254,10 +255,11 @@ static struct of_device_id __initdata fhc_match[] = { ...@@ -254,10 +255,11 @@ static struct of_device_id __initdata fhc_match[] = {
}; };
static struct of_platform_driver fhc_driver = { static struct of_platform_driver fhc_driver = {
.match_table = fhc_match,
.probe = fhc_probe, .probe = fhc_probe,
.driver = { .driver = {
.name = "fhc", .name = "fhc",
.owner = THIS_MODULE,
.of_match_table = fhc_match,
}, },
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment