* [PATCH v3] fbdev: s1d13xxxfb: add missed unregister_framebuffer in remove
@ 2020-03-24 13:23 ` Chuhong Yuan
2020-04-17 14:08 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 2+ messages in thread
From: Chuhong Yuan @ 2020-03-24 13:23 UTC (permalink / raw)
Cc: linux-fbdev, Bartlomiej Zolnierkiewicz, Chuhong Yuan,
linux-kernel, dri-devel, Kristoffer Ericson
The driver calls register_framebuffer() in probe but does not call
unregister_framebuffer() in remove.
Rename current remove to __s1d13xxxfb_remove() for error handler.
Then add a new remove to call unregister_framebuffer().
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
Changes in v3:
- Fix code style.
- Set __s1d13xxxfb_remove() to return void.
- Remove redundant check for info.
drivers/video/fbdev/s1d13xxxfb.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/video/fbdev/s1d13xxxfb.c b/drivers/video/fbdev/s1d13xxxfb.c
index 8048499e398d..d51ef7619115 100644
--- a/drivers/video/fbdev/s1d13xxxfb.c
+++ b/drivers/video/fbdev/s1d13xxxfb.c
@@ -721,9 +721,7 @@ static void s1d13xxxfb_fetch_hw_state(struct fb_info *info)
xres, yres, xres_virtual, yres_virtual, is_color, is_dual, is_tft);
}
-
-static int
-s1d13xxxfb_remove(struct platform_device *pdev)
+static void __s1d13xxxfb_remove(struct platform_device *pdev)
{
struct fb_info *info = platform_get_drvdata(pdev);
struct s1d13xxxfb_par *par = NULL;
@@ -749,9 +747,18 @@ s1d13xxxfb_remove(struct platform_device *pdev)
pdev->resource[0].end - pdev->resource[0].start +1);
release_mem_region(pdev->resource[1].start,
pdev->resource[1].end - pdev->resource[1].start +1);
+}
+
+static int s1d13xxxfb_remove(struct platform_device *pdev)
+{
+ struct fb_info *info = platform_get_drvdata(pdev);
+
+ unregister_framebuffer(info);
+ __s1d13xxxfb_remove(pdev);
return 0;
}
+
static int s1d13xxxfb_probe(struct platform_device *pdev)
{
struct s1d13xxxfb_par *default_par;
@@ -895,7 +902,7 @@ static int s1d13xxxfb_probe(struct platform_device *pdev)
return 0;
bail:
- s1d13xxxfb_remove(pdev);
+ __s1d13xxxfb_remove(pdev);
return ret;
}
--
2.25.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v3] fbdev: s1d13xxxfb: add missed unregister_framebuffer in remove
2020-03-24 13:23 ` [PATCH v3] fbdev: s1d13xxxfb: add missed unregister_framebuffer in remove Chuhong Yuan
@ 2020-04-17 14:08 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 2+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-04-17 14:08 UTC (permalink / raw)
To: Chuhong Yuan; +Cc: linux-fbdev, Kristoffer Ericson, linux-kernel, dri-devel
On 3/24/20 2:23 PM, Chuhong Yuan wrote:
> The driver calls register_framebuffer() in probe but does not call
> unregister_framebuffer() in remove.
> Rename current remove to __s1d13xxxfb_remove() for error handler.
> Then add a new remove to call unregister_framebuffer().
>
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Patch queued for v5.8 (w/ extra newline removed), thanks.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> Changes in v3:
> - Fix code style.
> - Set __s1d13xxxfb_remove() to return void.
> - Remove redundant check for info.
>
> drivers/video/fbdev/s1d13xxxfb.c | 15 +++++++++++----
> 1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/video/fbdev/s1d13xxxfb.c b/drivers/video/fbdev/s1d13xxxfb.c
> index 8048499e398d..d51ef7619115 100644
> --- a/drivers/video/fbdev/s1d13xxxfb.c
> +++ b/drivers/video/fbdev/s1d13xxxfb.c
> @@ -721,9 +721,7 @@ static void s1d13xxxfb_fetch_hw_state(struct fb_info *info)
> xres, yres, xres_virtual, yres_virtual, is_color, is_dual, is_tft);
> }
>
> -
> -static int
> -s1d13xxxfb_remove(struct platform_device *pdev)
> +static void __s1d13xxxfb_remove(struct platform_device *pdev)
> {
> struct fb_info *info = platform_get_drvdata(pdev);
> struct s1d13xxxfb_par *par = NULL;
> @@ -749,9 +747,18 @@ s1d13xxxfb_remove(struct platform_device *pdev)
> pdev->resource[0].end - pdev->resource[0].start +1);
> release_mem_region(pdev->resource[1].start,
> pdev->resource[1].end - pdev->resource[1].start +1);
> +}
> +
> +static int s1d13xxxfb_remove(struct platform_device *pdev)
> +{
> + struct fb_info *info = platform_get_drvdata(pdev);
> +
> + unregister_framebuffer(info);
> + __s1d13xxxfb_remove(pdev);
> return 0;
> }
>
> +
> static int s1d13xxxfb_probe(struct platform_device *pdev)
> {
> struct s1d13xxxfb_par *default_par;
> @@ -895,7 +902,7 @@ static int s1d13xxxfb_probe(struct platform_device *pdev)
> return 0;
>
> bail:
> - s1d13xxxfb_remove(pdev);
> + __s1d13xxxfb_remove(pdev);
> return ret;
>
> }
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-17 14:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CGME20200324132625eucas1p1dc7c0d591946a44d149418e3525630ed@eucas1p1.samsung.com>
2020-03-24 13:23 ` [PATCH v3] fbdev: s1d13xxxfb: add missed unregister_framebuffer in remove Chuhong Yuan
2020-04-17 14:08 ` Bartlomiej Zolnierkiewicz
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).