[v2,4/4] fbdev: imxfb: remove unneeded lable

Message ID 20230710132001.50764-4-frank.li@vivo.com
State New
Headers
Series [v2,1/4] fbdev: imxfb: Removed unneeded release_mem_region |

Commit Message

李扬韬 July 10, 2023, 1:20 p.m. UTC
  These lables are redundant and don't do anything, let's remove it.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/video/fbdev/imxfb.c | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)
  

Comments

Uwe Kleine-König July 10, 2023, 7:10 p.m. UTC | #1
On Mon, Jul 10, 2023 at 09:20:01PM +0800, Yangtao Li wrote:
> These lables are redundant and don't do anything, let's remove it.

s/lable/label/ here an in the subject line.

Are you using this driver, or did you just stumble over it while looking
for some janitorial todo? If the former, I suggest you look into the drm
driver (imx-lcdc) instead.

Having said that, I'm not sure this cleanup is really valuable. While
a single jump target position has several names, 

  	ret = imxfb_of_read_mode(&pdev->dev, display_np, fbi->mode);
  	of_node_put(display_np);
  	if (ret)
  		goto failed_of_parse;

is more obvious correct than

  	ret = imxfb_of_read_mode(&pdev->dev, display_np, fbi->mode);
  	of_node_put(display_np);
  	if (ret)
  		goto failed_init;

. *shrug*

Best regards
Uwe
  

Patch

diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c
index 4582ea801121..77dedd2c05fd 100644
--- a/drivers/video/fbdev/imxfb.c
+++ b/drivers/video/fbdev/imxfb.c
@@ -903,7 +903,7 @@  static int imxfb_probe(struct platform_device *pdev)
 	if (!display_np) {
 		dev_err(&pdev->dev, "No display defined in devicetree\n");
 		ret = -EINVAL;
-		goto failed_of_parse;
+		goto failed_init;
 	}
 
 	/*
@@ -917,13 +917,13 @@  static int imxfb_probe(struct platform_device *pdev)
 	if (!fbi->mode) {
 		ret = -ENOMEM;
 		of_node_put(display_np);
-		goto failed_of_parse;
+		goto failed_init;
 	}
 
 	ret = imxfb_of_read_mode(&pdev->dev, display_np, fbi->mode);
 	of_node_put(display_np);
 	if (ret)
-		goto failed_of_parse;
+		goto failed_init;
 
 	/* Calculate maximum bytes used per pixel. In most cases this should
 	 * be the same as m->bpp/8 */
@@ -936,7 +936,7 @@  static int imxfb_probe(struct platform_device *pdev)
 	fbi->clk_ipg = devm_clk_get(&pdev->dev, "ipg");
 	if (IS_ERR(fbi->clk_ipg)) {
 		ret = PTR_ERR(fbi->clk_ipg);
-		goto failed_getclock;
+		goto failed_init;
 	}
 
 	/*
@@ -951,25 +951,25 @@  static int imxfb_probe(struct platform_device *pdev)
 	 */
 	ret = clk_prepare_enable(fbi->clk_ipg);
 	if (ret)
-		goto failed_getclock;
+		goto failed_init;
 	clk_disable_unprepare(fbi->clk_ipg);
 
 	fbi->clk_ahb = devm_clk_get(&pdev->dev, "ahb");
 	if (IS_ERR(fbi->clk_ahb)) {
 		ret = PTR_ERR(fbi->clk_ahb);
-		goto failed_getclock;
+		goto failed_init;
 	}
 
 	fbi->clk_per = devm_clk_get(&pdev->dev, "per");
 	if (IS_ERR(fbi->clk_per)) {
 		ret = PTR_ERR(fbi->clk_per);
-		goto failed_getclock;
+		goto failed_init;
 	}
 
 	fbi->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(fbi->regs)) {
 		ret = PTR_ERR(fbi->regs);
-		goto failed_ioremap;
+		goto failed_init;
 	}
 
 	fbi->map_size = PAGE_ALIGN(info->fix.smem_len);
@@ -978,7 +978,7 @@  static int imxfb_probe(struct platform_device *pdev)
 	if (!info->screen_buffer) {
 		dev_err(&pdev->dev, "Failed to allocate video RAM\n");
 		ret = -ENOMEM;
-		goto failed_map;
+		goto failed_init;
 	}
 
 	info->fix.smem_start = fbi->map_dma;
@@ -1030,16 +1030,11 @@  static int imxfb_probe(struct platform_device *pdev)
 
 failed_lcd:
 	unregister_framebuffer(info);
-
 failed_register:
 	fb_dealloc_cmap(&info->cmap);
 failed_cmap:
 	dma_free_wc(&pdev->dev, fbi->map_size, info->screen_buffer,
 		    fbi->map_dma);
-failed_map:
-failed_ioremap:
-failed_getclock:
-failed_of_parse:
 failed_init:
 	framebuffer_release(info);
 	return ret;