mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 21:07:02 +09:00
rk: fb: fix earlysuspend bug
fix this bug: rk30_pm_power_off start... Unable to handle kernel NULL pointer dereference at virtual address 00000054 pgd = c0404000 [00000054] *pgd=00000000pre WM831X_POWER_STATE = 0x8800 wm831x_last_deinit Internal error: Oops: 17 [#1] PREEMPT SMP CPU: 0 Tainted: G C (3.0.8+ #2) PC is at rkfb_early_suspend+0x18/0x70 LR is at early_suspend+0xc4/0x12c
This commit is contained in:
@@ -1000,6 +1000,7 @@ int rk_fb_unregister(struct rk_lcdc_device_driver *dev_drv)
|
||||
framebuffer_release(fbi);
|
||||
}
|
||||
fb_inf->lcdc_dev_drv[dev_drv->id]= NULL;
|
||||
fb_inf->num_lcdc--;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1020,6 +1021,8 @@ static void rkfb_early_suspend(struct early_suspend *h)
|
||||
int i;
|
||||
for(i = 0; i < inf->num_lcdc; i++)
|
||||
{
|
||||
if (!inf->lcdc_dev_drv[i])
|
||||
continue;
|
||||
if(inf->lcdc_dev_drv[i]->screen_ctr_info->io_disable)
|
||||
inf->lcdc_dev_drv[i]->screen_ctr_info->io_disable();
|
||||
if(inf->lcdc_dev_drv[i]->screen->standby)
|
||||
@@ -1036,6 +1039,8 @@ static void rkfb_early_resume(struct early_suspend *h)
|
||||
int i;
|
||||
for(i = 0; i < inf->num_lcdc; i++)
|
||||
{
|
||||
if (!inf->lcdc_dev_drv[i])
|
||||
continue;
|
||||
if(inf->lcdc_dev_drv[i]->screen_ctr_info->io_enable)
|
||||
inf->lcdc_dev_drv[i]->screen_ctr_info->io_enable();
|
||||
if(inf->lcdc_dev_drv[i]->screen->standby)
|
||||
@@ -1093,9 +1098,12 @@ static int __devexit rk_fb_remove(struct platform_device *pdev)
|
||||
|
||||
static void rk_fb_shutdown(struct platform_device *pdev)
|
||||
{
|
||||
struct rk_fb_inf *fb_inf = platform_get_drvdata(pdev);
|
||||
kfree(fb_inf);
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
// struct rk_fb_inf *fb_inf = platform_get_drvdata(pdev);
|
||||
// kfree(fb_inf);
|
||||
// platform_set_drvdata(pdev, NULL);
|
||||
#ifdef CONFIG_HAS_EARLYSUSPEND
|
||||
unregister_early_suspend(&suspend_info.early_suspend);
|
||||
#endif
|
||||
}
|
||||
|
||||
static struct platform_driver rk_fb_driver = {
|
||||
@@ -1105,7 +1113,7 @@ static struct platform_driver rk_fb_driver = {
|
||||
.name = "rk-fb",
|
||||
.owner = THIS_MODULE,
|
||||
},
|
||||
//.shutdown = rk_fb_shutdown,
|
||||
.shutdown = rk_fb_shutdown,
|
||||
};
|
||||
|
||||
static int __init rk_fb_init(void)
|
||||
|
||||
Reference in New Issue
Block a user