diff options
Diffstat (limited to 'drivers/video/fbmem.c')
-rw-r--r-- | drivers/video/fbmem.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index ac9141b85356..c6ce416ab587 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c | |||
@@ -1665,6 +1665,7 @@ static int do_unregister_framebuffer(struct fb_info *fb_info) | |||
1665 | if (ret) | 1665 | if (ret) |
1666 | return -EINVAL; | 1666 | return -EINVAL; |
1667 | 1667 | ||
1668 | unlink_framebuffer(fb_info); | ||
1668 | if (fb_info->pixmap.addr && | 1669 | if (fb_info->pixmap.addr && |
1669 | (fb_info->pixmap.flags & FB_PIXMAP_DEFAULT)) | 1670 | (fb_info->pixmap.flags & FB_PIXMAP_DEFAULT)) |
1670 | kfree(fb_info->pixmap.addr); | 1671 | kfree(fb_info->pixmap.addr); |
@@ -1672,7 +1673,6 @@ static int do_unregister_framebuffer(struct fb_info *fb_info) | |||
1672 | registered_fb[i] = NULL; | 1673 | registered_fb[i] = NULL; |
1673 | num_registered_fb--; | 1674 | num_registered_fb--; |
1674 | fb_cleanup_device(fb_info); | 1675 | fb_cleanup_device(fb_info); |
1675 | device_destroy(fb_class, MKDEV(FB_MAJOR, i)); | ||
1676 | event.info = fb_info; | 1676 | event.info = fb_info; |
1677 | fb_notifier_call_chain(FB_EVENT_FB_UNREGISTERED, &event); | 1677 | fb_notifier_call_chain(FB_EVENT_FB_UNREGISTERED, &event); |
1678 | 1678 | ||
@@ -1681,6 +1681,22 @@ static int do_unregister_framebuffer(struct fb_info *fb_info) | |||
1681 | return 0; | 1681 | return 0; |
1682 | } | 1682 | } |
1683 | 1683 | ||
1684 | int unlink_framebuffer(struct fb_info *fb_info) | ||
1685 | { | ||
1686 | int i; | ||
1687 | |||
1688 | i = fb_info->node; | ||
1689 | if (i < 0 || i >= FB_MAX || registered_fb[i] != fb_info) | ||
1690 | return -EINVAL; | ||
1691 | |||
1692 | if (fb_info->dev) { | ||
1693 | device_destroy(fb_class, MKDEV(FB_MAJOR, i)); | ||
1694 | fb_info->dev = NULL; | ||
1695 | } | ||
1696 | return 0; | ||
1697 | } | ||
1698 | EXPORT_SYMBOL(unlink_framebuffer); | ||
1699 | |||
1684 | void remove_conflicting_framebuffers(struct apertures_struct *a, | 1700 | void remove_conflicting_framebuffers(struct apertures_struct *a, |
1685 | const char *name, bool primary) | 1701 | const char *name, bool primary) |
1686 | { | 1702 | { |