aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps/autcpu12-nvram.c
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2012-09-01 12:33:11 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-09-29 10:33:36 -0400
commit6f12f59a5f0dc014209bcc21d5689a6611e1c1e7 (patch)
tree507412bf6739dbf3b09236b5bdac4e5933d41b20 /drivers/mtd/maps/autcpu12-nvram.c
parentfac0077cc0a1760f0afbac6526f56656ee025a34 (diff)
mtd: autcpu12-nvram: drop frees of devm_ alloc'd data
devm free functions should not have to be explicitly used. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/maps/autcpu12-nvram.c')
-rw-r--r--drivers/mtd/maps/autcpu12-nvram.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/mtd/maps/autcpu12-nvram.c b/drivers/mtd/maps/autcpu12-nvram.c
index ef420d984d1a..76fb594bb1d9 100644
--- a/drivers/mtd/maps/autcpu12-nvram.c
+++ b/drivers/mtd/maps/autcpu12-nvram.c
@@ -38,7 +38,6 @@ static int __devinit autcpu12_nvram_probe(struct platform_device *pdev)
38 map_word tmp, save0, save1; 38 map_word tmp, save0, save1;
39 struct resource *res; 39 struct resource *res;
40 struct autcpu12_nvram_priv *priv; 40 struct autcpu12_nvram_priv *priv;
41 int err;
42 41
43 priv = devm_kzalloc(&pdev->dev, 42 priv = devm_kzalloc(&pdev->dev,
44 sizeof(struct autcpu12_nvram_priv), GFP_KERNEL); 43 sizeof(struct autcpu12_nvram_priv), GFP_KERNEL);
@@ -50,8 +49,7 @@ static int __devinit autcpu12_nvram_probe(struct platform_device *pdev)
50 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 49 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
51 if (!res) { 50 if (!res) {
52 dev_err(&pdev->dev, "failed to get memory resource\n"); 51 dev_err(&pdev->dev, "failed to get memory resource\n");
53 err = -ENOENT; 52 return -ENOENT;
54 goto out;
55 } 53 }
56 54
57 priv->map.bankwidth = 4; 55 priv->map.bankwidth = 4;
@@ -61,8 +59,7 @@ static int __devinit autcpu12_nvram_probe(struct platform_device *pdev)
61 strcpy((char *)priv->map.name, res->name); 59 strcpy((char *)priv->map.name, res->name);
62 if (!priv->map.virt) { 60 if (!priv->map.virt) {
63 dev_err(&pdev->dev, "failed to remap mem resource\n"); 61 dev_err(&pdev->dev, "failed to remap mem resource\n");
64 err = -EBUSY; 62 return -EBUSY;
65 goto out;
66 } 63 }
67 64
68 simple_map_init(&priv->map); 65 simple_map_init(&priv->map);
@@ -90,8 +87,7 @@ static int __devinit autcpu12_nvram_probe(struct platform_device *pdev)
90 priv->mtd = do_map_probe("map_ram", &priv->map); 87 priv->mtd = do_map_probe("map_ram", &priv->map);
91 if (!priv->mtd) { 88 if (!priv->mtd) {
92 dev_err(&pdev->dev, "probing failed\n"); 89 dev_err(&pdev->dev, "probing failed\n");
93 err = -ENXIO; 90 return -ENXIO;
94 goto out;
95 } 91 }
96 92
97 priv->mtd->owner = THIS_MODULE; 93 priv->mtd->owner = THIS_MODULE;
@@ -106,12 +102,7 @@ static int __devinit autcpu12_nvram_probe(struct platform_device *pdev)
106 102
107 map_destroy(priv->mtd); 103 map_destroy(priv->mtd);
108 dev_err(&pdev->dev, "NV-RAM device addition failed\n"); 104 dev_err(&pdev->dev, "NV-RAM device addition failed\n");
109 err = -ENOMEM; 105 return -ENOMEM;
110
111out:
112 devm_kfree(&pdev->dev, priv);
113
114 return err;
115} 106}
116 107
117static int __devexit autcpu12_nvram_remove(struct platform_device *pdev) 108static int __devexit autcpu12_nvram_remove(struct platform_device *pdev)
@@ -120,7 +111,6 @@ static int __devexit autcpu12_nvram_remove(struct platform_device *pdev)
120 111
121 mtd_device_unregister(priv->mtd); 112 mtd_device_unregister(priv->mtd);
122 map_destroy(priv->mtd); 113 map_destroy(priv->mtd);
123 devm_kfree(&pdev->dev, priv);
124 114
125 return 0; 115 return 0;
126} 116}