aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/video/fbmem.c18
-rw-r--r--drivers/video/udlfb.c2
-rw-r--r--include/linux/fb.h1
3 files changed, 19 insertions, 2 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index ad936295d8f..7a41220aebd 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -1651,6 +1651,7 @@ static int do_unregister_framebuffer(struct fb_info *fb_info)
1651 if (ret) 1651 if (ret)
1652 return -EINVAL; 1652 return -EINVAL;
1653 1653
1654 unlink_framebuffer(fb_info);
1654 if (fb_info->pixmap.addr && 1655 if (fb_info->pixmap.addr &&
1655 (fb_info->pixmap.flags & FB_PIXMAP_DEFAULT)) 1656 (fb_info->pixmap.flags & FB_PIXMAP_DEFAULT))
1656 kfree(fb_info->pixmap.addr); 1657 kfree(fb_info->pixmap.addr);
@@ -1658,7 +1659,6 @@ static int do_unregister_framebuffer(struct fb_info *fb_info)
1658 registered_fb[i] = NULL; 1659 registered_fb[i] = NULL;
1659 num_registered_fb--; 1660 num_registered_fb--;
1660 fb_cleanup_device(fb_info); 1661 fb_cleanup_device(fb_info);
1661 device_destroy(fb_class, MKDEV(FB_MAJOR, i));
1662 event.info = fb_info; 1662 event.info = fb_info;
1663 fb_notifier_call_chain(FB_EVENT_FB_UNREGISTERED, &event); 1663 fb_notifier_call_chain(FB_EVENT_FB_UNREGISTERED, &event);
1664 1664
@@ -1667,6 +1667,22 @@ static int do_unregister_framebuffer(struct fb_info *fb_info)
1667 return 0; 1667 return 0;
1668} 1668}
1669 1669
1670int unlink_framebuffer(struct fb_info *fb_info)
1671{
1672 int i;
1673
1674 i = fb_info->node;
1675 if (i < 0 || i >= FB_MAX || registered_fb[i] != fb_info)
1676 return -EINVAL;
1677
1678 if (fb_info->dev) {
1679 device_destroy(fb_class, MKDEV(FB_MAJOR, i));
1680 fb_info->dev = NULL;
1681 }
1682 return 0;
1683}
1684EXPORT_SYMBOL(unlink_framebuffer);
1685
1670void remove_conflicting_framebuffers(struct apertures_struct *a, 1686void remove_conflicting_framebuffers(struct apertures_struct *a,
1671 const char *name, bool primary) 1687 const char *name, bool primary)
1672{ 1688{
diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c
index 816a4fda04f..415e9b2f43d 100644
--- a/drivers/video/udlfb.c
+++ b/drivers/video/udlfb.c
@@ -1666,7 +1666,7 @@ static void dlfb_usb_disconnect(struct usb_interface *interface)
1666 for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++) 1666 for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++)
1667 device_remove_file(info->dev, &fb_device_attrs[i]); 1667 device_remove_file(info->dev, &fb_device_attrs[i]);
1668 device_remove_bin_file(info->dev, &edid_attr); 1668 device_remove_bin_file(info->dev, &edid_attr);
1669 1669 unlink_framebuffer(info);
1670 usb_set_intfdata(interface, NULL); 1670 usb_set_intfdata(interface, NULL);
1671 1671
1672 /* if clients still have us open, will be freed on last close */ 1672 /* if clients still have us open, will be freed on last close */
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 6a827487717..f9d013d09bc 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -997,6 +997,7 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
997/* drivers/video/fbmem.c */ 997/* drivers/video/fbmem.c */
998extern int register_framebuffer(struct fb_info *fb_info); 998extern int register_framebuffer(struct fb_info *fb_info);
999extern int unregister_framebuffer(struct fb_info *fb_info); 999extern int unregister_framebuffer(struct fb_info *fb_info);
1000extern int unlink_framebuffer(struct fb_info *fb_info);
1000extern void remove_conflicting_framebuffers(struct apertures_struct *a, 1001extern void remove_conflicting_framebuffers(struct apertures_struct *a,
1001 const char *name, bool primary); 1002 const char *name, bool primary);
1002extern int fb_prepare_logo(struct fb_info *fb_info, int rotate); 1003extern int fb_prepare_logo(struct fb_info *fb_info, int rotate);