Commit e21d2170 authored by Jingoo Han's avatar Jingoo Han Committed by Tomi Valkeinen

video: remove unnecessary platform_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d063
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Cc: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Acked-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: default avatarShawn Guo <shawn.guo@linaro.org>
Reviewed-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 12b23d5f
...@@ -579,7 +579,6 @@ static int au1100fb_drv_probe(struct platform_device *dev) ...@@ -579,7 +579,6 @@ static int au1100fb_drv_probe(struct platform_device *dev)
if (fbdev->info.cmap.len != 0) { if (fbdev->info.cmap.len != 0) {
fb_dealloc_cmap(&fbdev->info.cmap); fb_dealloc_cmap(&fbdev->info.cmap);
} }
platform_set_drvdata(dev, NULL);
return -ENODEV; return -ENODEV;
} }
......
...@@ -681,7 +681,6 @@ static int bfin_bf54x_probe(struct platform_device *pdev) ...@@ -681,7 +681,6 @@ static int bfin_bf54x_probe(struct platform_device *pdev)
out2: out2:
free_dma(CH_EPPI0); free_dma(CH_EPPI0);
out1: out1:
platform_set_drvdata(pdev, NULL);
return ret; return ret;
} }
......
...@@ -759,7 +759,6 @@ static int bfin_lq035q1_probe(struct platform_device *pdev) ...@@ -759,7 +759,6 @@ static int bfin_lq035q1_probe(struct platform_device *pdev)
out2: out2:
free_dma(CH_PPI); free_dma(CH_PPI);
out1: out1:
platform_set_drvdata(pdev, NULL);
return ret; return ret;
} }
...@@ -788,7 +787,6 @@ static int bfin_lq035q1_remove(struct platform_device *pdev) ...@@ -788,7 +787,6 @@ static int bfin_lq035q1_remove(struct platform_device *pdev)
bfin_lq035q1_free_ports(info->disp_info->ppi_mode == bfin_lq035q1_free_ports(info->disp_info->ppi_mode ==
USE_RGB565_16_BIT_PPI); USE_RGB565_16_BIT_PPI);
platform_set_drvdata(pdev, NULL);
framebuffer_release(fbinfo); framebuffer_release(fbinfo);
dev_info(&pdev->dev, "unregistered LCD driver\n"); dev_info(&pdev->dev, "unregistered LCD driver\n");
......
...@@ -578,7 +578,6 @@ static int bfin_t350mcqb_probe(struct platform_device *pdev) ...@@ -578,7 +578,6 @@ static int bfin_t350mcqb_probe(struct platform_device *pdev)
out2: out2:
free_dma(CH_PPI); free_dma(CH_PPI);
out1: out1:
platform_set_drvdata(pdev, NULL);
return ret; return ret;
} }
...@@ -608,7 +607,6 @@ static int bfin_t350mcqb_remove(struct platform_device *pdev) ...@@ -608,7 +607,6 @@ static int bfin_t350mcqb_remove(struct platform_device *pdev)
bfin_t350mcqb_request_ports(0); bfin_t350mcqb_request_ports(0);
platform_set_drvdata(pdev, NULL);
framebuffer_release(fbinfo); framebuffer_release(fbinfo);
printk(KERN_INFO DRIVER_NAME ": Unregister LCD driver.\n"); printk(KERN_INFO DRIVER_NAME ": Unregister LCD driver.\n");
......
...@@ -595,7 +595,6 @@ static int ep93xxfb_probe(struct platform_device *pdev) ...@@ -595,7 +595,6 @@ static int ep93xxfb_probe(struct platform_device *pdev)
fb_dealloc_cmap(&info->cmap); fb_dealloc_cmap(&info->cmap);
failed_cmap: failed_cmap:
kfree(info); kfree(info);
platform_set_drvdata(pdev, NULL);
return err; return err;
} }
...@@ -614,7 +613,6 @@ static int ep93xxfb_remove(struct platform_device *pdev) ...@@ -614,7 +613,6 @@ static int ep93xxfb_remove(struct platform_device *pdev)
fbi->mach_info->teardown(pdev); fbi->mach_info->teardown(pdev);
kfree(info); kfree(info);
platform_set_drvdata(pdev, NULL);
return 0; return 0;
} }
......
...@@ -923,7 +923,6 @@ static int __init imxfb_probe(struct platform_device *pdev) ...@@ -923,7 +923,6 @@ static int __init imxfb_probe(struct platform_device *pdev)
failed_req: failed_req:
kfree(info->pseudo_palette); kfree(info->pseudo_palette);
failed_init: failed_init:
platform_set_drvdata(pdev, NULL);
framebuffer_release(info); framebuffer_release(info);
return ret; return ret;
} }
...@@ -955,8 +954,6 @@ static int imxfb_remove(struct platform_device *pdev) ...@@ -955,8 +954,6 @@ static int imxfb_remove(struct platform_device *pdev)
iounmap(fbi->regs); iounmap(fbi->regs);
release_mem_region(res->start, resource_size(res)); release_mem_region(res->start, resource_size(res));
platform_set_drvdata(pdev, NULL);
return 0; return 0;
} }
......
...@@ -737,8 +737,6 @@ static int jzfb_remove(struct platform_device *pdev) ...@@ -737,8 +737,6 @@ static int jzfb_remove(struct platform_device *pdev)
fb_dealloc_cmap(&jzfb->fb->cmap); fb_dealloc_cmap(&jzfb->fb->cmap);
jzfb_free_devmem(jzfb); jzfb_free_devmem(jzfb);
platform_set_drvdata(pdev, NULL);
framebuffer_release(jzfb->fb); framebuffer_release(jzfb->fb);
return 0; return 0;
......
...@@ -659,7 +659,6 @@ static int mmpfb_probe(struct platform_device *pdev) ...@@ -659,7 +659,6 @@ static int mmpfb_probe(struct platform_device *pdev)
mutex_destroy(&fbi->access_ok); mutex_destroy(&fbi->access_ok);
failed: failed:
dev_err(fbi->dev, "mmp-fb: frame buffer device init failed\n"); dev_err(fbi->dev, "mmp-fb: frame buffer device init failed\n");
platform_set_drvdata(pdev, NULL);
framebuffer_release(info); framebuffer_release(info);
......
...@@ -566,7 +566,6 @@ static int mmphw_probe(struct platform_device *pdev) ...@@ -566,7 +566,6 @@ static int mmphw_probe(struct platform_device *pdev)
devm_kfree(ctrl->dev, ctrl); devm_kfree(ctrl->dev, ctrl);
} }
platform_set_drvdata(pdev, NULL);
dev_err(&pdev->dev, "device init failed\n"); dev_err(&pdev->dev, "device init failed\n");
return ret; return ret;
......
...@@ -985,8 +985,6 @@ static int mxsfb_remove(struct platform_device *pdev) ...@@ -985,8 +985,6 @@ static int mxsfb_remove(struct platform_device *pdev)
framebuffer_release(fb_info); framebuffer_release(fb_info);
platform_set_drvdata(pdev, NULL);
return 0; return 0;
} }
......
...@@ -707,7 +707,6 @@ static int nuc900fb_remove(struct platform_device *pdev) ...@@ -707,7 +707,6 @@ static int nuc900fb_remove(struct platform_device *pdev)
release_resource(fbi->mem); release_resource(fbi->mem);
kfree(fbi->mem); kfree(fbi->mem);
platform_set_drvdata(pdev, NULL);
framebuffer_release(fbinfo); framebuffer_release(fbinfo);
return 0; return 0;
......
...@@ -711,7 +711,6 @@ static int pxa3xx_gcu_probe(struct platform_device *dev) ...@@ -711,7 +711,6 @@ static int pxa3xx_gcu_probe(struct platform_device *dev)
misc_deregister(&priv->misc_dev); misc_deregister(&priv->misc_dev);
err_free_priv: err_free_priv:
platform_set_drvdata(dev, NULL);
free_buffers(dev, priv); free_buffers(dev, priv);
kfree(priv); kfree(priv);
return ret; return ret;
...@@ -729,7 +728,6 @@ static int pxa3xx_gcu_remove(struct platform_device *dev) ...@@ -729,7 +728,6 @@ static int pxa3xx_gcu_remove(struct platform_device *dev)
priv->shared, priv->shared_phys); priv->shared, priv->shared_phys);
iounmap(priv->mmio_base); iounmap(priv->mmio_base);
release_mem_region(r->start, resource_size(r)); release_mem_region(r->start, resource_size(r));
platform_set_drvdata(dev, NULL);
clk_disable(priv->clk); clk_disable(priv->clk);
free_buffers(dev, priv); free_buffers(dev, priv);
kfree(priv); kfree(priv);
......
...@@ -2256,7 +2256,6 @@ static int pxafb_probe(struct platform_device *dev) ...@@ -2256,7 +2256,6 @@ static int pxafb_probe(struct platform_device *dev)
release_mem_region(r->start, resource_size(r)); release_mem_region(r->start, resource_size(r));
failed_fbi: failed_fbi:
clk_put(fbi->clk); clk_put(fbi->clk);
platform_set_drvdata(dev, NULL);
kfree(fbi); kfree(fbi);
failed: failed:
return ret; return ret;
......
...@@ -1005,7 +1005,6 @@ static int s3c24xxfb_probe(struct platform_device *pdev, ...@@ -1005,7 +1005,6 @@ static int s3c24xxfb_probe(struct platform_device *pdev,
release_mem: release_mem:
release_mem_region(res->start, size); release_mem_region(res->start, size);
dealloc_fb: dealloc_fb:
platform_set_drvdata(pdev, NULL);
framebuffer_release(fbinfo); framebuffer_release(fbinfo);
return ret; return ret;
} }
...@@ -1051,7 +1050,6 @@ static int s3c2410fb_remove(struct platform_device *pdev) ...@@ -1051,7 +1050,6 @@ static int s3c2410fb_remove(struct platform_device *pdev)
release_mem_region(info->mem->start, resource_size(info->mem)); release_mem_region(info->mem->start, resource_size(info->mem));
platform_set_drvdata(pdev, NULL);
framebuffer_release(fbinfo); framebuffer_release(fbinfo);
return 0; return 0;
......
...@@ -1271,7 +1271,6 @@ static int sa1100fb_probe(struct platform_device *pdev) ...@@ -1271,7 +1271,6 @@ static int sa1100fb_probe(struct platform_device *pdev)
failed: failed:
if (fbi) if (fbi)
iounmap(fbi->base); iounmap(fbi->base);
platform_set_drvdata(pdev, NULL);
kfree(fbi); kfree(fbi);
release_mem_region(res->start, resource_size(res)); release_mem_region(res->start, resource_size(res));
return ret; return ret;
......
...@@ -571,7 +571,6 @@ static int sh7760fb_remove(struct platform_device *dev) ...@@ -571,7 +571,6 @@ static int sh7760fb_remove(struct platform_device *dev)
iounmap(par->base); iounmap(par->base);
release_mem_region(par->ioarea->start, resource_size(par->ioarea)); release_mem_region(par->ioarea->start, resource_size(par->ioarea));
framebuffer_release(info); framebuffer_release(info);
platform_set_drvdata(dev, NULL);
return 0; return 0;
} }
......
...@@ -567,7 +567,6 @@ static int sh_mipi_remove(struct platform_device *pdev) ...@@ -567,7 +567,6 @@ static int sh_mipi_remove(struct platform_device *pdev)
iounmap(mipi->base); iounmap(mipi->base);
if (res) if (res)
release_mem_region(res->start, resource_size(res)); release_mem_region(res->start, resource_size(res));
platform_set_drvdata(pdev, NULL);
kfree(mipi); kfree(mipi);
return 0; return 0;
......
...@@ -794,7 +794,6 @@ static int tmiofb_probe(struct platform_device *dev) ...@@ -794,7 +794,6 @@ static int tmiofb_probe(struct platform_device *dev)
cell->disable(dev); cell->disable(dev);
err_enable: err_enable:
err_find_mode: err_find_mode:
platform_set_drvdata(dev, NULL);
free_irq(irq, info); free_irq(irq, info);
err_request_irq: err_request_irq:
iounmap(info->screen_base); iounmap(info->screen_base);
...@@ -823,8 +822,6 @@ static int tmiofb_remove(struct platform_device *dev) ...@@ -823,8 +822,6 @@ static int tmiofb_remove(struct platform_device *dev)
if (cell->disable) if (cell->disable)
cell->disable(dev); cell->disable(dev);
platform_set_drvdata(dev, NULL);
free_irq(irq, info); free_irq(irq, info);
iounmap(info->screen_base); iounmap(info->screen_base);
......
...@@ -1269,7 +1269,6 @@ static void vga16fb_destroy(struct fb_info *info) ...@@ -1269,7 +1269,6 @@ static void vga16fb_destroy(struct fb_info *info)
iounmap(info->screen_base); iounmap(info->screen_base);
fb_dealloc_cmap(&info->cmap); fb_dealloc_cmap(&info->cmap);
/* XXX unshare VGA regions */ /* XXX unshare VGA regions */
platform_set_drvdata(dev, NULL);
framebuffer_release(info); framebuffer_release(info);
} }
......
...@@ -448,7 +448,6 @@ static int vt8500lcd_probe(struct platform_device *pdev) ...@@ -448,7 +448,6 @@ static int vt8500lcd_probe(struct platform_device *pdev)
failed_free_res: failed_free_res:
release_mem_region(res->start, resource_size(res)); release_mem_region(res->start, resource_size(res));
failed_fbi: failed_fbi:
platform_set_drvdata(pdev, NULL);
kfree(fbi); kfree(fbi);
failed: failed:
return ret; return ret;
......
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