Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 74888760 authored by Grant Likely's avatar Grant Likely
Browse files

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: default avatarGrant Likely <grant.likely@secretlab.ca>
parent f07eb223
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -247,10 +247,9 @@ static u32 __devinit mpc512x_can_get_clock(struct platform_device *ofdev,
}
#endif /* CONFIG_PPC_MPC512x */

static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev,
				       const struct of_device_id *id)
static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev)
{
	struct mpc5xxx_can_data *data = (struct mpc5xxx_can_data *)id->data;
	struct mpc5xxx_can_data *data;
	struct device_node *np = ofdev->dev.of_node;
	struct net_device *dev;
	struct mscan_priv *priv;
@@ -259,6 +258,10 @@ static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev,
	int irq, mscan_clksrc = 0;
	int err = -ENOMEM;

	if (!ofdev->dev.of_match)
		return -EINVAL;
	data = (struct mpc5xxx_can_data *)of_dev->dev.of_match->data;

	base = of_iomap(np, 0);
	if (!base) {
		dev_err(&ofdev->dev, "couldn't ioremap\n");
@@ -391,7 +394,7 @@ static struct of_device_id __devinitdata mpc5xxx_can_table[] = {
	{},
};

static struct of_platform_driver mpc5xxx_can_driver = {
static struct platform_driver mpc5xxx_can_driver = {
	.driver = {
		.name = "mpc5xxx_can",
		.owner = THIS_MODULE,
@@ -407,13 +410,13 @@ static struct of_platform_driver mpc5xxx_can_driver = {

static int __init mpc5xxx_can_init(void)
{
	return of_register_platform_driver(&mpc5xxx_can_driver);
	return platform_driver_register(&mpc5xxx_can_driver);
}
module_init(mpc5xxx_can_init);

static void __exit mpc5xxx_can_exit(void)
{
	return of_unregister_platform_driver(&mpc5xxx_can_driver);
	platform_driver_unregister(&mpc5xxx_can_driver);
};
module_exit(mpc5xxx_can_exit);

+4 −5
Original line number Diff line number Diff line
@@ -87,8 +87,7 @@ static int __devexit sja1000_ofp_remove(struct platform_device *ofdev)
	return 0;
}

static int __devinit sja1000_ofp_probe(struct platform_device *ofdev,
				       const struct of_device_id *id)
static int __devinit sja1000_ofp_probe(struct platform_device *ofdev)
{
	struct device_node *np = ofdev->dev.of_node;
	struct net_device *dev;
@@ -210,7 +209,7 @@ static struct of_device_id __devinitdata sja1000_ofp_table[] = {
};
MODULE_DEVICE_TABLE(of, sja1000_ofp_table);

static struct of_platform_driver sja1000_ofp_driver = {
static struct platform_driver sja1000_ofp_driver = {
	.driver = {
		.owner = THIS_MODULE,
		.name = DRV_NAME,
@@ -222,12 +221,12 @@ static struct of_platform_driver sja1000_ofp_driver = {

static int __init sja1000_ofp_init(void)
{
	return of_register_platform_driver(&sja1000_ofp_driver);
	return platform_driver_register(&sja1000_ofp_driver);
}
module_init(sja1000_ofp_init);

static void __exit sja1000_ofp_exit(void)
{
	return of_unregister_platform_driver(&sja1000_ofp_driver);
	return platform_driver_unregister(&sja1000_ofp_driver);
};
module_exit(sja1000_ofp_exit);
+6 −7
Original line number Diff line number Diff line
@@ -840,8 +840,7 @@ static const struct net_device_ops mpc52xx_fec_netdev_ops = {
/* OF Driver                                                                */
/* ======================================================================== */

static int __devinit
mpc52xx_fec_probe(struct platform_device *op, const struct of_device_id *match)
static int __devinit mpc52xx_fec_probe(struct platform_device *op)
{
	int rv;
	struct net_device *ndev;
@@ -1049,7 +1048,7 @@ static struct of_device_id mpc52xx_fec_match[] = {

MODULE_DEVICE_TABLE(of, mpc52xx_fec_match);

static struct of_platform_driver mpc52xx_fec_driver = {
static struct platform_driver mpc52xx_fec_driver = {
	.driver = {
		.name = DRIVER_NAME,
		.owner = THIS_MODULE,
@@ -1073,21 +1072,21 @@ mpc52xx_fec_init(void)
{
#ifdef CONFIG_FEC_MPC52xx_MDIO
	int ret;
	ret = of_register_platform_driver(&mpc52xx_fec_mdio_driver);
	ret = platform_driver_register(&mpc52xx_fec_mdio_driver);
	if (ret) {
		printk(KERN_ERR DRIVER_NAME ": failed to register mdio driver\n");
		return ret;
	}
#endif
	return of_register_platform_driver(&mpc52xx_fec_driver);
	return platform_driver_register(&mpc52xx_fec_driver);
}

static void __exit
mpc52xx_fec_exit(void)
{
	of_unregister_platform_driver(&mpc52xx_fec_driver);
	platform_driver_unregister(&mpc52xx_fec_driver);
#ifdef CONFIG_FEC_MPC52xx_MDIO
	of_unregister_platform_driver(&mpc52xx_fec_mdio_driver);
	platform_driver_unregister(&mpc52xx_fec_mdio_driver);
#endif
}

+1 −1
Original line number Diff line number Diff line
@@ -289,6 +289,6 @@ struct mpc52xx_fec {
#define FEC_XMIT_FSM_ENABLE_CRC		0x01000000


extern struct of_platform_driver mpc52xx_fec_mdio_driver;
extern struct platform_driver mpc52xx_fec_mdio_driver;

#endif	/* __DRIVERS_NET_MPC52XX_FEC_H__ */
+2 −3
Original line number Diff line number Diff line
@@ -61,8 +61,7 @@ static int mpc52xx_fec_mdio_write(struct mii_bus *bus, int phy_id, int reg,
		data | FEC_MII_WRITE_FRAME);
}

static int mpc52xx_fec_mdio_probe(struct platform_device *of,
		const struct of_device_id *match)
static int mpc52xx_fec_mdio_probe(struct platform_device *of)
{
	struct device *dev = &of->dev;
	struct device_node *np = of->dev.of_node;
@@ -145,7 +144,7 @@ static struct of_device_id mpc52xx_fec_mdio_match[] = {
};
MODULE_DEVICE_TABLE(of, mpc52xx_fec_mdio_match);

struct of_platform_driver mpc52xx_fec_mdio_driver = {
struct platform_driver mpc52xx_fec_mdio_driver = {
	.driver = {
		.name = "mpc5200b-fec-phy",
		.owner = THIS_MODULE,
Loading