All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] sm501fb: deallocate colormap only if allocated
@ 2017-11-04 21:24   ` Sudip Mukherjee
  0 siblings, 0 replies; 12+ messages in thread
From: Sudip Mukherjee @ 2017-11-04 21:24 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-kernel, linux-fbdev, Sudip Mukherjee

There are cases when panel and crt both are not defined and only one of
them is defined and initialized. In such cases, while removing the
device deallocate the colormap only if that particular fb is defined.

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

diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c
index 076dd27..381475f 100644
--- a/drivers/video/fbdev/sm501fb.c
+++ b/drivers/video/fbdev/sm501fb.c
@@ -1889,6 +1889,9 @@ static void sm501_free_init_fb(struct sm501fb_info *info,
 {
 	struct fb_info *fbi = info->fb[head];
 
+	if (!fbi)
+		return;
+
 	fb_dealloc_cmap(&fbi->cmap);
 }
 
-- 
2.1.4

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

* [PATCH 1/3] sm501fb: deallocate colormap only if allocated
@ 2017-11-04 21:24   ` Sudip Mukherjee
  0 siblings, 0 replies; 12+ messages in thread
From: Sudip Mukherjee @ 2017-11-04 21:24 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-kernel, linux-fbdev, Sudip Mukherjee

There are cases when panel and crt both are not defined and only one of
them is defined and initialized. In such cases, while removing the
device deallocate the colormap only if that particular fb is defined.

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

diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c
index 076dd27..381475f 100644
--- a/drivers/video/fbdev/sm501fb.c
+++ b/drivers/video/fbdev/sm501fb.c
@@ -1889,6 +1889,9 @@ static void sm501_free_init_fb(struct sm501fb_info *info,
 {
 	struct fb_info *fbi = info->fb[head];
 
+	if (!fbi)
+		return;
+
 	fb_dealloc_cmap(&fbi->cmap);
 }
 
-- 
2.1.4


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

* [PATCH 2/3] sm501fb: unregister framebuffer only if registered
  2017-11-04 21:24   ` Sudip Mukherjee
@ 2017-11-04 21:24     ` Sudip Mukherjee
  -1 siblings, 0 replies; 12+ messages in thread
From: Sudip Mukherjee @ 2017-11-04 21:24 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-kernel, linux-fbdev, Sudip Mukherjee

There are cases when panel and crt both are not defined and only one of
them is defined and initialized. In such cases, while removing the
device, unregister the framebuffer only if it was registered.

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

diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c
index 381475f..577a483 100644
--- a/drivers/video/fbdev/sm501fb.c
+++ b/drivers/video/fbdev/sm501fb.c
@@ -2079,8 +2079,10 @@ static int sm501fb_remove(struct platform_device *pdev)
 	sm501_free_init_fb(info, HEAD_CRT);
 	sm501_free_init_fb(info, HEAD_PANEL);
 
-	unregister_framebuffer(fbinfo_crt);
-	unregister_framebuffer(fbinfo_pnl);
+	if (fbinfo_crt)
+		unregister_framebuffer(fbinfo_crt);
+	if (fbinfo_pnl)
+		unregister_framebuffer(fbinfo_pnl);
 
 	sm501fb_stop(info);
 	kfree(info);
-- 
2.1.4

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

* [PATCH 2/3] sm501fb: unregister framebuffer only if registered
@ 2017-11-04 21:24     ` Sudip Mukherjee
  0 siblings, 0 replies; 12+ messages in thread
From: Sudip Mukherjee @ 2017-11-04 21:24 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-kernel, linux-fbdev, Sudip Mukherjee

There are cases when panel and crt both are not defined and only one of
them is defined and initialized. In such cases, while removing the
device, unregister the framebuffer only if it was registered.

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

diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c
index 381475f..577a483 100644
--- a/drivers/video/fbdev/sm501fb.c
+++ b/drivers/video/fbdev/sm501fb.c
@@ -2079,8 +2079,10 @@ static int sm501fb_remove(struct platform_device *pdev)
 	sm501_free_init_fb(info, HEAD_CRT);
 	sm501_free_init_fb(info, HEAD_PANEL);
 
-	unregister_framebuffer(fbinfo_crt);
-	unregister_framebuffer(fbinfo_pnl);
+	if (fbinfo_crt)
+		unregister_framebuffer(fbinfo_crt);
+	if (fbinfo_pnl)
+		unregister_framebuffer(fbinfo_pnl);
 
 	sm501fb_stop(info);
 	kfree(info);
-- 
2.1.4


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

* [PATCH 3/3] sm501fb: suspend and resume fb if it exists
  2017-11-04 21:24   ` Sudip Mukherjee
@ 2017-11-04 21:24     ` Sudip Mukherjee
  -1 siblings, 0 replies; 12+ messages in thread
From: Sudip Mukherjee @ 2017-11-04 21:24 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-kernel, linux-fbdev, Sudip Mukherjee

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(+)

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;
 
-- 
2.1.4

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

* [PATCH 3/3] sm501fb: suspend and resume fb if it exists
@ 2017-11-04 21:24     ` Sudip Mukherjee
  0 siblings, 0 replies; 12+ messages in thread
From: Sudip Mukherjee @ 2017-11-04 21:24 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-kernel, linux-fbdev, Sudip Mukherjee

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(+)

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;
 
-- 
2.1.4


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

* Re: [PATCH 1/3] sm501fb: deallocate colormap only if allocated
  2017-11-04 21:24   ` Sudip Mukherjee
@ 2017-11-09 15:10     ` Bartlomiej Zolnierkiewicz
  -1 siblings, 0 replies; 12+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2017-11-09 15:10 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: linux-kernel, linux-fbdev

On Saturday, November 04, 2017 09:24:19 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, while removing the
> device deallocate the colormap only if that particular fb 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

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

* Re: [PATCH 1/3] sm501fb: deallocate colormap only if allocated
@ 2017-11-09 15:10     ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 12+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2017-11-09 15:10 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: linux-kernel, linux-fbdev

On Saturday, November 04, 2017 09:24:19 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, while removing the
> device deallocate the colormap only if that particular fb 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


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

* Re: [PATCH 2/3] sm501fb: unregister framebuffer only if registered
  2017-11-04 21:24     ` Sudip Mukherjee
@ 2017-11-09 15:10       ` Bartlomiej Zolnierkiewicz
  -1 siblings, 0 replies; 12+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2017-11-09 15:10 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: linux-kernel, linux-fbdev

On Saturday, November 04, 2017 09:24:20 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, while removing the
> device, unregister the framebuffer only if it was registered.
> 
> 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

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

* Re: [PATCH 2/3] sm501fb: unregister framebuffer only if registered
@ 2017-11-09 15:10       ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 12+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2017-11-09 15:10 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: linux-kernel, linux-fbdev

On Saturday, November 04, 2017 09:24:20 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, while removing the
> device, unregister the framebuffer only if it was registered.
> 
> 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


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

* Re: [PATCH 3/3] sm501fb: suspend and resume fb if it exists
  2017-11-04 21:24     ` Sudip Mukherjee
@ 2017-11-09 15:11       ` Bartlomiej Zolnierkiewicz
  -1 siblings, 0 replies; 12+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2017-11-09 15:11 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: linux-kernel, linux-fbdev

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

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

* Re: [PATCH 3/3] sm501fb: suspend and resume fb if it exists
@ 2017-11-09 15:11       ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 12+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2017-11-09 15:11 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: linux-kernel, linux-fbdev

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


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

end of thread, other threads:[~2017-11-09 15:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20171104212429epcas1p428cc1efb505e9c78dda41e603c400b7b@epcas1p4.samsung.com>
2017-11-04 21:24 ` [PATCH 1/3] sm501fb: deallocate colormap only if allocated Sudip Mukherjee
2017-11-04 21:24   ` Sudip Mukherjee
2017-11-04 21:24   ` [PATCH 2/3] sm501fb: unregister framebuffer only if registered Sudip Mukherjee
2017-11-04 21:24     ` Sudip Mukherjee
2017-11-09 15:10     ` Bartlomiej Zolnierkiewicz
2017-11-09 15:10       ` Bartlomiej Zolnierkiewicz
2017-11-04 21:24   ` [PATCH 3/3] sm501fb: suspend and resume fb if it exists Sudip Mukherjee
2017-11-04 21:24     ` Sudip Mukherjee
2017-11-09 15:11     ` Bartlomiej Zolnierkiewicz
2017-11-09 15:11       ` Bartlomiej Zolnierkiewicz
2017-11-09 15:10   ` [PATCH 1/3] sm501fb: deallocate colormap only if allocated Bartlomiej Zolnierkiewicz
2017-11-09 15:10     ` Bartlomiej Zolnierkiewicz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.