Commit 6f12f59a authored by Julia Lawall's avatar Julia Lawall Committed by David Woodhouse

mtd: autcpu12-nvram: drop frees of devm_ alloc'd data

devm free functions should not have to be explicitly used.
Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent fac0077c
...@@ -38,7 +38,6 @@ static int __devinit autcpu12_nvram_probe(struct platform_device *pdev) ...@@ -38,7 +38,6 @@ static int __devinit autcpu12_nvram_probe(struct platform_device *pdev)
map_word tmp, save0, save1; map_word tmp, save0, save1;
struct resource *res; struct resource *res;
struct autcpu12_nvram_priv *priv; struct autcpu12_nvram_priv *priv;
int err;
priv = devm_kzalloc(&pdev->dev, priv = devm_kzalloc(&pdev->dev,
sizeof(struct autcpu12_nvram_priv), GFP_KERNEL); sizeof(struct autcpu12_nvram_priv), GFP_KERNEL);
...@@ -50,8 +49,7 @@ static int __devinit autcpu12_nvram_probe(struct platform_device *pdev) ...@@ -50,8 +49,7 @@ static int __devinit autcpu12_nvram_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) { if (!res) {
dev_err(&pdev->dev, "failed to get memory resource\n"); dev_err(&pdev->dev, "failed to get memory resource\n");
err = -ENOENT; return -ENOENT;
goto out;
} }
priv->map.bankwidth = 4; priv->map.bankwidth = 4;
...@@ -61,8 +59,7 @@ static int __devinit autcpu12_nvram_probe(struct platform_device *pdev) ...@@ -61,8 +59,7 @@ static int __devinit autcpu12_nvram_probe(struct platform_device *pdev)
strcpy((char *)priv->map.name, res->name); strcpy((char *)priv->map.name, res->name);
if (!priv->map.virt) { if (!priv->map.virt) {
dev_err(&pdev->dev, "failed to remap mem resource\n"); dev_err(&pdev->dev, "failed to remap mem resource\n");
err = -EBUSY; return -EBUSY;
goto out;
} }
simple_map_init(&priv->map); simple_map_init(&priv->map);
...@@ -90,8 +87,7 @@ static int __devinit autcpu12_nvram_probe(struct platform_device *pdev) ...@@ -90,8 +87,7 @@ static int __devinit autcpu12_nvram_probe(struct platform_device *pdev)
priv->mtd = do_map_probe("map_ram", &priv->map); priv->mtd = do_map_probe("map_ram", &priv->map);
if (!priv->mtd) { if (!priv->mtd) {
dev_err(&pdev->dev, "probing failed\n"); dev_err(&pdev->dev, "probing failed\n");
err = -ENXIO; return -ENXIO;
goto out;
} }
priv->mtd->owner = THIS_MODULE; priv->mtd->owner = THIS_MODULE;
...@@ -106,12 +102,7 @@ static int __devinit autcpu12_nvram_probe(struct platform_device *pdev) ...@@ -106,12 +102,7 @@ static int __devinit autcpu12_nvram_probe(struct platform_device *pdev)
map_destroy(priv->mtd); map_destroy(priv->mtd);
dev_err(&pdev->dev, "NV-RAM device addition failed\n"); dev_err(&pdev->dev, "NV-RAM device addition failed\n");
err = -ENOMEM; return -ENOMEM;
out:
devm_kfree(&pdev->dev, priv);
return err;
} }
static int __devexit autcpu12_nvram_remove(struct platform_device *pdev) static int __devexit autcpu12_nvram_remove(struct platform_device *pdev)
...@@ -120,7 +111,6 @@ static int __devexit autcpu12_nvram_remove(struct platform_device *pdev) ...@@ -120,7 +111,6 @@ static int __devexit autcpu12_nvram_remove(struct platform_device *pdev)
mtd_device_unregister(priv->mtd); mtd_device_unregister(priv->mtd);
map_destroy(priv->mtd); map_destroy(priv->mtd);
devm_kfree(&pdev->dev, priv);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment