diff mbox

[3/3] sm501fb: suspend and resume fb if it exists

Message ID 1509830661-7384-3-git-send-email-sudipm.mukherjee@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sudip Mukherjee Nov. 4, 2017, 9:24 p.m. UTC
There are cases when panel and crt both are not defined and only one of
them is defined and initialized. In such cases, suspend or resume it
only if it is defined.

Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
---
 drivers/video/fbdev/sm501fb.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Bartlomiej Zolnierkiewicz Nov. 9, 2017, 3:11 p.m. UTC | #1
On Saturday, November 04, 2017 09:24:21 PM Sudip Mukherjee wrote:
> There are cases when panel and crt both are not defined and only one of
> them is defined and initialized. In such cases, suspend or resume it
> only if it is defined.
> 
> Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>

Patch queued for 4.15, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c
index 577a483..49233c1 100644
--- a/drivers/video/fbdev/sm501fb.c
+++ b/drivers/video/fbdev/sm501fb.c
@@ -2101,6 +2101,9 @@  static int sm501fb_suspend_fb(struct sm501fb_info *info,
 	struct fb_info *fbi = info->fb[head];
 	struct sm501fb_par *par = fbi->par;
 
+	if (!fbi)
+		return 0;
+
 	if (par->screen.size == 0)
 		return 0;
 
@@ -2148,6 +2151,9 @@  static void sm501fb_resume_fb(struct sm501fb_info *info,
 	struct fb_info *fbi = info->fb[head];
 	struct sm501fb_par *par = fbi->par;
 
+	if (!fbi)
+		return;
+
 	if (par->screen.size == 0)
 		return;