linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] gma500: Fix suspend/resume functions
@ 2012-01-27  6:28 Ryan Mallon
  2012-01-27 11:40 ` Alan Cox
  0 siblings, 1 reply; 2+ messages in thread
From: Ryan Mallon @ 2012-01-27  6:28 UTC (permalink / raw)
  To: airlied, airlied, Alan Cox, ville.syrjala; +Cc: dri-devel, linux-kernel

Both the suspend and resume functions incorrectly set psbfb =
to_psb_fb(NULL) outside of the loop over all of the framebuffers. Fix
this by moving the assignment of psbfb inside the loop and removing the
initialisation of fb.

Signed-off-by: Ryan Mallon <rmallon@gmail.com>
---

diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c
index 791c0ef..830dfdd 100644
--- a/drivers/gpu/drm/gma500/framebuffer.c
+++ b/drivers/gpu/drm/gma500/framebuffer.c
@@ -113,12 +113,12 @@ static int psbfb_pan(struct fb_var_screeninfo *var, struct fb_info *info)
 
 void psbfb_suspend(struct drm_device *dev)
 {
-	struct drm_framebuffer *fb = 0;
-	struct psb_framebuffer *psbfb = to_psb_fb(fb);
+	struct drm_framebuffer *fb;
 
 	console_lock();
 	mutex_lock(&dev->mode_config.mutex);
 	list_for_each_entry(fb, &dev->mode_config.fb_list, head) {
+		struct psb_framebuffer *psbfb = to_psb_fb(fb);
 		struct fb_info *info = psbfb->fbdev;
 		fb_set_suspend(info, 1);
 		drm_fb_helper_blank(FB_BLANK_POWERDOWN, info);
@@ -129,12 +129,12 @@ void psbfb_suspend(struct drm_device *dev)
 
 void psbfb_resume(struct drm_device *dev)
 {
-	struct drm_framebuffer *fb = 0;
-	struct psb_framebuffer *psbfb = to_psb_fb(fb);
+	struct drm_framebuffer *fb;
 
 	console_lock();
 	mutex_lock(&dev->mode_config.mutex);
 	list_for_each_entry(fb, &dev->mode_config.fb_list, head) {
+		struct psb_framebuffer *psbfb = to_psb_fb(fb);
 		struct fb_info *info = psbfb->fbdev;
 		fb_set_suspend(info, 0);
 		drm_fb_helper_blank(FB_BLANK_UNBLANK, info);


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [RFC PATCH] gma500: Fix suspend/resume functions
  2012-01-27  6:28 [RFC PATCH] gma500: Fix suspend/resume functions Ryan Mallon
@ 2012-01-27 11:40 ` Alan Cox
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2012-01-27 11:40 UTC (permalink / raw)
  To: Ryan Mallon
  Cc: airlied, airlied, Alan Cox, ville.syrjala, dri-devel,
	linux-kernel, airlied

On Fri, 27 Jan 2012 17:28:24 +1100
Ryan Mallon <rmallon@gmail.com> wrote:

> Both the suspend and resume functions incorrectly set psbfb =
> to_psb_fb(NULL) outside of the loop over all of the framebuffers. Fix
> this by moving the assignment of psbfb inside the loop and removing the
> initialisation of fb.
> 
> Signed-off-by: Ryan Mallon <rmallon@gmail.com>

Yes that wants fixing

Acked-by: Alan Cox <alan@linux.intel.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-01-27 11:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-27  6:28 [RFC PATCH] gma500: Fix suspend/resume functions Ryan Mallon
2012-01-27 11:40 ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).