dt/net: Eliminate users of of_platform_{,un}register_driver

Get rid of users of of_platform_driver in drivers/net.  The
of_platform_{,un}register_driver functions are going away, so the
users need to be converted to using the platform_bus_type directly.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
This commit is contained in:
Grant Likely
2011-02-22 21:05:51 -07:00
parent f07eb223a0
commit 74888760d4
26 changed files with 123 additions and 128 deletions

View File

@ -998,8 +998,7 @@ static const struct net_device_ops fs_enet_netdev_ops = {
#endif
};
static int __devinit fs_enet_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit fs_enet_probe(struct platform_device *ofdev)
{
struct net_device *ndev;
struct fs_enet_private *fep;
@ -1008,11 +1007,14 @@ static int __devinit fs_enet_probe(struct platform_device *ofdev,
const u8 *mac_addr;
int privsize, len, ret = -ENODEV;
if (!ofdev->dev.of_match)
return -EINVAL;
fpi = kzalloc(sizeof(*fpi), GFP_KERNEL);
if (!fpi)
return -ENOMEM;
if (!IS_FEC(match)) {
if (!IS_FEC(ofdev->dev.of_match)) {
data = of_get_property(ofdev->dev.of_node, "fsl,cpm-command", &len);
if (!data || len != 4)
goto out_free_fpi;
@ -1047,7 +1049,7 @@ static int __devinit fs_enet_probe(struct platform_device *ofdev,
fep->dev = &ofdev->dev;
fep->ndev = ndev;
fep->fpi = fpi;
fep->ops = match->data;
fep->ops = ofdev->dev.of_match->data;
ret = fep->ops->setup_data(ndev);
if (ret)
@ -1156,7 +1158,7 @@ static struct of_device_id fs_enet_match[] = {
};
MODULE_DEVICE_TABLE(of, fs_enet_match);
static struct of_platform_driver fs_enet_driver = {
static struct platform_driver fs_enet_driver = {
.driver = {
.owner = THIS_MODULE,
.name = "fs_enet",
@ -1168,12 +1170,12 @@ static struct of_platform_driver fs_enet_driver = {
static int __init fs_init(void)
{
return of_register_platform_driver(&fs_enet_driver);
return platform_driver_register(&fs_enet_driver);
}
static void __exit fs_cleanup(void)
{
of_unregister_platform_driver(&fs_enet_driver);
platform_driver_unregister(&fs_enet_driver);
}
#ifdef CONFIG_NET_POLL_CONTROLLER

View File

@ -150,8 +150,7 @@ static int __devinit fs_mii_bitbang_init(struct mii_bus *bus,
return 0;
}
static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev)
{
struct mii_bus *new_bus;
struct bb_info *bitbang;
@ -223,7 +222,7 @@ static struct of_device_id fs_enet_mdio_bb_match[] = {
};
MODULE_DEVICE_TABLE(of, fs_enet_mdio_bb_match);
static struct of_platform_driver fs_enet_bb_mdio_driver = {
static struct platform_driver fs_enet_bb_mdio_driver = {
.driver = {
.name = "fsl-bb-mdio",
.owner = THIS_MODULE,
@ -235,12 +234,12 @@ static struct of_platform_driver fs_enet_bb_mdio_driver = {
static int fs_enet_mdio_bb_init(void)
{
return of_register_platform_driver(&fs_enet_bb_mdio_driver);
return platform_driver_register(&fs_enet_bb_mdio_driver);
}
static void fs_enet_mdio_bb_exit(void)
{
of_unregister_platform_driver(&fs_enet_bb_mdio_driver);
platform_driver_unregister(&fs_enet_bb_mdio_driver);
}
module_init(fs_enet_mdio_bb_init);

View File

@ -101,15 +101,18 @@ static int fs_enet_fec_mii_reset(struct mii_bus *bus)
return 0;
}
static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev)
{
struct resource res;
struct mii_bus *new_bus;
struct fec_info *fec;
int (*get_bus_freq)(struct device_node *) = match->data;
int (*get_bus_freq)(struct device_node *);
int ret = -ENOMEM, clock, speed;
if (!ofdev->dev.of_match)
return -EINVAL;
get_bus_freq = ofdev->dev.of_match->data;
new_bus = mdiobus_alloc();
if (!new_bus)
goto out;
@ -221,7 +224,7 @@ static struct of_device_id fs_enet_mdio_fec_match[] = {
};
MODULE_DEVICE_TABLE(of, fs_enet_mdio_fec_match);
static struct of_platform_driver fs_enet_fec_mdio_driver = {
static struct platform_driver fs_enet_fec_mdio_driver = {
.driver = {
.name = "fsl-fec-mdio",
.owner = THIS_MODULE,
@ -233,12 +236,12 @@ static struct of_platform_driver fs_enet_fec_mdio_driver = {
static int fs_enet_mdio_fec_init(void)
{
return of_register_platform_driver(&fs_enet_fec_mdio_driver);
return platform_driver_register(&fs_enet_fec_mdio_driver);
}
static void fs_enet_mdio_fec_exit(void)
{
of_unregister_platform_driver(&fs_enet_fec_mdio_driver);
platform_driver_unregister(&fs_enet_fec_mdio_driver);
}
module_init(fs_enet_mdio_fec_init);