diff --git a/arch/arm/mach-rockchip/ddr_freq.c b/arch/arm/mach-rockchip/ddr_freq.c index 470587b22efd..ea229d7aeafd 100644 --- a/arch/arm/mach-rockchip/ddr_freq.c +++ b/arch/arm/mach-rockchip/ddr_freq.c @@ -782,10 +782,9 @@ static int ddr_freq_suspend_notifier_call(struct notifier_block *self, unsigned long action, void *data) { struct fb_event *event = data; - int blank_mode = *((int *)event->data); if (action == FB_EARLY_EVENT_BLANK) { - switch (blank_mode) { + switch (*((int *)event->data)) { case FB_BLANK_UNBLANK: rockchip_clear_system_status(SYS_STATUS_SUSPEND); break; @@ -794,7 +793,7 @@ static int ddr_freq_suspend_notifier_call(struct notifier_block *self, } } else if (action == FB_EVENT_BLANK) { - switch (blank_mode) { + switch (*((int *)event->data)) { case FB_BLANK_POWERDOWN: rockchip_set_system_status(SYS_STATUS_SUSPEND); break; diff --git a/arch/arm/mach-rockchip/dvfs.c b/arch/arm/mach-rockchip/dvfs.c index f189f87cab1a..18d98e4dfccc 100644 --- a/arch/arm/mach-rockchip/dvfs.c +++ b/arch/arm/mach-rockchip/dvfs.c @@ -150,7 +150,7 @@ static int early_suspend_notifier_call(struct notifier_block *self, mutex_lock(&switch_vdd_gpu_mutex); if (action == FB_EARLY_EVENT_BLANK) { - switch (blank_mode) { + switch (*((int *)event->data)) { case FB_BLANK_UNBLANK: early_suspend = 0; if (pd_gpu_off) { @@ -163,7 +163,7 @@ static int early_suspend_notifier_call(struct notifier_block *self, break; } } else if (action == FB_EVENT_BLANK) { - switch (blank_mode) { + switch (*((int *)event->data)) { case FB_BLANK_POWERDOWN: early_suspend = 1; if (pd_gpu_off) { diff --git a/arch/arm/mach-rockchip/rk3288.c b/arch/arm/mach-rockchip/rk3288.c index 0a768a98ba06..ca1ccbc40728 100755 --- a/arch/arm/mach-rockchip/rk3288.c +++ b/arch/arm/mach-rockchip/rk3288.c @@ -503,11 +503,10 @@ static int rk3288_pll_early_suspend_notifier_call(struct notifier_block *self, unsigned long action, void *data) { struct fb_event *event = data; - int blank_mode = *((int *)event->data); static bool enable = false; if (action == FB_EARLY_EVENT_BLANK) { - switch (blank_mode) { + switch (*((int *)event->data)) { case FB_BLANK_UNBLANK: if (!enable) { clk_prepare_enable(clk_get_sys(NULL, "clk_cpll")); @@ -519,7 +518,7 @@ static int rk3288_pll_early_suspend_notifier_call(struct notifier_block *self, break; } } else if (action == FB_EVENT_BLANK) { - switch (blank_mode) { + switch (*((int *)event->data)) { case FB_BLANK_POWERDOWN: if (enable) { clk_disable_unprepare(clk_get_sys(NULL, "clk_cpll")); diff --git a/drivers/hid/hid-rkvr.c b/drivers/hid/hid-rkvr.c index 0bdafb380a5f..eada6a54c520 100644 --- a/drivers/hid/hid-rkvr.c +++ b/drivers/hid/hid-rkvr.c @@ -1264,11 +1264,13 @@ static int rkvr_fb_event_notify(struct notifier_block *self, unsigned char buf[3] = {HID_REPORT_ID_RKVR, RKVR_ID_IDLE, 0}; struct hid_device *hid; struct fb_event *event = data; - int blank_mode = *((int *)event->data); + int blank_mode; if (action != FB_EARLY_EVENT_BLANK && action != FB_EVENT_BLANK) return NOTIFY_OK; + blank_mode = *((int *)event->data); + mutex_lock(&minors_lock); for (i = 0; i < RKVR_HIDRAW_MAX_DEVICES; i++) { if (!rkvr_hidraw_table[i] || !rkvr_hidraw_table[i]->exist) diff --git a/drivers/input/sensors/hall/mh248.c b/drivers/input/sensors/hall/mh248.c index 23a02924497b..0fa8a89aee61 100644 --- a/drivers/input/sensors/hall/mh248.c +++ b/drivers/input/sensors/hall/mh248.c @@ -51,13 +51,12 @@ static int hall_fb_notifier_callback(struct notifier_block *self, { struct mh248_para *mh248; struct fb_event *event = data; - int blank_mode = *((int *)event->data); mh248 = container_of(self, struct mh248_para, fb_notif); mutex_lock(&mh248->ops_lock); if (action == FB_EARLY_EVENT_BLANK) { - switch (blank_mode) { + switch (*((int *)event->data)) { case FB_BLANK_UNBLANK: break; default: @@ -65,7 +64,7 @@ static int hall_fb_notifier_callback(struct notifier_block *self, break; } } else if (action == FB_EVENT_BLANK) { - switch (blank_mode) { + switch (*((int *)event->data)) { case FB_BLANK_UNBLANK: mh248->is_suspend = 0; break; diff --git a/drivers/input/touchscreen/rockchip_gslX680_rk3128.c b/drivers/input/touchscreen/rockchip_gslX680_rk3128.c index a29ba0af10a9..691ae7c97ffc 100755 --- a/drivers/input/touchscreen/rockchip_gslX680_rk3128.c +++ b/drivers/input/touchscreen/rockchip_gslX680_rk3128.c @@ -791,10 +791,9 @@ static int gsl_ts_fb_event_notify(struct notifier_block *self, unsigned long action, void *data) { struct fb_event *event = data; - int blank_mode = *((int *)event->data); if (action == FB_EARLY_EVENT_BLANK) { - switch (blank_mode) { + switch (*((int *)event->data)) { case FB_BLANK_UNBLANK: break; default: @@ -802,7 +801,7 @@ static int gsl_ts_fb_event_notify(struct notifier_block *self, break; } } else if (action == FB_EVENT_BLANK) { - switch (blank_mode) { + switch (*((int *)event->data)) { case FB_BLANK_UNBLANK: gsl_ts_resume(); break; diff --git a/drivers/input/touchscreen/zet62xx/zet62xx.c b/drivers/input/touchscreen/zet62xx/zet62xx.c index 90e77ad4138d..bee69d6f0845 100755 --- a/drivers/input/touchscreen/zet62xx/zet62xx.c +++ b/drivers/input/touchscreen/zet62xx/zet62xx.c @@ -4446,11 +4446,9 @@ static int zet622x_ts_fb_event_notify(struct notifier_block *self, unsigned long action, void *data) { struct fb_event *event = data; - int blank_mode = *((int *)event->data); - if (action == FB_EARLY_EVENT_BLANK) { - switch (blank_mode) { + switch (*((int *)event->data)) { case FB_BLANK_UNBLANK: break; default: @@ -4458,7 +4456,7 @@ static int zet622x_ts_fb_event_notify(struct notifier_block *self, break; } } else if (action == FB_EVENT_BLANK) { - switch (blank_mode) { + switch (*((int *)event->data)) { case FB_BLANK_UNBLANK: zet622x_ts_late_resume(); break; diff --git a/drivers/power/rk818_battery.c b/drivers/power/rk818_battery.c index f9e6d8f7c4bd..7933fcd979e1 100644 --- a/drivers/power/rk818_battery.c +++ b/drivers/power/rk818_battery.c @@ -1051,6 +1051,9 @@ static int rk818_bat_fb_notifier(struct notifier_block *nb, struct rk818_battery *di; struct fb_event *evdata = data; + if (event != FB_EARLY_EVENT_BLANK && event != FB_EVENT_BLANK) + return NOTIFY_OK; + di = container_of(nb, struct rk818_battery, fb_nb); di->fb_blank = *(int *)evdata->data; diff --git a/drivers/video/rockchip/dp/rockchip_dp.c b/drivers/video/rockchip/dp/rockchip_dp.c index d46f5eda4cab..9a9a6f31972f 100644 --- a/drivers/video/rockchip/dp/rockchip_dp.c +++ b/drivers/video/rockchip/dp/rockchip_dp.c @@ -172,11 +172,10 @@ static int rockchip_dp_fb_event_notify(struct notifier_block *self, void *data) { struct fb_event *event = data; - int blank_mode = *((int *)event->data); struct dp_dev *dp_dev = container_of(self, struct dp_dev, fb_notif); if (action == FB_EARLY_EVENT_BLANK) { - switch (blank_mode) { + switch (*((int *)event->data)) { case FB_BLANK_UNBLANK: break; default: @@ -187,7 +186,7 @@ static int rockchip_dp_fb_event_notify(struct notifier_block *self, break; } } else if (action == FB_EVENT_BLANK) { - switch (blank_mode) { + switch (*((int *)event->data)) { case FB_BLANK_UNBLANK: if (dp_dev->hdmi->sleep) { dp_dev->early_suspended = false; diff --git a/drivers/video/rockchip/hdmi/rockchip-hdmiv1/rockchip_hdmiv1.c b/drivers/video/rockchip/hdmi/rockchip-hdmiv1/rockchip_hdmiv1.c index 88610b8352d4..b11380fd25f2 100644 --- a/drivers/video/rockchip/hdmi/rockchip-hdmiv1/rockchip_hdmiv1.c +++ b/drivers/video/rockchip/hdmi/rockchip-hdmiv1/rockchip_hdmiv1.c @@ -162,10 +162,9 @@ static int rockchip_hdmiv1_fb_event_notify(struct notifier_block *self, void *data) { struct fb_event *event = data; - int blank_mode = *((int *)event->data); if (action == FB_EARLY_EVENT_BLANK) { - switch (blank_mode) { + switch (*((int *)event->data)) { case FB_BLANK_UNBLANK: break; default: @@ -174,7 +173,7 @@ static int rockchip_hdmiv1_fb_event_notify(struct notifier_block *self, break; } } else if (action == FB_EVENT_BLANK) { - switch (blank_mode) { + switch (*((int *)event->data)) { case FB_BLANK_UNBLANK: if (hdmi_dev->hdmi->sleep) rockchip_hdmiv1_early_resume(); diff --git a/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2.c b/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2.c index 6e607a27d993..4f7ee815035e 100644 --- a/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2.c +++ b/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2.c @@ -330,7 +330,6 @@ static int rockchip_hdmiv2_fb_event_notify(struct notifier_block *self, unsigned long action, void *data) { struct fb_event *event = data; - int blank_mode = *((int *)event->data); struct hdmi *hdmi = hdmi_dev->hdmi; struct pinctrl_state *gpio_state; #ifdef CONFIG_PINCTRL @@ -338,7 +337,7 @@ static int rockchip_hdmiv2_fb_event_notify(struct notifier_block *self, #endif if (action == FB_EARLY_EVENT_BLANK) { - switch (blank_mode) { + switch (*((int *)event->data)) { case FB_BLANK_UNBLANK: break; default: @@ -368,7 +367,7 @@ static int rockchip_hdmiv2_fb_event_notify(struct notifier_block *self, break; } } else if (action == FB_EVENT_BLANK) { - switch (blank_mode) { + switch (*((int *)event->data)) { case FB_BLANK_UNBLANK: HDMIDBG("resume hdmi\n"); if (hdmi->sleep) { diff --git a/drivers/video/rockchip/tve/gm7122/gm7122_tve.c b/drivers/video/rockchip/tve/gm7122/gm7122_tve.c index 47642c762d94..4e8d92f27ece 100755 --- a/drivers/video/rockchip/tve/gm7122/gm7122_tve.c +++ b/drivers/video/rockchip/tve/gm7122/gm7122_tve.c @@ -282,10 +282,9 @@ tve_fb_event_notify(struct notifier_block *self, unsigned long action, void *data) { struct fb_event *event = data; - int blank_mode = *((int *)event->data); if (action == FB_EARLY_EVENT_BLANK) { - switch (blank_mode) { + switch (*((int *)event->data)) { case FB_BLANK_UNBLANK: break; default: @@ -300,7 +299,7 @@ tve_fb_event_notify(struct notifier_block *self, break; } } else if (action == FB_EVENT_BLANK) { - switch (blank_mode) { + switch (*((int *)event->data)) { case FB_BLANK_UNBLANK: TVEDBG("resume tve\n"); if (gm7122_tve->suspend) { diff --git a/drivers/video/rockchip/tve/rk1000/rk1000_tve.c b/drivers/video/rockchip/tve/rk1000/rk1000_tve.c index a21c08851795..9bd6c0fe3f38 100755 --- a/drivers/video/rockchip/tve/rk1000/rk1000_tve.c +++ b/drivers/video/rockchip/tve/rk1000/rk1000_tve.c @@ -256,12 +256,10 @@ static int rk1000_fb_event_notify(struct notifier_block *self, unsigned long action, void *data) { struct fb_event *event; - int blank_mode; event = data; - blank_mode = *((int *)event->data); if (action == FB_EARLY_EVENT_BLANK) { - switch (blank_mode) { + switch (*((int *)event->data)) { case FB_BLANK_UNBLANK: break; default: @@ -269,7 +267,7 @@ static int rk1000_fb_event_notify(struct notifier_block *self, break; } } else if (action == FB_EVENT_BLANK) { - switch (blank_mode) { + switch (*((int *)event->data)) { case FB_BLANK_UNBLANK: rk1000_early_resume(NULL); break; diff --git a/drivers/video/rockchip/tve/rk3036/rk3036_tve.c b/drivers/video/rockchip/tve/rk3036/rk3036_tve.c index b8415412dd1b..337fa346edd6 100755 --- a/drivers/video/rockchip/tve/rk3036/rk3036_tve.c +++ b/drivers/video/rockchip/tve/rk3036/rk3036_tve.c @@ -290,10 +290,9 @@ tve_fb_event_notify(struct notifier_block *self, unsigned long action, void *data) { struct fb_event *event = data; - int blank_mode = *((int *)event->data); if (action == FB_EARLY_EVENT_BLANK) { - switch (blank_mode) { + switch (*((int *)event->data)) { case FB_BLANK_UNBLANK: break; default: @@ -310,7 +309,7 @@ tve_fb_event_notify(struct notifier_block *self, break; } } else if (action == FB_EVENT_BLANK) { - switch (blank_mode) { + switch (*((int *)event->data)) { case FB_BLANK_UNBLANK: TVEDBG("resume tve\n"); mutex_lock(&rk3036_tve->tve_lock);