diff options
author | Manoj Chourasia <mchourasia@nvidia.com> | 2012-02-10 15:40:06 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 01:32:06 -0700 |
commit | 41ce51ba232ad4b27f6737f1415a4ccf88fb21c1 (patch) | |
tree | 0132f51dea212b467cf3521291ca8f9472e12d5b /drivers/mtd | |
parent | a6b2007a0bffca8f2bf01df88b2697f4940fd9f6 (diff) |
mtd: tegra-nor: Replace add_mtd_device with mtd_device_register()
The older add_mtd_device()/add_mtd_partitions() and
their removal are depricated. Replace uses with
mtd_device_register() and mtd_device_unregister().
bug 923135
Change-Id: I03790072d95ac27b4f11a6c522bb5d9de087a0df
Signed-off-by: Manoj Chourasia <mchourasia@nvidia.com>
Reviewed-on: http://git-master/r/83073
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Preetham Chandru <pchandru@nvidia.com>
Reviewed-by: Sandeep Trasi <strasi@nvidia.com>
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
Rebase-Id: R0dd0e09f1395fe10c16d826c41c929157b4ddb2f
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/maps/tegra_nor.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/mtd/maps/tegra_nor.c b/drivers/mtd/maps/tegra_nor.c index eeef1820ddcd..eab5de0d526e 100644 --- a/drivers/mtd/maps/tegra_nor.c +++ b/drivers/mtd/maps/tegra_nor.c @@ -3,7 +3,7 @@ * * MTD mapping driver for the internal SNOR controller in Tegra SoCs * - * Copyright (C) 2009 - 2011 NVIDIA Corporation + * Copyright (C) 2009 - 2012 NVIDIA Corporation * * Author: * Raghavendra VK <rvk@nvidia.com> @@ -413,13 +413,13 @@ static int tegra_nor_probe(struct platform_device *pdev) platform_set_drvdata(pdev, info); err = parse_mtd_partitions(info->mtd, part_probes, &info->parts, 0); if (err > 0) - err = add_mtd_partitions(info->mtd, info->parts, err); + err = mtd_device_register(info->mtd, info->parts, err); else if (err <= 0 && plat->flash.parts) err = - add_mtd_partitions(info->mtd, plat->flash.parts, + mtd_device_register(info->mtd, plat->flash.parts, plat->flash.nr_parts); else - add_mtd_device(info->mtd); + mtd_device_register(info->mtd, NULL, 0); return 0; @@ -436,11 +436,9 @@ static int tegra_nor_remove(struct platform_device *pdev) { struct tegra_nor_info *info = platform_get_drvdata(pdev); - if (info->parts) { - del_mtd_partitions(info->mtd); + mtd_device_unregister(info->mtd); + if (info->parts) kfree(info->parts); - } else - del_mtd_device(info->mtd); map_destroy(info->mtd); clk_disable(info->clk); clk_put(info->clk); |