Skip to content

Commit

Permalink
imxfb: correct location of callbacks in suspend and resume
Browse files Browse the repository at this point in the history
The probe function passes a pointer to a struct fb_info to
platform_set_drvdata(), so don't interpret the return value of
platform_get_drvdata() as a pointer to struct imxfb_info.

The original imxfb_info *fbi backlight_power was NULL but in imxfb_suspend
it was 4 resulting in an oops as imxfb_suspend calls
imxfb_disable_controller(fbi) which in turn has

	if (fbi->backlight_power)
			fbi->backlight_power(0);

Signed-off-by: Uwe Kleine-König  <u.kleine-koenig@pengutronix.de>
Acked-by: Sascha Hauer <kernel@pengutronix.de>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Uwe Kleine-König authored and Linus Torvalds committed Feb 3, 2010
1 parent 4528fd0 commit 1ec5620
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/video/imxfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,8 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf
*/
static int imxfb_suspend(struct platform_device *dev, pm_message_t state)
{
struct imxfb_info *fbi = platform_get_drvdata(dev);
struct fb_info *info = platform_get_drvdata(dev);
struct imxfb_info *fbi = info->par;

pr_debug("%s\n", __func__);

Expand All @@ -603,7 +604,8 @@ static int imxfb_suspend(struct platform_device *dev, pm_message_t state)

static int imxfb_resume(struct platform_device *dev)
{
struct imxfb_info *fbi = platform_get_drvdata(dev);
struct fb_info *info = platform_get_drvdata(dev);
struct imxfb_info *fbi = info->par;

pr_debug("%s\n", __func__);

Expand Down

0 comments on commit 1ec5620

Please sign in to comment.