diff options
author | Fancy Fang <chen.fang@nxp.com> | 2016-07-11 17:14:22 +0800 |
---|---|---|
committer | Fancy Fang <chen.fang@nxp.com> | 2016-07-13 10:46:43 +0800 |
commit | 707f0f72bb0e734f4864c624b6b2573bfe40da4f (patch) | |
tree | 58ec034fb9f6820af8caa93c0c848e74886b543a /drivers/video | |
parent | db92cb4779cdc206dad74311403c47f59c541636 (diff) |
MLK-12980-1 video: mxsfb: refine the driver data usage logic
The function 'platform_set_drvdata' will be called twice
during the probing stage. And the second calling is not
good and not necessary.
Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/fbdev/mxsfb.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/video/fbdev/mxsfb.c b/drivers/video/fbdev/mxsfb.c index f4e57792ffaf..7f931a0d8003 100644 --- a/drivers/video/fbdev/mxsfb.c +++ b/drivers/video/fbdev/mxsfb.c @@ -1478,8 +1478,6 @@ static int mxsfb_probe(struct platform_device *pdev) } } - platform_set_drvdata(pdev, fb_info); - if (!host->enabled) { writel(0, host->base + LCDC_CTRL); mxsfb_set_par(fb_info); @@ -1521,8 +1519,8 @@ fb_release: static int mxsfb_remove(struct platform_device *pdev) { - struct fb_info *fb_info = platform_get_drvdata(pdev); - struct mxsfb_info *host = to_imxfb_host(fb_info); + struct mxsfb_info *host = platform_get_drvdata(pdev); + struct fb_info *fb_info = &host->fb_info; if (host->enabled) mxsfb_disable_controller(fb_info); @@ -1540,8 +1538,7 @@ static int mxsfb_remove(struct platform_device *pdev) static void mxsfb_shutdown(struct platform_device *pdev) { - struct fb_info *fb_info = platform_get_drvdata(pdev); - struct mxsfb_info *host = to_imxfb_host(fb_info); + struct mxsfb_info *host = platform_get_drvdata(pdev); /* * Force stop the LCD controller as keeping it running during reboot @@ -1572,8 +1569,8 @@ static int mxsfb_runtime_resume(struct device *dev) static int mxsfb_suspend(struct device *pdev) { - struct fb_info *fb_info = dev_get_drvdata(pdev); - struct mxsfb_info *host = to_imxfb_host(fb_info); + struct mxsfb_info *host = dev_get_drvdata(pdev); + struct fb_info *fb_info = &host->fb_info; int saved_blank; console_lock(); @@ -1590,8 +1587,8 @@ static int mxsfb_suspend(struct device *pdev) static int mxsfb_resume(struct device *pdev) { - struct fb_info *fb_info = dev_get_drvdata(pdev); - struct mxsfb_info *host = to_imxfb_host(fb_info); + struct mxsfb_info *host = dev_get_drvdata(pdev); + struct fb_info *fb_info = &host->fb_info; pinctrl_pm_select_default_state(pdev); |