From d7ba2218517e3860c6db52e907a929aafe832fa5 Mon Sep 17 00:00:00 2001 From: Manoj Chourasia Date: Fri, 10 Feb 2012 15:40:06 +0530 Subject: 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 Reviewed-on: http://git-master/r/83073 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Preetham Chandru Reviewed-by: Sandeep Trasi Reviewed-by: Varun Wadekar --- drivers/mtd/maps/tegra_nor.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'drivers/mtd') 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 @@ -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); -- cgit v1.2.3