mfd: tps80031: remove support for subdevs registration
Laxman Dewangan [Sun, 5 Aug 2012 08:01:20 +0000 (13:01 +0530)]
The mfd sub devices should get added through the
mfd_add_devices() not through legacy style of
adding sub devices.

Change-Id: If275d41629d799f1e22d95fd442ebe7d3ace448e
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/121137
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>

arch/arm/mach-tegra/board-enterprise-power.c
drivers/mfd/tps80031.c
include/linux/mfd/tps80031.h

index cfcfe9e..f974c49 100644 (file)
@@ -721,9 +721,6 @@ int __init enterprise_regulator_init(void)
                battery_gauge_data.battery_present = 0;
        }
 
-       tps_platform.num_subdevs = ARRAY_SIZE(tps80031_devs);
-       tps_platform.subdevs = tps80031_devs;
-
        if (board_info.fab < BOARD_FAB_A03) {
                tps_platform.num_regulator_pdata = ARRAY_SIZE(tps80031_reg_pdata_a02);
                tps_platform.regulator_pdata = tps80031_reg_pdata_a02;
index 10ae059..002b7d0 100644 (file)
@@ -691,17 +691,6 @@ static void tps80031_gpio_init(struct tps80031 *tps80031,
                dev_warn(tps80031->dev, "GPIO registration failed: %d\n", ret);
 }
 
-static int __remove_subdev(struct device *dev, void *unused)
-{
-       platform_device_unregister(to_platform_device(dev));
-       return 0;
-}
-
-static int tps80031_remove_subdevs(struct tps80031 *tps80031)
-{
-       return device_for_each_child(tps80031->dev, NULL, __remove_subdev);
-}
-
 static void tps80031_irq_lock(struct irq_data *data)
 {
        struct tps80031 *tps80031 = irq_data_get_irq_chip_data(data);
@@ -1024,32 +1013,6 @@ static void tps80031_clk32k_init(struct tps80031 *tps80031,
        }
 }
 
-static int __devinit tps80031_add_subdevs(struct tps80031 *tps80031,
-                                         struct tps80031_platform_data *pdata)
-{
-       struct tps80031_subdev_info *subdev;
-       struct platform_device *pdev;
-       int i, ret = 0;
-
-       for (i = 0; i < pdata->num_subdevs; i++) {
-               subdev = &pdata->subdevs[i];
-
-               pdev = platform_device_alloc(subdev->name, subdev->id);
-
-               pdev->dev.parent = tps80031->dev;
-               pdev->dev.platform_data = subdev->platform_data;
-
-               ret = platform_device_add(pdev);
-               if (ret)
-                       goto failed;
-       }
-       return 0;
-
-failed:
-       tps80031_remove_subdevs(tps80031);
-       return ret;
-}
-
 #ifdef CONFIG_DEBUG_FS
 #include <linux/debugfs.h>
 #include <linux/seq_file.h>
@@ -1360,12 +1323,6 @@ static int __devinit tps80031_i2c_probe(struct i2c_client *client,
                goto fail_mfd_add;
        }
 
-       ret = tps80031_add_subdevs(tps80031, pdata);
-       if (ret) {
-               dev_err(&client->dev, "add devices failed: %d\n", ret);
-               goto fail_add_subdev;
-       }
-
        tps80031_gpio_init(tps80031, pdata);
 
        tps80031_clk32k_init(tps80031, pdata);
@@ -1381,9 +1338,6 @@ static int __devinit tps80031_i2c_probe(struct i2c_client *client,
 
        return 0;
 
-fail_add_subdev:
-       mfd_remove_devices(tps80031->dev);
-
 fail_mfd_add:
        if (client->irq)
                free_irq(client->irq, tps80031);
index 573c8a5..2fa29e9 100644 (file)
@@ -190,8 +190,6 @@ struct tps80031_bg_platform_data {
 };
 
 struct tps80031_platform_data {
-       int num_subdevs;
-       struct tps80031_subdev_info *subdevs;
        int gpio_base;
        int irq_base;
        struct tps80031_32kclock_plat_data *clk32k_pdata;