aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/xilinxfb.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2007-10-04 12:48:37 -0400
committerGrant Likely <grant.likely@secretlab.ca>2007-10-09 20:11:29 -0400
commit3fb99ce4e2748dafe3f10dba2932f0d13f577623 (patch)
tree69097c0ffefe0777b76026126ba98ea217069acc /drivers/video/xilinxfb.c
parent3cb3ec2c26473d8123a468abfaca1e926344b1c2 (diff)
[POWERPC] XilinxFB: rename failout labels to reflect failure
Labels and gotos are used in xilinxfb_assign to unwind allocations on device registration failures. Rename the labels to reflect the error which occured. This change is being made to make it easier to add new failout paths (which occurs in a subsuquent patch) and to make reviewing the failout path easier. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Andrei Konovalov <akonovalov@ru.mvista.com>
Diffstat (limited to 'drivers/video/xilinxfb.c')
-rw-r--r--drivers/video/xilinxfb.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index e63cbd1acfd2..9aa754a25218 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -225,14 +225,14 @@ xilinxfb_drv_probe(struct device *dev)
225 if (!regs_res || (regs_res->end - regs_res->start + 1 < 8)) { 225 if (!regs_res || (regs_res->end - regs_res->start + 1 < 8)) {
226 dev_err(dev, "Couldn't get registers resource\n"); 226 dev_err(dev, "Couldn't get registers resource\n");
227 retval = -EFAULT; 227 retval = -EFAULT;
228 goto failed1; 228 goto err_region;
229 } 229 }
230 230
231 if (!request_mem_region(regs_res->start, 8, DRIVER_NAME)) { 231 if (!request_mem_region(regs_res->start, 8, DRIVER_NAME)) {
232 dev_err(dev, "Couldn't lock memory region at 0x%08X\n", 232 dev_err(dev, "Couldn't lock memory region at 0x%08X\n",
233 regs_res->start); 233 regs_res->start);
234 retval = -EBUSY; 234 retval = -EBUSY;
235 goto failed1; 235 goto err_region;
236 } 236 }
237 drvdata->regs = (u32 __iomem*) ioremap(regs_res->start, 8); 237 drvdata->regs = (u32 __iomem*) ioremap(regs_res->start, 8);
238 drvdata->regs_phys = regs_res->start; 238 drvdata->regs_phys = regs_res->start;
@@ -243,7 +243,7 @@ xilinxfb_drv_probe(struct device *dev)
243 if (!drvdata->fb_virt) { 243 if (!drvdata->fb_virt) {
244 dev_err(dev, "Could not allocate frame buffer memory\n"); 244 dev_err(dev, "Could not allocate frame buffer memory\n");
245 retval = -ENOMEM; 245 retval = -ENOMEM;
246 goto failed2; 246 goto err_fbmem;
247 } 247 }
248 248
249 /* Clear (turn to black) the framebuffer */ 249 /* Clear (turn to black) the framebuffer */
@@ -270,7 +270,7 @@ xilinxfb_drv_probe(struct device *dev)
270 dev_err(dev, "Fail to allocate colormap (%d entries)\n", 270 dev_err(dev, "Fail to allocate colormap (%d entries)\n",
271 PALETTE_ENTRIES_NO); 271 PALETTE_ENTRIES_NO);
272 retval = -EFAULT; 272 retval = -EFAULT;
273 goto failed3; 273 goto err_cmap;
274 } 274 }
275 275
276 drvdata->info.flags = FBINFO_DEFAULT; 276 drvdata->info.flags = FBINFO_DEFAULT;
@@ -284,7 +284,7 @@ xilinxfb_drv_probe(struct device *dev)
284 if (register_framebuffer(&drvdata->info) < 0) { 284 if (register_framebuffer(&drvdata->info) < 0) {
285 dev_err(dev, "Could not register frame buffer\n"); 285 dev_err(dev, "Could not register frame buffer\n");
286 retval = -EINVAL; 286 retval = -EINVAL;
287 goto failed4; 287 goto err_regfb;
288 } 288 }
289 289
290 /* Put a banner in the log (for DEBUG) */ 290 /* Put a banner in the log (for DEBUG) */
@@ -294,10 +294,10 @@ xilinxfb_drv_probe(struct device *dev)
294 (void*)drvdata->fb_phys, drvdata->fb_virt, FB_SIZE); 294 (void*)drvdata->fb_phys, drvdata->fb_virt, FB_SIZE);
295 return 0; /* success */ 295 return 0; /* success */
296 296
297failed4: 297err_regfb:
298 fb_dealloc_cmap(&drvdata->info.cmap); 298 fb_dealloc_cmap(&drvdata->info.cmap);
299 299
300failed3: 300err_cmap:
301 dma_free_coherent(dev, PAGE_ALIGN(FB_SIZE), drvdata->fb_virt, 301 dma_free_coherent(dev, PAGE_ALIGN(FB_SIZE), drvdata->fb_virt,
302 drvdata->fb_phys); 302 drvdata->fb_phys);
303 303
@@ -305,10 +305,10 @@ failed3:
305 xilinx_fb_out_be32(drvdata, REG_CTRL, 0); 305 xilinx_fb_out_be32(drvdata, REG_CTRL, 0);
306 iounmap(drvdata->regs); 306 iounmap(drvdata->regs);
307 307
308failed2: 308err_fbmem:
309 release_mem_region(regs_res->start, 8); 309 release_mem_region(regs_res->start, 8);
310 310
311failed1: 311err_region:
312 kfree(drvdata); 312 kfree(drvdata);
313 dev_set_drvdata(dev, NULL); 313 dev_set_drvdata(dev, NULL);
314 314