summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorManoj Chourasia <mchourasia@nvidia.com>2012-02-10 15:40:06 +0530
committerRohan Somvanshi <rsomvanshi@nvidia.com>2012-02-13 06:24:23 -0800
commitd7ba2218517e3860c6db52e907a929aafe832fa5 (patch)
tree120a38c3b51e8c6ed137c24b6d4f283e9f959f3e /drivers/mtd
parent7d5cf684a667699ced366f377c8505d4ae6d121a (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>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/maps/tegra_nor.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/mtd/maps/tegra_nor.c b/drivers/mtd/maps/tegra_nor.c
index a423bb2b84d0..2059ce066cbb 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);