From: 黄涛 Date: Thu, 31 May 2012 01:35:41 +0000 (+0800) Subject: rk30: hdmi: unregister earlysuspend when shutdown X-Git-Tag: firefly_0821_release~9142^2~12 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e631fd9aebaab1e9bed81b4cb456a8d37dfb6090;p=firefly-linux-kernel-4.4.55.git rk30: hdmi: unregister earlysuspend when shutdown --- diff --git a/drivers/video/rockchip/hdmi/rk30_hdmi.c b/drivers/video/rockchip/hdmi/rk30_hdmi.c index 50c9b6783a6c..37a05d07b71d 100755 --- a/drivers/video/rockchip/hdmi/rk30_hdmi.c +++ b/drivers/video/rockchip/hdmi/rk30_hdmi.c @@ -198,6 +198,7 @@ err1: err0: hdmi_dbg(hdmi->dev, "rk30 hdmi probe error.\n"); kfree(hdmi); + hdmi = NULL; return ret; } @@ -221,7 +222,18 @@ static int __devexit rk30_hdmi_remove(struct platform_device *pdev) static void rk30_hdmi_shutdown(struct platform_device *pdev) { + /* this func is called twice, bug? */ + static bool first = true; + if (first) { + first = false; + return; + } + if (!hdmi) + return; +#ifdef CONFIG_HAS_EARLYSUSPEND + unregister_early_suspend(&hdmi->early_suspend); +#endif } static struct platform_driver rk30_hdmi_driver = { @@ -247,4 +259,4 @@ static void __exit rk30_hdmi_exit(void) //fs_initcall(rk30_hdmi_init); module_init(rk30_hdmi_init); -module_exit(rk30_hdmi_exit); \ No newline at end of file +module_exit(rk30_hdmi_exit); diff --git a/drivers/video/rockchip/hdmi/rk30_hdmi.h b/drivers/video/rockchip/hdmi/rk30_hdmi.h index f59b887b89b5..83acb6c86e58 100755 --- a/drivers/video/rockchip/hdmi/rk30_hdmi.h +++ b/drivers/video/rockchip/hdmi/rk30_hdmi.h @@ -60,8 +60,8 @@ struct hdmi { int wait; struct completion complete; -#ifdef CONFIG_HAS_EARLYSUSPEND int suspend; +#ifdef CONFIG_HAS_EARLYSUSPEND struct early_suspend early_suspend; #endif @@ -93,4 +93,4 @@ extern int hdmi_find_best_mode(struct hdmi* hdmi, int vic); extern int hdmi_ouputmode_select(struct hdmi *hdmi, int edid_ok); extern int hdmi_switch_fb(struct hdmi *hdmi, int vic); extern void hdmi_sys_remove(void); -#endif /* __RK30_HDMI_H__ */ \ No newline at end of file +#endif /* __RK30_HDMI_H__ */